Python syntax in Lisp and Scheme
Kenny Tilton
ktilton at nyc.rr.com
Thu Oct 9 15:15:18 EDT 2003
Alex Martelli wrote:
> Kenny Tilton wrote:
>
>
>>Alex Martelli wrote:
>>
>>>... I do believe that the
>>>divergence problem has more to do with human nature and sociology, and
>>>that putting in a language features that encourage groups and subgroups
>>>of users to diverge that language ....
>>
>>Can someone write a nifty Python hack to figure out how many times
>>Lispniks have tried to get Alex to explain how macros are any different
>>than high-order functions or new classes when it comes to The Divergence
>>Problem? I love that we have given it a name, by the way.
>
>
> The very 'feature' that was touted by Erann Gat as macros' killer advantage
> in the WITH-CONDITION-MAINTAINED example he posted is the crucial
> difference: functions (HO or not) and classes only group some existing code
> and data; macros can generate new code based on examining, and presumably to
> some level *understanding*, a LOT of very deep things about the code
> arguments they're given.
Stop, your scaring me. You mean to say there are macros out there whose
output/behavior I cannot predict? And I am using them in a context where
I need to know what the behavior will be? What is wrong with me? And
what sort of non-deterministic macros are these, that go out and make
their own conclusions about what I meant in some way not documeted?
I think the objection to macros has at this point been painted into a
very small corner.
> ...If all you do with your macros is what you could
> do with HOF's, it's silly to have macros in addition to HOF's
There is one c.l.l. denizen/guru who agrees with you. I believe his
position is "evrything can be done with lambda". And indeed, many a
groovy WITHOUT-CELL-DEPENDENCY expands straight into:
(call-with-cell-dependency (lambda () ,yadayadayada))
But code with WITHOUT-CELL-DEPENDENCY looks prettier (I hope we can
agree that that matters, esp. if you are a Pythonista).
-- just
> MTOWTDItis encouraging multiple different approaches to solve any given
> problem -- this, of course, in turn breeds divergence when compared to a
> situation in which just one approach is encouraged. If you do use the
> potential implied in that example from Gat, to do things that functions and
> classes just couldn't _begin_ to, it's worse -- then you're really
> designing your own private divergent language (which most posters from
> the Lisp camp appear to assert is an unalloyed good, although admittedly
> far from all). This is far from the first time I'm explaining this, btw.
Oh. OK, now that you mention it I have been skimming lately.
>
>>One popular macro is WITH-OUTPUT-TO-FILE. My budding RoboCup starter kit
>>was a vital WITH-STD-ATTEMPT macro. Oh god, no! I need to see the ANSI
>
>
> Do they do things a HOF or class could do?
Yes.
>... If so why bother using such
> an over-powered tool as macros instead of HOFs or classes?
Hang on, we just agreed that in this case the only added value is
prettier code. Nothing over-powered going on. (And that is, in this
case, why I bother.)
--
http://tilton-technology.com
What?! You are a newbie and you haven't answered my:
http://alu.cliki.net/The%20Road%20to%20Lisp%20Survey
More information about the Python-list
mailing list