]> gitweb.factorcode.org Git - factor.git/commitdiff
Update documentation and fix a stack effect
authorslava <slava@factorcode.org>
Sat, 4 Nov 2006 18:50:08 +0000 (18:50 +0000)
committerslava <slava@factorcode.org>
Sat, 4 Nov 2006 18:50:08 +0000 (18:50 +0000)
TODO.FACTOR.txt
library/collections/sequences.facts
library/compiler/pentium4/intrinsics.factor

index 134e4a7fa74a41b533971b1ee93a7d8203a99a53..9e592052ae4ccc45549a29f9e15c2f70f070dc4c 100644 (file)
@@ -2,8 +2,9 @@
 
 - inline float allocation needs a gc check
 - docs: don't pass volatile aliens to callbacks
-- docs: mention that 'like' may destroy the underlying sequence
 - don't save big free chunk at the end of the code heap
+- some instability remains
+- overhaul alien docs
 
 + ui:
 
index a85e3efbce9d4f8f47e5b8a307f2f5ff9ddcef8e..9e8c0521b30acd7817000aaed7dc03ce67db0233 100644 (file)
@@ -1,5 +1,5 @@
 USING: arrays help sequences sequences-internals vectors
-strings ;
+strings kernel ;
 
 HELP: <vector>
 { $values { "n" "a positive integer specifying initial capacity" } { "vector" "a new vector" } }
@@ -36,7 +36,25 @@ HELP: thaw
 
 HELP: like
 { $values { "seq" "a sequence" } { "prototype" "a sequence" } { "newseq" "a sequence" } }
-{ $contract "Outputs a sequence with the same elements as the input sequence, but " { $emphasis "like" } " the template sequence, in the sense that it either has the same class as the template sequence, or if the template sequence is a virtual sequence, the same class as the template sequence's underlying sequence. The default implementation does nothing." } ;
+{ $contract "Outputs a sequence with the same elements as the input sequence, but " { $emphasis "like" } " the template sequence, in the sense that it either has the same class as the template sequence, or if the template sequence is a virtual sequence, the same class as the template sequence's underlying sequence."
+$terpri
+"The default implementation does nothing." }
+{ $notes "The output sequence might share storage with the input sequence, for example:"
+{ $example
+    "{ 1 2 3 } \"array\" set"
+    "\"array\" get V{ } like \"vector\" set"
+    "t 0 \"array\" get set-nth"
+    "\"vector\" get ."
+    "V{ t 2 3 }"
+}
+"If this behavior is undesirable, you can use one of the following words instead, which always output a fresh sequence:"
+{ $list
+    { $link >array }
+    { $link >quotation }
+    { $link >string }
+    { $link >sbuf }
+    { $link >vector }
+} } ;
 
 HELP: empty?
 { $values { "seq" "a sequence" } { "?" "a boolean" } }
index ffa30b193877a7af6a43410634d15b7397f39d7a..c7f9baf2caa069956f50bafed48533867542fa44 100644 (file)
@@ -11,8 +11,8 @@ M: float-regs (%peek)
 
 : load-zone-ptr ( reg -- )
     #! Load pointer to start of zone array
-    0 MOV
-    dup "generations" f rel-absolute-cell rel-dlsym
+    dup 0 MOV
+    "generations" f rel-absolute-cell rel-dlsym
     dup [] MOV ;
 
 : load-allot-ptr ( vreg -- )