[Edu-sig] An OOP view of the "number" concept
christian.mascher at gmx.de
Sun Apr 22 14:58:40 CEST 2007
>Of course this still looks strange to people who grew
>up in the 1900s (as I did) and think in a different paradigm.
>In the old way of thinking, operations were not included
>in our type definitions. The idea of "adding" was
>somehow independent of the set theory definitions
>(since dispensed with) of integers for example.
I still recall the moment, when - while learning some smalltalk (after I
knew Python) - one expression really impressed me:
Because in smalltalk nearly all expressions are message sends of the syntax
this would mean the same as
in a python-like-syntax. So 2 is an object, which you can ask to give
you its sine-value. This is classical smalltalk-80.
"Everything is an object" means more to me since that moment.
It is interesting how they do this in smalltalk, for instance, you can
easily put different kinds of number types on the left side- like "2.0
sin" gives you the same value for a float type.
Actually in Python, dot-notation breaks down with this case:
I just noticed that. Perhaps one of the reasons smalltalk doesn't use
More information about the Edu-sig