[Oberon] INC(i) vs i := i + 1

Jörg joerg.straube at iaeth.ch
Mon May 3 18:33:14 CEST 2021


Semantically it’s the same. execution wise ther is a difference:
INC(i) is as fast as i := i +1;
INC(a[n]); is faster than a[n] := a[n] + 1; 

Jörg

> Am 03.05.2021 um 18:20 schrieb Jeff Maggio <jmaggio14 at gmail.com>:
> 
> 
> Hi all,
> 
> In most Oberon source, people tend to increment i with INC(i). Is there an efficiency reason for this, or is i := i + 1 just as fast?
> 
> I'm trying to write code that would be very easy for someone coming from python/C++ to understand, so I'd prefer to use i := i + 1 because it's syntactically familiar
> 
> best,
> Jeff
> --
> 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