DECIMAL : ?? ( n1 n2 -- ) <> IF cr abort" test failed" THEN ; DECIMAL var x 33 x !: x @: 33 ?? 3 x +: x @: 36 ?? 5 dicArray a 77 3 a to: a size: 5 ?? 3 a at: 77 ?? 0 a fill: 45 2 a to: : test begin a each: while repeat ; test 0 ?? 0 ?? 45 ?? 0 ?? 0 ?? : v heap> var ; v 0 a to: v 1 a to: v 2 a to: v 3 a to: v 4 a to: : test2 begin a each: while @: repeat ; test2 0 ?? 0 ?? 0 ?? 0 ?? 0 ?? : add2 ( var-obj -- ) 2 swap +: ; : test3 begin a each: while add2 repeat ; test3 test2 2 ?? 2 ?? 2 ?? 2 ?? 2 ?? test3 test2 4 ?? 4 ?? 4 ?? 4 ?? 4 ?? : test4 begin a each: while Point at 5 8 \ object arrays 5 objArray() point points() 55 0 points() iv x ! 88 0 points() iv y ! cr 0 points() dot: \ => Point at 55 88 cr 4 points() dot: \ => Point at 0 0 :class rectangle point ul point lr :m show: ul dot: lr dot: ;m :m dot: ." Rectangle, " self show: ;m ;class rectangle r cr r dot: \ => Rectangle, Point at 0 0 Point at 0 0 :class label-point Point at X0 Y0 \ proof that show: is late-bound in class point 5 ordered-col+ c 10 20 30 40 4 c set: 0 c at: 10 ?? c last: 40 ?? 30 c search: -1 ?? 2 ?? 2 c delete: : test7 begin c each: while repeat ; test7 40 ?? 20 ?? 10 ?? 50 c add: test7 50 ?? 40 ?? 20 ?? 10 ?? c first: 10 ?? c removeFirst: test7 50 ?? 40 ?? 20 ?? 5 c addFirst: test7 50 ?? 40 ?? 20 ?? 5 ?? c sum: 115 ?? c max: 50 ?? c min: 5 ?? 5 c add: test7 5 ?? 50 ?? 40 ?? 20 ?? 5 ?? 5 c occurrencesOf: 2 ?? 60 c occurrencesOf: 0 ?? : test8 30 < ; ' test8 c conform: 0 ?? \ all elements do not conform : test9 60 < ; ' test9 c conform: -1 ?? \ all elements do conform ' test8 c accept: value acc \ a new collection whose elements pass accept: test : test10 begin acc each: while repeat ; test10 5 ?? 20 ?? 5 ?? acc