[Oberon] R: Should one automatically initalize local pointer or procedure variables (safety precaution)?
ferrari_stefano at alice.it
ferrari_stefano at alice.it
Tue Mar 5 09:06:00 CET 2019
IMHO automatic pointer initialization is agianst the Oberon spirit not to have hidden features.Anyway automatic initialization is not always a good choiche.PROCEDURE ClearList (list: List);VAR node, next: Node; (* pointers to list nodes *)BEGINnode := list.first; (* first node in list *)WHILE node # NIL DO next := node; (* do something here with node *)node := NIL;node := next;END;list.first := NIL;END ClearList;Here node and next pointers initialization is not required
RegardsStefano
--
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/20190305/318df42f/attachment.html>
More information about the Oberon
mailing list