Python w/Forth Runtime????

Patrick W quitelikely at yahoo.com.au
Sat May 18 01:24:03 EDT 2002


Tim Daneliuk <tundra at tundraware.com> writes:

> Christopher Browne wrote:
> > 
> > Common Lisp conspicuously supports multiple simultaneous paradigms.
> 
> Could you expand on this a bit?  It has been a *very* long time since I
> even looked at Lisp, let along programmed it...

In Common Lisp you often use a mixture of procedural, functional and
object oriented styles. It's a perfectly natural way to use the
language, just as it is in Python. (But the functional support in Lisp
is obviously much more pervasive).

If you want to decompose a problem in terms of functions, and avoid
side-effects, that's fine. Everything returns a value (unless you ask
it not to), and you can treat every data structure as immutable if you
wish, but there is nothing forcing you to do this. If you want to use
a combination of functions and procedures that operate with our
without side effects, and with or without special (eg. global)
variables, again no problem.

As for object oriented programming, it's a somewhat overloaded term
that means different things to different people. In Lisp you have a
lot of choices. You can either implement objects as closures, or you
can use a complete fully-fledged object system that supports multiple
inheritance and is polymorphic on more than one of its arguments.
That's all part of CLOS (Common Lisp Object System) which is part of
the Common Lisp standard. (Incidentally CLOS was the first ANSI
standardised object oriented language, and is still arguably streets
ahead of the competition in terms of power and flexibility).

Beyond that, Common Lisp offers another form of abstraction that other
languages can only offer very awkwardly, if at all: ie. macros. You
can manipulate the language in its own language, which probably makes
Lisp better equipped to seamlessly incorporate future paradigms than
any other language.

If you haven't looked at Lisp since say, 1994, it's a very different
language from the one you remember. It's a pity more people don't seem
to know what's available in Lisp. It's an amazing language.




More information about the Python-list mailing list