[Inform 6] jump to nothing

With Inform 6 in Zcode:

[ Rtn; jump jlabel; .jlabel; ]; [ Main; Rtn(); ]; Inform 6 refuse to compile and messages errors are:

[ Rtn; jump jlabel; .jlabel; rtrue; ];With rtrue it’s O.K.

If [ Rtn; ] is equal to [ Rtn; rtrue; ] why [ Rtn; jump label; .label; ] isn’t equal to [ Rtn; jump label; .label; rtrue; ] !?

Perhaps Inform 6 should compil it and print out a warning message !?

There’s a comment in the compiler:

        /*  Interesting point of Inform grammar: a statement can only
            consist solely of a label when it is immediately followed
	by a "}".                                                    */

Which is just saying “It was written that way,” I suppose. There might have been a reason that nobody remembers any more.

I can see the annoyance. On the other hand this isn’t exactly crucial. Do you think it’s worth going in and trying to allow a “]” after a label?

This is not a warning situation. Either it works or it doesn’t.

Outside a block, a label must precede a statement, but a statement can be empty:

[ Rtn;
    jump jlabel;
[ Main;

I don’t see the point, though: using return/rtrue/rfalse is effectively the same and is more readable.

Yes, of course !

No. But, even if we can’t see it, there’s always a return/rtue/rfalse before a ‘]’, so why in this case there’s no invisible rtrue before ‘]’ and after ‘.jlabel’ ?

[ Rtn; ];In assembly-language: 2 +00008 [ Rtn 6 +00009 <*> rtrue In this source code, we can’t see it but THERE’S a rtrue.

[ Rtn; jump jlabel; .jlabel; ]; In this source code, we can’t see it and THERE IS NO rtrue. Why ? (It is certainly a stupid question !)

That’s all. Thanks and sorry for my english.

The grammar of Inform 6 does not allow labels in that position. rtrue or rfalse is only automatically added to a syntactically valid routine.

You might as well ask why there is no rtrue in:

[ Rtn;
    please return the value <true>;

The answer is that the Inform 6 compiler only understands Inform 6. Routine-final labels are (for whatever reason) not Inform 6.

I think you might be confused by the two meanings of rtrue. What you explicitly type in the source code is an Inform 6 statement. What you see in the assembly trace is a Z-machine opcode.

In the case of break, Inform 6 do the job.[ Rtn; for(::) { break; } ]; In assembly-language: 2 +00008 [ Rtn 6 +00009 .L0 7 +00009 <*> jump L1 7 +0000c .L1 9 +0000c <*> rtrue

O.K. Thanks.