I wan't aware of LazyMap! My solution so far was to attach functions
instead of values in maps. You 're still deferring the computation to
the underlying fn...in a sense it is a getter isn't it? and you can also
pass the map around to effectively get polymorphic behaviour on the fns
that accept the map and execute fns from within it...
LazyMap looks cool though... :-)
Jim
On 18/06/12 15:48, Vinzent wrote:
Yeah, I'm waiting for concrete example too.
By the way, if you really need to change :area from value to deferred
computation then you can just change your data structure
implementation from hash-map to lazy map (i.e. a map whose values are
delays deref'd on access). This would require changing code only in
one place.
--
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
--
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