merits of Lisp vs Python
Bill Atkins
SPAM-IS-batkins57-FOR-LOSERS at gmail.com
Sun Dec 17 02:28:05 EST 2006
More information about the Python-list mailing list
Sun Dec 17 02:28:05 EST 2006
- Previous message (by thread): merits of Lisp vs Python
- Next message (by thread): merits of Lisp vs Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
greg <greg at cosc.canterbury.ac.nz> writes: > André Thieme wrote: >> (aif (timeConsumingCalculation) >> (use it)) > > I think the answer is that you just wouldn't do > that in Python at all. Having magic variables > spring into existence in your local namespace > as a side effect of calling something is just > not Pythonic. (It is very Perlish, on the other > hand.) Anaphoric macros are controversial in CL, too, for just that reason. But there are a parallel set of macros that explicitly bind a variable so you can get the convenience without the weirdness: (bif (items (remove-if-not #'useful-p big-list-o-items)) (format t "~D items~%" (length items)) (format t "Nothing useful.~%")) You can rewrite the expression in the grandparent as: (aif (result (timeConsumingCalculation)) (use result) or, more idiomatically: (awhen (result (time-counsuming-calculation)) (use result))
- Previous message (by thread): merits of Lisp vs Python
- Next message (by thread): merits of Lisp vs Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list