New books from Apress

Andy Armstrong andy at hexten.net
Wed May 24 22:03:40 BST 2006


On 24 May 2006, at 21:53, Peter Corlett wrote:

> Andy Armstrong <andy at hexten.net> wrote:
> [...]
>> FOR I% = 1 TO 10 : IF I% MOD 2 THEN PRINT "Odd" : NEXT : ELSE  
>> PRINT "Even"
>> : NEXT
>> is quite legal (if unwise).
>
> No worse than "break" in C and you can get a lex/yacc parser for  
> that...

Yeah, I'm sure it's possible - just pointing out all the nasty cases  
you'd have to deal with :)

    10 N% = 30
    20 GOTO N% + 20
    30 NEXT
    40 END
    50 FOR I% = 1 TO 10
    60 PRINT I%
    70 GOTO N%

    10 FOR I% = 1 TO 10
    20 PRINT I%
    30 PROCN
    31 END
    40 DEF PROCN
    50 NEXT
    60 ENDPROC

FOR/NEXT, PROC/ENDPROC and REPEAT/UNTIL all have their own stacks.

-- 
Andy Armstrong, hexten.net



More information about the london.pm mailing list