Handbook
Glossary
define-destructor ( F -- )
Vocabulary
alien
.
destructors
Inputs
F
an
object
Outputs
None
Definition
USING:
accessors
classes.parser
destructors
effects
functors.backend
functors.private
generalizations
generic
generic.parser
io
io.streams.string
kernel
namespaces
parser
present
sequences
words
;
IN:
alien.destructors
::
define-destructor
( F -- )
[
F
present
write
"-destructor"
write
]
with-string-writer
create-class-in
:>
F-destructor
[
"<"
write
F
present
write
"-destructor>"
write
]
with-string-writer
create-word-in
:>
<F-destructor>
[
"&"
write
F
present
write
]
with-string-writer
create-word-in
:>
&F
[
"|"
write
F
present
write
]
with-string-writer
create-word-in
:>
|F F
stack-effect
out>>
length
:>
N
F-destructor
\
alien-destructor
{
}
define-tuple-class*
<F-destructor>
T{
fake-quotation
{
seq
{
f
F-destructor
boa
}
}
}
fake-quotations>
first
( alien -- destructor )
define-declared*
last-word
make-inline
F-destructor
\
dispose*
create-method-in
dup
\
method
set
T{
fake-quotation
{
seq
{
alien>>
F N
ndrop
}
}
}
fake-quotations>
first
define*
&F
T{
fake-quotation
{
seq
{
dup
<F-destructor>
&dispose
drop
}
}
}
fake-quotations>
first
( alien -- alien )
define-declared*
last-word
make-inline
|F
T{
fake-quotation
{
seq
{
dup
<F-destructor>
|dispose
drop
}
}
}
fake-quotations>
first
( alien -- alien )
define-declared*
last-word
make-inline
;