[Oberon] Type guard: unnecessary?

Jörg Straube joerg.straube at iaeth.ch
Sat Oct 8 12:01:31 CEST 2016


Hi Srinivas

Strictly speaking it is not necessary, as this statement with type guard
  r := p(Circle).radius;

could be te-written as
  IF p IS Circle THEN
     c := SYSTEM.VAL(Circle, p);
     r := c.radius
  END;

Jörg

> Am 08.10.2016 um 11:01 schrieb Srinivas Nayak <sinu.nayak2001 at gmail.com>:
> 
> Any help please?
> 
> 
> With thanks and best regards,
> 
> Yours sincerely,
> Srinivas Nayak
> 
> Home: http://www.mathmeth.com/sn/
> Blog: http://srinivas-nayak.blogspot.in/
> 
>> On 09/29/2016 06:58 PM, Srinivas Nayak wrote:
>> Dear All,
>> 
>> In the Programming in Oberon (Tutorial) rev. 5.10.2015, in section 23.2 last paragraph we read:
>> "The simple designator p.radius would not be acceptable, because p is of type Figure."
>> In section 23.4 last but one paragraph we read:
>> "The further facility of the type guard is merely one of convenience."
>> 
>> Is type guard not necessary?
>> 
>> 
>> With thanks and best regards,
>> 
>> Yours sincerely,
>> Srinivas Nayak
>> 
>> Home: http://www.mathmeth.com/sn/
>> Blog: http://srinivas-nayak.blogspot.in/
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list