How to add laziness to a strict language without even being odd
暂无分享,去创建一个
This note explicates two styles of lazy programming, showing how one (called \odd") is easy to encode in the tradi-tionaìdelay' and`force' syntax, but forces too much evaluation , while the other (called \even") delays evaluation as in traditional lazy languages, but is harder to encode. It presents a newìazy' syntax, and shows how the even style is easy to encode in this syntax, while the odd style is harder to encode. The newìazy' syntax is deened by translation into thèdelay-force' syntax. Comparisons are drawn with two other syntaxes, one used in CAML and one proposed by Chris Okasaki, and a prototype implementation in SML/NJ is described.
[1] Gerald J. Sussman,et al. Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.
[2] Chris Okasaki,et al. Purely functional data structures , 1998 .