]> gitweb.factorcode.org Git - factor.git/commitdiff
use a simple counter instead of gensym
authorSlava Pestov <slava@factorcode.org>
Sat, 21 Jan 2006 21:16:49 +0000 (21:16 +0000)
committerSlava Pestov <slava@factorcode.org>
Sat, 21 Jan 2006 21:16:49 +0000 (21:16 +0000)
TODO.FACTOR.txt
contrib/README.txt
library/collections/namespaces.factor
library/inference/dataflow.factor
library/inference/print-dataflow.factor
library/words.factor

index 19c14c56f3c1aa60d2a82e06532954da7bbef614..7fd1f03d6c5bfb2eaa5f0c9dad9e801ac5e7c33a 100644 (file)
@@ -1,3 +1,4 @@
+- fix fixnum<< vop on x86 and ppc\r
 - need line and paragraph spacing\r
 - update HTML stream\r
 - help cross-referencing\r
index 693dc66c551f10c3fa6e233e18e78d0ee55377a2..f946b02a6515bd50029e9b934cfa43dc02b51630 100644 (file)
@@ -25,6 +25,8 @@ library, but is useful enough to ship with the Factor distribution.
 
 - contrib/postgresql/ -- PostgreSQL binding (Doug Coleman)
 
+- contrib/random-tester/ -- Random compiler tester (Doug Coleman)
+
 - contrib/space-invaders/ -- Intel 8080-based Space Invaders arcade
   machine emulator (Chris Double)
 
index 139cf38efa099857703572775a18a06dcfefd1f8..c6f5ecb9fbe4fa9dcc0dad2249e12fa5288ccead 100644 (file)
@@ -25,6 +25,9 @@ sequences strings vectors words ;
 
 : inc ( var -- ) [ 1+ ] change ; inline
 
+: counter ( var -- n )
+    global [ [ [ 0 ] unless* dup 1+ >fixnum ] change ] bind ;
+
 : dec ( var -- ) [ 1- ] change ; inline
 
 : bind ( namespace quot -- ) swap >n call n> drop ; inline
index 4f7823fd5b37714acdfea8f322c0ded6a9bd9dee..6790175332057493aedfdf5561d7f1d2246a6ede 100644 (file)
@@ -10,12 +10,12 @@ SYMBOL: recursive-state
 TUPLE: value recursion uid ;
 
 C: value ( -- value )
-    gensym over set-value-uid
+    \ value counter over set-value-uid
     recursive-state get over set-value-recursion ;
 
 M: value = eq? ;
 
-M: value hashcode value-uid hashcode ;
+M: value hashcode value-uid ;
 
 TUPLE: literal value ;
 
index bd38ccbf897e19c06a5bb59a18777e52c477d63f..9f381c84113b7d3ed0855639af7156c7fcb801b1 100644 (file)
@@ -19,8 +19,11 @@ M: comment pprint* ( ann -- )
 : values% ( prefix values -- )
     [
         swap %
-        dup literal? [ literal-value ] [ value-uid ] if
-        unparse %
+        dup literal? [
+            literal-value unparse %
+        ] [
+            "@" % value-uid #
+        ] if
     ] each-with ;
 
 : effect-str ( node -- str )
index 3a7c526b3c0920efd38c27142921f077305d0e2b..4e4452510ecd23fc53bfcd4c22479a8e783506df 100644 (file)
@@ -98,8 +98,7 @@ M: word (uncrossref) drop ;
 M: word literalize <wrapper> ;
 
 : gensym ( -- word )
-    "G:"
-    global [ \ gensym dup inc get ] bind
-    number>string append f <word> dup init-word ;
+    [ "G:" % \ gensym counter # ] "" make
+    f <word> dup init-word ;
 
 0 \ gensym set-global