Arc Forumnew | comments | leaders | submitlogin
8 points by absz 6321 days ago | link | parent

On some level, the answer is "yes, of course."

  (mac delay body
    `(annotate 'promise (fn () ,@body)))
  
  (def force (promise)
    ((rep promise)))
This was lightly adapted from http://cadrlife.blogspot.com/2008/02/lazy-lists-in-arc.html which I found on this forum -- read it for a more complete version with various supporting functions, etc. It's not primitive lazy evaluation, but it should work for many of the same things that delay/force work for.


1 point by cooldude127 6321 days ago | link

i knew i had seen it done for arc already. it was that article.

-----