Open GoogleCodeExporter opened 9 years ago
This may be due to the ability to use IF THEN DO LOOP and other conditionals
outside of a colon definition. This capability is added in "smart_if.fth". IF
THEN are running in between the square brackets.
Try building without including "smart_if.fth".
Also I recommend making COMP immediate. Then it works.
: COMP postpone if postpone then ; immediate
: TEST COMP ;
see test
( 100823268 ) IF or WHILE
( 100823278 ) THEN
( 100823278 ) ;
Original comment by burkp...@gmail.com
on 26 Jan 2011 at 6:11
> Try building without including "smart_if.fth".
No, this doesn't work either.
> Also I recommend making COMP immediate. Then it works.
Yep.
Well, I don't see which practical use such non-immediate compiling of immediate
words might have: though, apparently, it's in the standard.
Here is an excerpt from gforth's test/postpone.fs
: postpone-."
postpone ." ;
: pdq2 [ postpone-." you should see this later. " ] cr ;
: pdq1 [ postpone-." you should see this first. " ] cr ;
{ pdq1 pdq2 -> }
: postpone-begin
postpone begin ;
{ : PB3 [ POSTPONE-BEGIN ] DUP 5 < WHILE DUP 1+ REPEAT ; -> }
The former example fails without crashing, the latter crashes.
Regards,
Reinhold Straub
Original comment by rthstr...@gmail.com
on 27 Jan 2011 at 4:15
Original issue reported on code.google.com by
rthstr...@gmail.com
on 25 Jan 2011 at 1:24