Handbook
Glossary
define-tokyo-assoc-api ( T N -- )
Vocabulary
tokyo
.
assoc-functor
Inputs
T
an
object
N
an
object
Outputs
None
Definition
USING:
accessors
alien.c-types
alien.data
assocs
classes.mixin
classes.parser
destructors
functors.backend
functors.private
generic
generic.parser
io
io.streams.string
kernel
namespaces
parser
present
sequences
serialize
;
IN:
tokyo.assoc-functor
::
define-tokyo-assoc-api
( T N -- )
[
T
present
write
"get"
write
]
with-string-writer
parse-word
:>
DBGET
[
T
present
write
"put"
write
]
with-string-writer
parse-word
:>
DBPUT
[
T
present
write
"out"
write
]
with-string-writer
parse-word
:>
DBOUT
[
T
present
write
"del"
write
]
with-string-writer
parse-word
:>
DBDEL
[
T
present
write
"rnum"
write
]
with-string-writer
parse-word
:>
DBRNUM
[
T
present
write
"iterinit"
write
]
with-string-writer
parse-word
:>
DBITERINIT
[
T
present
write
"iternext"
write
]
with-string-writer
parse-word
:>
DBITERNEXT
[
T
present
write
"vanish"
write
]
with-string-writer
parse-word
:>
DBVANISH
[
"tokyo-"
write
N
present
write
"-keys"
write
]
with-string-writer
create-word-in
:>
DBKEYS
[
"tokyo-"
write
N
present
write
]
with-string-writer
create-class-in
:>
TYPE TYPE
tuple
{
"handle"
"disposed"
}
define-tuple-class*
TYPE
\
assoc
add-mixin-instance
TYPE
\
dispose*
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
change-handle
drop
}
}
}
fake-quotations>
first
define*
TYPE
\
at*
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
handle>>
swap
object>bytes
dup
length
0
int
<ref>
DBGET
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
if*
}
}
}
fake-quotations>
first
define*
TYPE
\
assoc-size
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
handle>>
DBRNUM
}
}
}
fake-quotations>
first
define*
DBKEYS
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
bi
dup
DBITERINIT
drop
0
int
<ref>
T{
fake-quotation
{
seq ~array~
}
}
T{
fake-quotation
{
seq ~array~
}
}
while*
2drop
}
}
}
fake-quotations>
first
( db -- keys )
define-declared*
TYPE
\
>alist
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
T{
fake-quotation
{
seq ~array~
}
}
keep
T{
fake-quotation
{
seq ~array~
}
}
dip
T{
fake-quotation
{
seq ~array~
}
}
curry
compose
map!
drop
}
}
}
fake-quotations>
first
define*
TYPE
\
set-at
create-method-in
dup
\
method
set
~44 more~
;