[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] End labels

In Pluscal, labels are attached to (sequences of) statements: they identify units of atomic execution. The fact that they can also serve as targets of goto statements is rather secondary. Typically, code snippets like the one that you show will appear in a procedure, and you can use a return statement to terminate a procedure prematurely.


On 17 Dec 2014, at 15:51, fl <freder...@xxxxxxxxxxx> wrote:

I think we can't write like that something in PCAL:
begin algorithm ....
if FEOF(x) = EOF
  ret := 0;
  goto endlbl;
end if
ret := 1
endlbl: <---- Here is the problem
end algorithm
Obviously we can replace "endlbl:" by "endlbl: ret := ret" or another innocent step but it is less good.
(I know that in this case I might use an "else" but the point is the possibility to have a label with no
_expression_ behind to jump to the end of an algorithm when we want to modelize a multi return

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...@xxxxxxxxxxxxxxxx.
To post to this group, send email to tla...@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.