[Oberon] Functional programming and Oberon
Robert Ransom
rransom.8774 at gmail.com
Sun Dec 18 23:45:44 CET 2016
On 12/17/16, Richard Hable <informujo at aon.at> wrote:
> Am 2016-12-15 um 23:35 schrieb Robert Ransom:
>
>>> Without generics (i.e. type parameters for functions, types, and values)
>>> it is not possible to define reusable persistent collections. We can't
>>> just build and manipulate aribitrary pointer structures.
>
>> Type extension is sufficient. A collection module can allow its
>> client modules to allocate extensions of its own Entry record type, or
>
> But then one can not store values of arbitrary types in the collections,
> only specially created ones inheriting from the collection entry base type.
>
>> it can operate on keys and/or values of type Objects.Object.
>
> There is no generic Object type in Oberon (and Trankvila); for good
> reasons! Using such a "garbage" type takes away the advantages of static
> typing.
The Gadgets system added one to Oberon (see Appendix A of Wirth's
ProjectOberon1992.pdf).
> And in both solutions a lot of type casts at runtime would be necessary.
Java (which your language is built on) implements generics using its
java.lang.Object type too. I don't think hiding the run-time type
casts behind syntactic sugar, as Java does, is worth the complexity it
adds (both implementation and semantic) to the language.
More information about the Oberon
mailing list