Update documentation and fix a stack effect

slava 2006-11-04 18:50:08 +00:00
parent 8e2f99aa76
commit f6739cf710
3 changed files with 24 additions and 5 deletions

View File

@ -2,8 +2,9 @@
- inline float allocation needs a gc check - inline float allocation needs a gc check
- docs: don't pass volatile aliens to callbacks - 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 - don't save big free chunk at the end of the code heap
- some instability remains
- overhaul alien docs
+ ui: + ui:

View File

@ -1,5 +1,5 @@
USING: arrays help sequences sequences-internals vectors USING: arrays help sequences sequences-internals vectors
strings ; strings kernel ;
HELP: <vector> HELP: <vector>
{ $values { "n" "a positive integer specifying initial capacity" } { "vector" "a new vector" } } { $values { "n" "a positive integer specifying initial capacity" } { "vector" "a new vector" } }
@ -36,7 +36,25 @@ HELP: thaw
HELP: like HELP: like
{ $values { "seq" "a sequence" } { "prototype" "a sequence" } { "newseq" "a sequence" } } { $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? HELP: empty?
{ $values { "seq" "a sequence" } { "?" "a boolean" } } { $values { "seq" "a sequence" } { "?" "a boolean" } }

View File

@ -11,8 +11,8 @@ M: float-regs (%peek)
: load-zone-ptr ( reg -- ) : load-zone-ptr ( reg -- )
#! Load pointer to start of zone array #! Load pointer to start of zone array
0 MOV dup 0 MOV
dup "generations" f rel-absolute-cell rel-dlsym "generations" f rel-absolute-cell rel-dlsym
dup [] MOV ; dup [] MOV ;
: load-allot-ptr ( vreg -- ) : load-allot-ptr ( vreg -- )