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.
parent
25c64d12e8
commit
acbe85f0f4
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue