Handbook
Glossary
define-vector ( V A <A> -- )
Vocabulary
vectors
.
functor
Inputs
V
an
object
A
an
object
<A>
an
object
Outputs
None
Definition
USING:
classes
classes.mixin
functors.backend
functors.private
generic
generic.parser
growable
io
io.streams.string
kernel
namespaces
parser
present
sequences
sequences.private
words
;
IN:
vectors.functor
::
define-vector
( V A <A> -- )
[
"<"
write
V
present
write
">"
write
]
with-string-writer
create-word-in
:>
<V>
[
">"
write
V
present
write
]
with-string-writer
create-word-in
:>
>V V
tuple
{
{
"underlying"
A
}
{
"length"
array-capacity
}
}
define-tuple-class*
<V>
T{
fake-quotation
{
seq
{
<A> 0 V
boa
}
}
}
fake-quotations>
first
( capacity -- vector )
define-declared*
last-word
make-inline
V
\
like
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
drop
dup
V
instance?
T{
fake-quotation
{
seq ~array~
}
}
unless
}
}
}
fake-quotations>
first
define*
last-word
make-inline
V
\
new-sequence
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
drop
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
bi
V
boa
}
}
}
fake-quotations>
first
define*
last-word
make-inline
A
\
new-resizable
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
drop
<V>
}
}
}
fake-quotations>
first
define*
last-word
make-inline
V
\
new-resizable
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
drop
<V>
}
}
}
fake-quotations>
first
define*
last-word
make-inline
V
\
equal?
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
over
V
instance?
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
if
}
}
}
fake-quotations>
first
define*
>V
T{
fake-quotation
{
seq
{
V
new
clone-like
}
}
}
fake-quotations>
first
( seq -- vector )
define-declared*
last-word
make-inline
V
\
growable
add-mixin-instance
;