]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.units: fix modify-code-heap example.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 May 2017 15:38:49 +0000 (08:38 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 May 2017 15:38:49 +0000 (08:38 -0700)
Make sure ``foo`` has the same stack effect as the quotation that is
set on ``foo`` with ``modify-code-heap``.  The symbol had a stack
effect of ( -- x ) since it pushes itself when it is called. The
quotation in the example had stack effect ( -- ).

core/compiler/units/units-docs.factor

index a65dddb81aef7d926017a52a011e90c46f270fd6..8fb41c24a5ee542857c159190f6f0d46bf12796c 100644 (file)
@@ -104,7 +104,8 @@ $nl
   "Manually creating a word using the non-optimizing compiler:"
   { $example
     "USING: compiler.units io ;"
-    "IN: test SYMBOL: foo"
+    "IN: scratchpad"
+    ": foo ( -- ) ;"
     "{ { foo [ \"hello!\" write nl ] } } t t modify-code-heap foo"
     "hello!"
   }