-
Hello! I was recently trying to implement a ~(if (def ,bl ,br) ,(aux (+ 2 i)) ,fal2) It made me realize that the scope of variables defined in the condition also extends to its body. As a more... extreme(?) example: (when (> (def x 1) 0)
(printf "%j is greater than 0" x)) Is this intended behavior? I found it really good, but I don't quite understand how this has come to happening. I have found interesting uses for this, though. I'm experimenting using a sort of "iterator" that eventually returns (while (def x (iterator-func))
(do-something-with x)) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! Yes, from my experience, it is an intended behavior I am using in many places. My guess is that both specials are designed and developed this way intentionally. But I am unsure if I have ever discussed it. |
Beta Was this translation helpful? Give feedback.
Hello! Yes, from my experience, it is an intended behavior I am using in many places. My guess is that both specials are designed and developed this way intentionally. But I am unsure if I have ever discussed it.