Handbook
Glossary
define-array ( T -- )
Vocabulary
specialized-arrays
.
private
Inputs
T
an
object
Outputs
None
Definition
USING:
accessors
alien
alien.c-types
classes.parser
classes.tuple
functors.backend
functors.private
generic
generic.parser
io
io.streams.string
kernel
namespaces
parser
present
sequences
sequences.private
words
;
IN:
specialized-arrays.private
::
define-array
( T -- )
[
T
present
write
"-array"
write
]
with-string-writer
create-class-in
:>
A
[
"<"
write
A
present
write
">"
write
]
with-string-writer
create-word-in
:>
<A>
[
"("
write
A
present
write
")"
write
]
with-string-writer
create-word-in
:>
(A)
[
"<direct-"
write
A
present
write
">"
write
]
with-string-writer
create-word-in
:>
<direct-A>
[
A
present
write
"{"
write
]
with-string-writer
create-word-in
:>
A{ A
tuple
{
{
"underlying"
c-ptr
read-only
}
{
"length"
array-capacity
read-only
}
}
define-tuple-class*
last-word
make-final
<direct-A>
T{
fake-quotation
{
seq
{
A
boa
}
}
}
fake-quotations>
first
( alien len -- specialized-array )
define-declared*
last-word
make-inline
A
\
direct-like
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
drop
<direct-A>
}
}
}
fake-quotations>
first
define*
last-word
make-inline
<A>
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
keep
<direct-A>
}
}
}
fake-quotations>
first
( n -- specialized-array )
define-declared*
last-word
make-inline
(A)
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
keep
<direct-A>
}
}
}
fake-quotations>
first
( n -- specialized-array )
define-declared*
last-word
make-inline
A
\
clone
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
bi
<direct-A>
}
}
}
fake-quotations>
first
define*
last-word
make-inline
A
\
length
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
length>>
}
}
}
fake-quotations>
first
define*
last-word
make-inline
A
\
nth-unsafe
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
dip
underlying>>
\
T
alien-element
}
}
}
fake-quotations>
first
define*
last-word
make-inline
A ~167 more~
;