Re: The ?PAIRS word
- From: Andrew Haley <andrew29@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 27 Apr 2008 04:21:28 -0500
Montesquiou wrote:
Bonjour to all,
In the archive of the group, I found the word "?PAIRS"
as in
: ENDCASE 4 ?PAIRS COMPILE DROP
BEGIN SP@ CSP @ = 0=
WHILE 2 [COMPILE ENDIF REPEAT
CSP ! ; IMMEDIATE
According the FAQ, the ?PAIRS word was FIG-Forth's way of implementing a
small amount of syntax checking.
Is "Number ?PAIRS" similar to ... over <> if (error message) then ...;
More or less, yes. If you can get the fig-FORTH source, it's in Block
40:
: ?ERROR ( BOOLEAN-2 ERROR TYPE-1, WARN FOR TRUE *)
SWAP IF ERROR ELSE DROP ENDIF ;
: ?PAIRS - 13 ?ERROR ; ( VERIFY STACK VALUES ARE PAIRED *)
Andrew.
.
- References:
- The ?PAIRS word
- From: Montesquiou
- The ?PAIRS word
- Prev by Date: Euler problem #20
- Next by Date: Re: Taylor series FSIN, FCOS, FTAN
- Previous by thread: Re: The ?PAIRS word
- Next by thread: Re: The ?PAIRS word
- Index(es):
Relevant Pages
|