[Cuis-dev] Fake polymorphism (was: [DEFECT] #copyFrom:count: for OrderedCollections)
Boris Shingarov
shingarov at labware.com
Wed Feb 7 08:42:17 PST 2024
On 2/6/24 17:24, Hernán Wilkinson via Cuis-dev wrote:
> ok. Which definition do you use?
> Could you also elaborate why you see it that restrictive?
Reminds me of our conversation in Tigre in 2017, where Theo called it
"Exploratory polymorphism", which I see as opposite to what Andrés seems
to have in mind when saying
> the message itself is wrong if it
If I understood correctly what Theo was saying, in a "pure exploratory"
universe such as Smalltalk, the word "wrong" just isn't part of the
vocabulary. You throw a message at an object and you observe what
happens — your are not entitled to demand the object behaves in a
particular way. A toddler explores the world by interacting with
objects. She shakes a beanbag toy, and the toy makes a rattling sound.
She then shakes a tennis ball, and the ball makes no sound. She shakes
her cat, and the cat scratches her. *This* is exploratory polymorphism.
To use words such as "correct" or "wrong" meaningfully, we would need
something else, something like ML's "modularity" or Haskell's
"typeclasses", where "signatures" are constraints expressing the concept
of "correct", see
https://people.mpi-sws.org/~dreyer/papers/mtc/main-long.pdf
In a live-model-of-universe, where objects are independent
"computational actors", what people have been trying to model "correct
behavior of the actor" is game-theoretic contracts, where you can
construct proofs-of-correctness as in, "I can prove that if the objects
I send messages from inside my method, satisfy the contract, then my
method will satisfy the contract".
More information about the Cuis-dev
mailing list