Ray Dillinger scripsit:

> It is possible to write bad code in any language. The more effort
> someone wastes trying to make it hard to write bad code, the worse 
> the bad code becomes.

It's a matter of line-drawing.  Even in Scheme, home of flexible control,
you can't jump into the middle of a procedure.

What makes macro hygiene critical, I think, is that it can't be emulated
without being able to do a global transformation of all code, not merely
macro definitions and calls.  Similarly, you can't provide tail recursion
or lexical scoping in a Lisp that doesn't have them except in the same
way -- everything must be rewritten.

The old gensym trick provides only half of hygiene: it prevents names
bound in the macro from leaking to the macro's caller.  But it does
nothing, and no amount of fiddling with define-macro can do anything,
about names free in the macro (or bound at the definition point) from
being overridden by the bindings at the time of call.  Without full
hygiene, macro writers and users are playing with knives.

> A good language designer makes it easy and simple to write good code. 
> If that also makes it easy and simple to write bad code, then at 
> least the bad code will be simply written and, bugs and all, simple 
> to understand.

If the consequences of bad hygiene (or dynamic scoping) were easy to
understand, they would have been fixed in Lisp 1.5.

-- 
Mark Twain on Cecil Rhodes:                    John Cowan
I admire him, I freely admit it,               http://www.ccil.org/~cowan
and when his time comes I shall                [email protected]
buy a piece of the rope for a keepsake.

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to