Python syntax in Lisp and Scheme
Greg Ewing (using news.cis.dfn.de)
g2h5dqi002 at sneakemail.com
Thu Oct 9 23:07:56 EDT 2003
Daniel P. M. Silva wrote:
> Nice! I was alluding to MzScheme's class.ss but I guess that's a fun hobby
> to have. :) Do you have your class systems available anywhere to download?
> I would be especially interested in them if they allow multiple
> inheritance, run-time pillaging of class contracts, and explicit "this"
> arguments to methods...
I might be able to dig up the most recent one, but it was
quite a few years ago.
It didn't have multiple inheritance, though, and very little
in the way of introspection abilities. Basically it just
stuffed the whole class into a big lambda expression. And
"self" wasn't really an argument, as far as I remember --
more like a sort of predefined instance variable that
always pointed to the instance itself.
> You still can't add new binding constructs or safe parameterizations like a
> with_directory form:
>
> with_directory("/tmp", do_something())
>
> Where do_something() would be evaluated with the current directory set to "
> tmp" and the old pwd would be restored afterward (even in the event of an
> exception).
That's true, although you don't really need macros for that,
just something like Smalltalk-style code blocks -- if anyone
can come up with a way of grafting them into the Python
syntax...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list