[Oberon] Anonymous procedure?
Jörg
joerg.straube at iaeth.ch
Fri Jan 18 09:30:49 CET 2019
Answers:
1) Lyall
No, you cannot write Append := PROCEDURE BEGIN END;
You always have to add an empty procedure
PROCEDURE Empty; END Empty;
and then assign Append := Empty;
2) Wojtek
Append := NIL and Append := Empty are not the same. In the first case, calling Append will result in a runtime error. In the latter case calling Append will do nothing.
Jörg
Am 18.01.19, 03:36 schrieb "Oberon im Auftrag von Skulski, Wojciech" <oberon-bounces at lists.inf.ethz.ch im Auftrag von skulski at pas.rochester.edu>:
Peter:
>Can an anonymous procedure be assigned to a procedure
>variable in any Oberon language. Illustrated hypothetically
>by this.
>(* Assign anonymous null procedure to Append. *)
>PROCEDURE NullifyAppend*(); BEGIN Append := PROCEDURE BEGIN END END NullifyAppend;
What is the motivation?
If I am not mistaken, you can assign NIL, which becomes an anonymous procedure which stops the execution when called. Is this what you need?
Wojtek
--
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