Python syntax in Lisp and Scheme
Eli Barzilay
eli at barzilay.org
Tue Oct 7 19:06:15 EDT 2003
james anderson <james.anderson at setf.de> writes:
> Eli Barzilay wrote:
> >
> > james anderson <james.anderson at setf.de> writes:
> >
> > > Eli Barzilay wrote:
> > > >
> > > > (This hits one of the major differences between Lisp and
> > > > Scheme -- in Lisp I'm not as happy to use HOFs because of the
> > > > different syntax
> > >
> > > which different [] syntax?
> >
> > Huh?
>
> that is, what is different about the syntax for higher-order
> functions in lisp?
funcall, function, #', the double namespace.
> > Yes, but I was talking about the difference approaches, for
> > example:
> >
> > (dolist (x foo)
> > (bar x))
> >
> > vs:
> >
> > (mapc #'bar foo)
>
> are these not two examples of coding in common-lisp. how do they
> demonstrate that "scheme is much more functional"?
The first is very popular, the second is hardly known. R5RS has
`for-each' which is exactly like `mapc', but no `dolist' equivalent.
In Scheme, this is not a problem, in Lisp, the syntax makes me worry
for the extra effort in creating a closure.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
More information about the Python-list
mailing list