On Sep 21, 6:53 pm, patrickdlogan <patrickdlo...@gmail.com> wrote:
> I expected a delay only to be forced by an explicit call to force.
> instead it looks like, being a kind of IDeref, a delay will be forced
> by the REPL.
>
> e.g.
>
> user=> (def del (delay (println "printed") (+ 2 3)))
> #'user/del
> user=> del
> printed
> #<de...@8691dee: 5>
> user=> (force del)
> 5
>
> The documentation seems to imply the only way to force a delay is
> through the force procedure...

I'm pretty sure force is still causing the evaluation... Just
indirectly :)

The delay here is forced by its print method, which, as you can see,
also prints the value. Delays could be changed to print something like
#<de...@232aee0: not computed>, but I wonder if that's really useful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to