Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 116,679 of 117,927    |
|    albert@spenarnc.xs4all.nl to All    |
|    portable or not? Volatile strings    |
|    11 Aug 24 15:35:38    |
      I come across a tetris game, and there were bricks defined in       this way:              : DEF-BRICK CREATE 4 0 DO        ' EXECUTE 0 DO DUP I CHARS + C@ C, LOOP DROP        REFILL DROP        LOOP        DOES> ROT 4 * ROT + 2* CHARS + ;              DEF-BRICK BRICK1 S" "        S" ###### "        S" ## "        S" "              Apparently the data field of bricks are filled in some mysterious       way by DEF-BRICK but that is not the subject.       It does some parsing from the input stream, which is kind of       tricky. As REFILL is not present in lina's core, you must       do "-traditional- WANTED" , but that still is not the issue.              I made S" " such that it ALLOT's the string at HERE, to       prevent problems with going out of scope, even in interpret mode.       (Only 256,000,000,000 -10 bytes left).              This doesn't sit well with the definition of BRICK1 ,       that sees its data area grabbed.       You are probably not surprised that tetris doesn't work.              The question is, is it legal to store these temporary strings       in the dictionary in this way?              [ It was sufficient to replace S" with S"' in order to make it run:       : S"' &" PARSE ;       ]              Groetjes Albert       --       Don't praise the day before the evening. One swallow doesn't make spring.       You must not say "hey" before you have crossed the bridge. Don't sell the       hide of the bear until you shot it. Better one bird in the hand than ten in       the air. First gain is a cat purring. - the Wise from Antrim -              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca