From: ·········@gmail.com
Subject: Re: Python gets macros
Date: 
Message-ID: <1101841539.540104.240480@f14g2000cwb.googlegroups.com>
This is really cool, and I hope it catches on like wildfire in the
Python community. If I can't use Lisp, I'd like to be able to use
Python instead---and this has great potential.

It's an extended version of Python with code/data equivalence. They
have what looks like the Common Lisp macros we've all come to know and
love (since they used those for inspiration), with gensyms and
backquote and everything, but with different syntax and some
modifications to support syntax.

The unit testing framework example should make anyone drool if they
haven't been exposed to macros before. Many kudos to the ones behind
this.

-Peter Scott

From: Kenny Tilton
Subject: Re: Python gets macros
Date: 
Message-ID: <yw4rd.36511$Vk6.27456@twister.nyc.rr.com>
·········@gmail.com wrote:
> This is really cool, and I hope it catches on like wildfire in the
> Python community. If I can't use Lisp, I'd like to be able to use
> Python instead---and this has great potential.
> 
> It's an extended version of Python with code/data equivalence. They
> have what looks like the Common Lisp macros we've all come to know and
> love (since they used those for inspiration), with gensyms and
> backquote and everything, but with different syntax and some
> modifications to support syntax.

Sexprs? How does the macro author parse the python source input? Are 
there any small examples you can post?

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: ·········@gmail.com
Subject: Re: Python gets macros
Date: 
Message-ID: <1101855834.857496.130390@f14g2000cwb.googlegroups.com>
Kenny Tilton wrote:
> Sexprs? How does the macro author parse the python source input? Are
> there any small examples you can post?

Their data structure ("code-data") for dealing with Python code looks
unnervingly like sexprs. Check out
http://logix.livelogix.com/tutorial/7-Languages-Extending-and-Creating.html#7.4
for more examples. I would post more here, but I have to run.
-Peter Scott
From: Kenny Tilton
Subject: Re: Python gets macros
Date: 
Message-ID: <nYard.36986$Vk6.15554@twister.nyc.rr.com>
·········@gmail.com wrote:

> Kenny Tilton wrote:
> 
>>Sexprs? How does the macro author parse the python source input? Are
>>there any small examples you can post?
> 
> 
> Their data structure ("code-data") for dealing with Python code looks
> unnervingly like sexprs. Check out
> http://logix.livelogix.com/tutorial/7-Languages-Extending-and-Creating.html#7.4

Ah,yes:

"7.5.2 Macros

"When the implementation begins macro, the operator is implemented as a 
compile-time macro. If you are a Lisper, you are on familiar ground � 
the design of Logix�s macro system was heavily influenced by Lisp 
macros.  If you are not familiar with Lisp (or similar) macros, things 
are about to get interesting!"

Where were they when Norvig explained that Python does not need macros! 
The syntax is horrific. Remember when the guiding principle of Python 
was simplicity?

Anyway, game over.

kt

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: John Thingstad
Subject: Re: Python gets macros
Date: 
Message-ID: <opsibhg2r0pqzri1@mjolner.upc.no>
On Wed, 01 Dec 2004 03:33:39 GMT, Kenny Tilton <·······@nyc.rr.com> wrote:

>
>
> ·········@gmail.com wrote:
>
>> Kenny Tilton wrote:
>>
>>> Sexprs? How does the macro author parse the python source input? Are
>>> there any small examples you can post?
>>   Their data structure ("code-data") for dealing with Python code looks
>> unnervingly like sexprs. Check out
>> http://logix.livelogix.com/tutorial/7-Languages-Extending-and-Creating.html#7.4
>
> Ah,yes:
>
> "7.5.2 Macros
>
> "When the implementation begins macro, the operator is implemented as a  
> compile-time macro. If you are a Lisper, you are on familiar ground –  
> the design of Logix’s macro system was heavily influenced by Lisp  
> macros.  If you are not familiar with Lisp (or similar) macros, things  
> are about to get interesting!"
>
> Where were they when Norvig explained that Python does not need macros!  
> The syntax is horrific. Remember when the guiding principle of Python  
> was simplicity?
>
> Anyway, game over.
>
> kt
>

My initial feeling exactly!
UGH!
The Lisp lesson is that macroes are only likely to be used
if the syntax of the language itself is simple.
Otherwise creating or manipulating a syntax tree is
so complicated peaple avoid it.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
From: Tayssir John Gabbour
Subject: Re: Python gets macros
Date: 
Message-ID: <1101908398.466384.12060@z14g2000cwz.googlegroups.com>
John Thingstad wrote:
> On Wed, 01 Dec 2004 03:33:39 GMT, Kenny Tilton <·······@nyc.rr.com>
wrote:
> > Where were they when Norvig explained that Python does not need
macros!
> > The syntax is horrific. Remember when the guiding principle of
Python
> > was simplicity?
>
> My initial feeling exactly!
> UGH!
> The Lisp lesson is that macroes are only likely to be used
> if the syntax of the language itself is simple.
> Otherwise creating or manipulating a syntax tree is
> so complicated peaple avoid it.

That might be the point: to scare people away from using it. The
designers of Python and Ruby are explicit about scaring all but
"wizard" users away. By making these features harder to use.

So not only is there an aristocracy judging how users should think,
there's further stratification in the user community.

Still, I thank the author of this macro system. I have to work in
Python, and people are using this horrible "documentation string
testcase" feature. Where it emulates a REPL and tests printed string
representations.


MfG,
Tayssir

--
Tyranny of the majority is another term for democracy.
Tragedy of the commons is averted by the crudest communication.
Decentralized democracy helps keep rights intact.