steven at REMOVE.THIS.cybersource.com.au
Thu Jun 18 03:34:25 CEST 2009
On Wed, 17 Jun 2009 16:37:04 +0000, Lie Ryan wrote:
>> Imagine for a moment that there are no boolean values. There are no
>> numbers. They were never invented. There are no classes.
>> There are no objects.
>> There are only functions.
>> Could you define functions that act like boolean values? And could you
>> define other functions to operate on them?
> String isn't considered object?
Given that the strings only exist inside one function specifically for
printing, I think we can ignore that. If you prefer, print_bool() could
look at the function names, that would work just as well. One way or the
other, we have to get human-readable names into the system *somehow*.
> Also, b/true()/false() is a function object, isn't it? Unless function
> is first-class, you can't pass them around like that, since you need a
> function pointer (a.k.a number); but if function is first-class then
> there it is an object.
That's an implementation detail. So long as you can pass around
functions, and return them, then it doesn't matter whether they are
implemented as objects or not.
More information about the Python-list