- ABORT
- ABORT"
- ABS
- ACCEPT
- ACTION-OF
- AGAIN
- ALIGN
- ALIGNED
- ALLOT
- AND
- BASE
- BEGIN
- BL
- BUFFER:
- [
- [CHAR]
- [COMPILE]
- [']
- CASE
- C,
- CELL+
- CELLS
- C@
- CHAR
- CHAR+
- CHARS
- COMPILE,
- CONSTANT
- COUNT
- CR
- CREATE
- C!
- :
- :NONAME
- ,
- C"
- DECIMAL
- DEFER
- DEFER@
- DEFER!
- DEPTH
- DO
- DOES>
- DROP
- DUP
- /
- /MOD
- .R
- .(
- ."
- ELSE
- EMIT
- ENDCASE
- ENDOF
- ENVIRONMENT?
- ERASE
- EVALUATE
- EXECUTE
- EXIT
- =
- FALSE
- FILL
- FIND
- FM/MOD
- @
- HERE
- HEX
- HOLD
- HOLDS
- I
- IF
- IMMEDIATE
- INVERT
- IS
- J
- KEY
- LEAVE
- LITERAL
- LOOP
- LSHIFT
- MARKER
- MAX
- MIN
- MOD
- MOVE
- M*
- -
- NEGATE
- NIP
- OF
- OR
- OVER
- 1-
- 1+
- PAD
- PARSE-NAME
- PARSE
- PICK
- POSTPONE
- +
- +LOOP
- +!
- QUIT
- RECURSE
- REFILL
- REPEAT
- RESTORE-INPUT
- R@
- ROLL
- ROT
- RSHIFT
- R>
- SAVE-INPUT
- SIGN
- SM/REM
- SOURCE-ID
- SOURCE
- SPACE
- SPACES
- STATE
- SWAP
- ;
- S\"
- S"
- S>D
- !
- THEN
- TO
- TRUE
- TUCK
- TYPE
- '
- *
- */
- */MOD
- 2DROP
- 2DUP
- 2/
- 2@
- 2OVER
- 2R@
- 2R>
- 2SWAP
- 2!
- 2*
- 2>R
- U.R
- UM/MOD
- UM*
- UNLOOP
- UNTIL
- UNUSED
- U.
- U<
- U>
- VALUE
- VARIABLE
- WHILE
- WITHIN
- WORD
- XOR
- 0=
- 0<
- 0>
- 0<>
- \
- .
- <
- >
- <>
- #>
- <#
- #
- #S
- (
- ?DO
- ?DUP
- >BODY
- >IN
- >NUMBER
- >R
6.2.0700 AGAIN CORE EXT
Interpretation:
Interpretation semantics for this word are undefined.
Compilation:
( C: dest -- )
Append the run-time semantics given below to the current definition, resolving the backward reference dest.
Run-time:
( -- )
Continue execution at the location specified by dest. If no other control flow words are used, any program code after AGAIN will not be executed.
See:
Rationale:
Typical use:
:
X
... BEGIN ... AGAIN
... ;
Unless word-sequence has a way to terminate, this is an endless loop.
ContributeContributions
EricBlake
[385] Suggested testSuggested Testcase2025-07-21 02:57:44
It is possible to test AGAIN without an infinite loop if combined with the tools set AHEAD and CS-ROLL, as in:
: [1cs-roll] 1 CS-ROLL ; IMMEDIATE
T{ : GI7 0 BEGIN (cs: -- d1 )
111 ( first pass: -- 0 111 ; second pass: -- 0 111 444 111)
OVER IF ( cs: -- d1 o2 )
222 ( second pass only: -- 0 111 444 111 222 )
AHEAD ( cs: -- d1 o2 o3 )
[1cs-roll] ( cs: -- d1 o3 o2 )
333 \ unreachable
THEN ( cs: -- d1 o3 ) \ resolve the IF
444 ( first pass only: -- 0 111 444 )
[1cs-roll] ( cs: -- o3 d1 )
AGAIN ( cs: -- o3 ) \ resolve the BEGIN
555 \ unreachable
THEN ( cs: -- ) \ resolve the AHEAD
666 ( -- 0 111 444 111 222 666 )
; -> }T
T{ GI7 -> 0 111 444 111 222 666 }T
It would also be possible to test breaking a BEGIN-AGAIN loop with throw in the loop body, using the exception word set.