I come to praise .join, not to bury it...
Darren New
dnew at san.rr.com
Thu Mar 15 18:15:28 EST 2001
> Hmm ... I wonder what I'd do if I could overload __if__ ...
That's how Smalltalk works. It has no "if" statement. There's an "IfElse"
method that takes two blocks. True evaluates its first argument, False its
second, in a polymorphic way. So
bool if: [yes yes] else: [no no]
doesn't contain any branching code. Just a polymorphic dispatch. Very
strange to wrap your head around. :-)
(Of course, in reality, it branches for efficiency, recognised by the
compiler, but in theory...)
--
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST). Cryptokeys on demand.
More information about the Python-list
mailing list