3 ms·
I'm not the parent so I can't answer from their experience, but I will say that laziness in Haskell lets you write functions that cannot be expressed in Lisp wi
by chongli 7y ago
I'm not the parent so I can't answer from their experience, but I will say that laziness in Haskell lets you write functions that cannot be expressed in Lisp without macros.
Some simple examples are when and unless, which work like if...then and if not... then.
In most languages, these would be control flow statements built into the language (or not) and could not be written by the user. In Lisp you could implement these with macros, with all of the caveats that apply. In Haskell they're just ordinary functions with all of the benefits of being first class values at runtime.
- futureastronaut 7y ago> Lisp without macros Why even consider that? Macros are IMO the main reason to use a LISP. As you suggested, they allow you to model laziness, or whatever else you might desire.
- chongli 7y agoBecause macros are not first class the way functions are. You can't map a macro over a list the way you can a function. Haskell functions give you the power of lisp macros at runtime. Macros are IMO the main reason to use a LISP. It's funny that you say that. I've heard it before and it sounds great but from the time I spent in the Clojure community, people would always say "the first rule of macros is that you do not write macros!"