6.1.1380 EXIT CORE

Interpretation:

Interpretation semantics for this word are undefined.

Execution:

( -- ) ( R: nest-sys -- )

Return control to the calling definition specified by nest-sys. Before executing EXIT within a do-loop, a program shall discard the loop-control parameters by executing UNLOOP.

See:

Rationale:

Typical use: : X ... test IF ... EXIT THEN ... ;

Testing:

ContributeContributions

ruvavatar of ruv [83] execution of exitRequest for clarification2019-06-20 16:01:08

:NONAME 1 . ['] EXIT EXECUTE 2 . CR ; EXECUTE
  1. Is it a standard programme?
  2. If yes, what it should print? If no — what is the reason?

ruvavatar of ruv

And what about the following programme:

: e ['] EXIT EXECUTE ; IMMEDIATE
: t 1 . e 2 . ; t

AntonErtlavatar of AntonErtl

Both are not standard programs. The reason is the following ambiguous condition listed in 4.1.2:

attempting to obtain the execution token, (e.g., with 6.1.0070 ', 6.1.1550 FIND, etc. of a definition with undefined interpretation semantics;

Wrt. improving the standard: There is a closing parenthesis missing. Also, this ambiguous condition should not just be hidden in the System Documentation Requirements. After all, it documents a restriction on programs, not systems.

ruvavatar of ruv

It is slightly confused that a word has execution semantics but it cannot be passed to EXECUTE or COMPILE, in a standard way. Perhaps there is a sense to specify the run-time semantics in place of the execution semantics ("Execution" section) for such words, — like it is done for some other words without specified interpretation semantics (like IF). Isn't it?

AntonErtlavatar of AntonErtl

That's a good idea.

Reply New Version