[Oberon] Serious type loophole in type case statements and a possible fix

Luca Boasso luke.boasso at gmail.com
Fri Oct 30 20:44:35 CET 2020


I agree :)

On Fri, Oct 30, 2020 at 2:37 PM Diego Sardina <dsar at eml.cc> wrote:

> On Fri, Oct 30, 2020, at 3:25 PM, Luca Boasso wrote:
> >
> > I remember reading about a similar issue related to the WITH statement
> of Oberon-90, so the way I solved this problem in oberonc is to add an
> additional type test each time the case variable is referred in the
> statements of a particular case label.
>
> This is the way to go.
>
> The WITH's loophole was fixed in Oberon-2/CP (at least in report) by
> specifying explicity:
>
> "[...] and apply a typeguard to every occurrence of the tested variable
> within this statement sequence."
>
> Oberon-90 says something similar with different words and it's not clear
> what is the meaning of "extending the guard over an entire statement
> sequence".
>
> In my opinion, these two statements have the same meaning. In Oberon-2
> they made it straightforward.
>
> So the WITH statement is just a syntactic sugar to avoid the type guard
> syntax and the loophole is just an optimisation issue.
>
> --
>   Diego Sardina
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20201030/2d5b890b/attachment.html>


More information about the Oberon mailing list