Cannot define macro in pluscal.

34 views
Skip to first unread message

thomas...@gmail.com

unread,
Feb 16, 2022, 10:22:18 PM2/16/22
to tlaplus
When I try and define a macro in pluscal like this (copied from the learntla website):

(*--algorithm test
variables A \in [ 1..N -> Int ], A0=A, piv;
begin

macro set_fork(fork, val) begin
     forks[fork] := val;
end macro;
piv := 0;

end algorithm *)


I get the error:

Expected ":=" but found "begin"

with the "begin" to the right of set_fork underlined. 

Am I doing anything obviously wrong?

Stephan Merz

unread,
Feb 17, 2022, 2:28:50 AM2/17/22
to tla...@googlegroups.com
The macro should be declared before the "begin" statement of the main algorithm.

Stephan

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/8fe38819-8310-4c78-abf8-beeb171b580bn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages