diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 19c14c56f3..7fd1f03d6c 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,3 +1,4 @@ +- fix fixnum<< vop on x86 and ppc - need line and paragraph spacing - update HTML stream - help cross-referencing diff --git a/contrib/README.txt b/contrib/README.txt index 693dc66c55..f946b02a65 100644 --- a/contrib/README.txt +++ b/contrib/README.txt @@ -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) diff --git a/library/collections/namespaces.factor b/library/collections/namespaces.factor index 139cf38efa..c6f5ecb9fb 100644 --- a/library/collections/namespaces.factor +++ b/library/collections/namespaces.factor @@ -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 diff --git a/library/inference/dataflow.factor b/library/inference/dataflow.factor index 4f7823fd5b..6790175332 100644 --- a/library/inference/dataflow.factor +++ b/library/inference/dataflow.factor @@ -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 ; diff --git a/library/inference/print-dataflow.factor b/library/inference/print-dataflow.factor index bd38ccbf89..9f381c8411 100644 --- a/library/inference/print-dataflow.factor +++ b/library/inference/print-dataflow.factor @@ -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 ) diff --git a/library/words.factor b/library/words.factor index 3a7c526b3c..4e4452510e 100644 --- a/library/words.factor +++ b/library/words.factor @@ -98,8 +98,7 @@ M: word (uncrossref) drop ; M: word literalize ; : gensym ( -- word ) - "G:" - global [ \ gensym dup inc get ] bind - number>string append f dup init-word ; + [ "G:" % \ gensym counter # ] "" make + f dup init-word ; 0 \ gensym set-global