]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' into new_ui
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Feb 2009 20:27:55 +0000 (14:27 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Feb 2009 20:27:55 +0000 (14:27 -0600)
basis/compiler/tree/cleanup/cleanup-tests.factor
basis/compiler/tree/propagation/known-words/known-words.factor
basis/editors/emacs/emacs.factor
basis/stack-checker/stack-checker-docs.factor
build-support/cleanup [new file with mode: 0644]

index 54f8aaf20ecae62f4666254d311a73368d6d4da0..4a2e8671fbeff2e1330dc7d7f5d3f2eb5e8d584c 100755 (executable)
@@ -510,3 +510,8 @@ cell-bits 32 = [
     [ { array } declare 2 <groups> [ . . ] assoc-each ]
     \ nth-unsafe inlined?
 ] unit-test
+
+[ t ] [
+    [ { fixnum fixnum } declare = ]
+    \ both-fixnums? inlined?
+] unit-test
\ No newline at end of file
index d5aa5318a4a47503048f0ee7cabcfaffad4626ac..ecfd415579cee80deb784703965793f2bc7747e0 100644 (file)
@@ -199,8 +199,11 @@ generic-comparison-ops [
 ] "outputs" set-word-prop
 
 \ both-fixnums? [
-    [ class>> fixnum classes-intersect? not ] either?
-    f <literal-info> object-info ?
+    [ class>> ] bi@ {
+        { [ 2dup [ fixnum classes-intersect? not ] either? ] [ f <literal-info> ] }
+        { [ 2dup [ fixnum class<= ] both? ] [ t <literal-info> ] }
+        [ object-info ]
+    } cond 2nip
 ] "outputs" set-word-prop
 
 {
index 05b879770e6317c2a5a4ff9fbb6d9cace98e133d..366bc53104efc515b0abfe4e379a210957ef69a6 100644 (file)
@@ -11,7 +11,7 @@ M: object default-emacsclient ( -- path ) "emacsclient" ;
 
 : emacsclient ( file line -- )
     [
-        { [ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
+        { [ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
         "--no-wait" ,
         number>string "+" prepend ,
         ,
index db8abac4411c7d97e5fffe2ead764064903a5961..088fab34d0249db028810cf1f0f49c5323bec839 100644 (file)
@@ -21,7 +21,7 @@ $nl
 
 ARTICLE: "inference-combinators" "Combinator stack effects"
 "Without further information, one cannot say what the stack effect of " { $link call } " is; it depends on the given quotation. If the inferencer encounters a " { $link call } " without further information, a " { $link literal-expected } " error is raised."
-{ $example "[ dup call ] infer." "Literal value expected\n\nType :help for debugging help." }
+{ $example "[ dup call ] infer." "Got a computed value where a literal quotation was expected\n\nType :help for debugging help." }
 "On the other hand, the stack effect of applying " { $link call } " to a literal quotation or a " { $link curry } " of a literal quotation is easy to compute; it behaves as if the quotation was substituted at that point:"
 { $example "[ [ 2 + ] call ] infer." "( object -- object )" }
 "Consider a combinator such as " { $link keep } ". The combinator itself does not have a stack effect, because it applies " { $link call } " to a potentially arbitrary quotation. However, since the combinator is declared " { $link POSTPONE: inline } ", a given usage of it can have a stack effect:"
@@ -38,7 +38,7 @@ $nl
 { $example ": foo 0 [ + ] ; inline" "[ foo reduce ] infer." "( object -- object )" }
 "Passing a literal quotation on the data stack through an inlined recursive combinator nullifies its literal status. For example, the following will not infer:"
 { $example
-  "[ [ reverse ] swap [ reverse ] map swap call ] infer." "Literal value expected\n\nType :help for debugging help."
+  "[ [ reverse ] swap [ reverse ] map swap call ] infer." "Got a computed value where a literal quotation was expected\n\nType :help for debugging help."
 }
 "To make this work, pass the quotation on the retain stack instead:"
 { $example
@@ -67,11 +67,11 @@ $nl
 "If a recursive word takes quotation parameters from the stack and calls them, it must be declared " { $link POSTPONE: inline } " (as documented in " { $link "inference-combinators" } ") as well as " { $link POSTPONE: recursive } "."
 $nl
 "Furthermore, the input parameters which are quotations must be annotated in the stack effect. For example, the following will not infer:"
-{ $example ": bad ( quot -- ) [ call ] keep foo ; inline recursive" "[ [ ] bad ] infer." "Literal value expected\n\nType :help for debugging help." }
+{ $example ": bad ( quot -- ) [ call ] keep foo ; inline recursive" "[ [ ] bad ] infer." "Got a computed value where a literal quotation was expected\n\nType :help for debugging help." }
 "The following is correct:"
 { $example ": good ( quot: ( -- ) -- ) [ call ] keep good ; inline recursive" "[ [ ] good ] infer." "( -- )" }
 "An inline recursive word cannot pass a quotation on the data stack through the recursive call. For example, the following will not infer:"
-{ $example ": bad ( ? quot: ( ? -- ) -- ) 2dup [ not ] dip bad call ; inline recursive" "[ [ drop ] bad ] infer." "Literal value expected\n\nType :help for debugging help." }
+{ $example ": bad ( ? quot: ( ? -- ) -- ) 2dup [ not ] dip bad call ; inline recursive" "[ [ drop ] bad ] infer." "Got a computed value where a literal quotation was expected\n\nType :help for debugging help." }
 "However a small change can be made:"
 { $example ": good ( ? quot: ( ? -- ) -- ) [ good ] 2keep [ not ] dip call ; inline recursive" "[ [ drop ] good ] infer." "( object -- )" }
 "An inline recursive word must have a fixed stack effect in its base case. The following will not infer:"
diff --git a/build-support/cleanup b/build-support/cleanup
new file mode 100644 (file)
index 0000000..2d2aab0
--- /dev/null
@@ -0,0 +1,8 @@
+vm
+temp
+logs
+.git
+.gitignore
+Makefile
+unmaintained
+build-support