Rename the STRUCT: point word to something else because it conflicts with other unit tests which define a point word in scratchpad. The struct point is redefined to a tuple point and causes the macro-expansion to error out now that structs are properly reset, so instead we just give it a unique name so it doesnt get redefined. Perhaps examples should define their own vocabularies instead of using scratchpad.

db4
Doug Coleman 2011-10-03 17:13:20 -07:00
parent 25c64d12e8
commit acbe85f0f4
1 changed files with 2 additions and 2 deletions

View File

@ -66,10 +66,10 @@ classes.struct kernel math math.functions
prettyprint ;
IN: scratchpad
STRUCT: point { x int } { y int } ;
STRUCT: test-point { x int } { y int } ;
: scoped-allocation-test ( -- x )
{ point } [
{ test-point } [
3 >>x 4 >>y
[ x>> sq ] [ y>> sq ] bi + sqrt
] with-scoped-allocation ;