1\ LocalTest.fth 2\ Updated Thu, 31 Aug 2006 at 15:33 PDT by David L. Paktor 3 4fcode-version2 5 6 \ Optionally omitting inclusion of LocalValuesSupport 7 \ Correct inclusion is in TokoLoco/SupportedLocalTest.fth 8[ifdef] dont_omit_support 9 fload LocalValuesSupport.fth 10[endif] 11 12h# Deaf constant dean 13 14: faber ( n3 n2 n1 -- alloc-addr size $addr,len ) 15 { _otter _weasel _skunk ; _muskrat _mole } 16 \ _otter is initialized with the value of n3 17 \ _weasel is initialized with the value of n2 18 \ _skunk is initialized with the value of n1 19 \ _muskrat and _mole are uninitialized 20 21 \ Use n1 to determine an amount of memory to allocate, and 22 \ stuff the address into _mole 23 _skunk 40 * -> _muskrat 24 _muskrat alloc-mem -> _mole 25 26f[ 27123 456 789 3dup 28 to _otter 29 _otter 30 constant 31 seegammanoo 32 dean constant wenkroy 33 ]f 34 35 _weasel .h type 36 _otter .d type 37 _mole _muskrat _mole count 38; 39 40f[ 41 42 ]f 43 44: miracle ( n3 n2 n1 -- m3 m2 m1 ) 45 { _curly _larry _moe | _shemp _besser _joe } 46 ." Nyuk! " _curly .h cr 47 ." Why, you... " _moe .d cr 48 ." Ouch! " _larry . 49 _curly _moe + -> _shemp 50 _larry _moe + -> _besser 51 _besser _curly + -> _joe 52 _joe _besser 8 faber type free-mem 53 _moe _larry 8 faber type free-mem 54 _curly _besser 8 faber type free-mem 55 _larry _shemp 56; 57 58: ordinary ( -- ) 59 123 456 789 miracle 60; 61 62 { _don't _allow _this ; _ever } 63 64 F[ 65 { _nor _this ; _either } 66 ]F 67 68\ And the "unterminated" tests 69 70: ahnold ( the unterminator ) 71 fload UntermLocalDecl.fth 72 } \ Does this conclude it okay? (No, it's extraneous...) 73 _green _goose + dup 74 -> _souvenirs 75 fload UntermLocalAssgmnt.fth 76 _souvenirs 77; 78 79\ Once more, out of context: 80fload UntermLocalDecl.fth 81fload UntermLocalAssgmnt.fth _souvenirs 82 83\ And another couple of corner-cases: 84 fload UntermDefn.fth moopoop 85F[ fload UntermDefn.fth poop-de-moo ]F 86 87fcode-end 88 89