[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's so cool about Scheme?



At 04:47 PM 2003.06.03 -0500, Matt Hellige wrote:
>    abstype prime = P of int
>    with
>        val firstPrime = P 2
>        fun nextPrime p = ...
>        fun toInt (P n) = n
>        ...
>    end
>
>What's wrong with this? Note that I definitely wouldn't call
>SML OO, but I argue that it does offer invariants...

	Perhaps nothing is wrong with that; that *is* a 'poor man's object'.  But all these languages lack, I think, a decent way to do inheritance / polymorphism with those objects.  (<-- although at first appearance this seems to be a statement it is of course a challenge to show that you *can* :-)