A critic of Guido's blog on Python's lambda

A. Rogowski ajr at bez_tego.aster.pl
Tue May 16 07:50:08 EDT 2006


aleaxit at yahoo.com (Alex Martelli) writes:

> Bill Atkins <NOatkinwSPAM at rpi.edu> wrote:
>    ...
> > > ``allow ( as an ordinary single-character identifier'' as for the
> > > unneded feature ``allow unnamed functions with all the flexibility of
> > > named ones''.
> > 
> > Not so infeasible:
> > 
> >   (let ((|bizarrely(named()symbol| 3))
> >      (+ |bizarrely(named()symbol| 4))
> > 
> >    ;; => 7
> 
> Read again what I wrote: I very specifically said "ordinary
> *single-character* identifier" (as opposed to "one of many characters
> inside a multi-character identifier").  Why do you think I said
> otherwise, when you just quoted what I had written?  (Even just a
> _leading_ ( at the start of an identifier may be problematic -- and just
> as trivial as having to give names to functions, of course, see below).

bah...

[1]> (setq rtbl (copy-readtable))
#<READTABLE #x203A0F6D>
[2]> (set-syntax-from-char #\{ #\()
T
[3]> (set-syntax-from-char #\( #\a)
T
[4]> {defun ( {a) {1+ a))
(
[5]> {( 1)
2
[6]> {( 4)
5
[7]> {setq *readtable* rtbl)
#<READTABLE #x203A0F6D>
[8]> (1+ 1)
2

With readtable and reader macros you can change the syntax as you
wish.

ajr.





More information about the Python-list mailing list