Extending Python Syntax with @
Cameron Laird
claird at lairds.com
Wed Mar 10 20:28:47 EST 2004
In article <fkbv40dh57pk9527seaf3etjd0k7kncugc at 4ax.com>,
David MacQuigg <dmq at gain.com> wrote:
.
.
.
>Wouldn't it be nice, for example, if instead of special keywords like
>'lambda' and 'yield', we had used '@(args)' and '@return'. ( No, I'm
>not advocating we go back and change what has been done.) In both
>these cases, we had a well-established syntax that needed a slight
>variation.
>
>The 'lambda function' for example, was needed to cram a small block of
>code into a tight space. By saying '@x,y:' instead of 'lambda x,y:',
>we not only avoid the need for a new keyword, but we better serve the
>purpose of tightly packing some code. We would also avoid mystifying
>beginners. "It has no magic meaning. It's just a way to write a
>function without a name."
.
.
.
No, for me it would be so far from nice I first suspected you
of jesting, because, from my background, "lambda" *does* have
a magic meaning, one that long precedes its (entirely apt) use
in Python. For you, '@(args)' might indeed be more evocative;
for me, not calling a lambda "lambda" would be a big loss.
I think APL and J (and Perl) are plenty meritorious. I prefer
Python--much.
--
Cameron Laird <claird at phaseit.net>
Business: http://www.Phaseit.net
More information about the Python-list
mailing list