Closed ercancem closed 7 years ago
When you first evaluate the function definition, the function is bound to the var my-iterate
. When you evaluate the broken definition, it fails, and nothing changes, the same function is still bound to my-iterate
, so (take 9 (my-iterate inc 5))
still works. All of this is expected, I don't really see the issue?
I accidentally closed this.
Even though I accidentally closed it a minute ago and then reopened it I think that it's not an issue. The comment from the previous user is correct. When you try to define a var in Clojure if the code doesn't compile the var won't be defined/redefined.
The title is a bit cryptic.
Example: I define a function and a simple line to test it, for example:
I start the proto-repl console from open project, load my file. Both execute code block from the file and invoking it from the console with some arguments work fine. Then I deliberately break the function. For example:
I save the file, reload the file. If I execute the function definition code block, I get an error as expected. But
(take 9 (my-iterate inc 5))
still works. I have to stop and reload the repl.Am I doing something wrong? What is the correct procedure after editing the current file?