On Tue, Jul 12, 2011 at 3:01 PM, Konrad Hinsen
<konrad.hin...@fastmail.net> wrote:
> On 12 Jul 2011, at 15:40, James Keats wrote:
>
>> My humble understanding is that macros complicate composability,
>> whereas monads facilitate it.
>
> The composability issue with macros lies in writing them, not using them.
> Monads are all about composing computations with specific properties, where
> the monad abstracts away those properties. But I don't see any common point
> between macros and monads other than that both words start with 'm'.

Well, they *do* also have a total of five letters, including an 'a'
and and an 'o' as well as two consonants besides the initial 'm'. Oh,
and the second letter is a vowel in both cases.

I think maybe Haskell also relies on monads for some of the things
where a Lisp traditionally relies on macros, such as implementing
control structures -- Haskell has lazy function arguments, and it's
already clear from sequence-m and maybe-m that monads can implement
some kinds of conditionals and loops and even a form of exception
handling.

> One approach that has been proposed to improve composability of macros is to
> adopt a continuation-passing style. This would make macros a candidate for
> the continuation monad, so perhaps monads may be of use in implementing
> complex macros.

That popcorn-popping sound you hear is heads exploding out there in
the audience.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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