Update documentation and fix a stack effect
parent
8e2f99aa76
commit
f6739cf710
|
@ -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:
|
||||||
|
|
||||||
|
|
|
@ -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" } }
|
||||||
|
|
|
@ -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 -- )
|
||||||
|
|
Loading…
Reference in New Issue