Handbook
Glossary
infix-codegen ( ast -- quot/number )
Vocabulary
infix
.
private
Inputs
ast
an
object
Outputs
quot/number
an
object
Definition
IN:
infix.private
GENERIC:
infix-codegen
( ast -- quot/number )
Methods
USING:
accessors
infix.ast
infix.private
kernel
;
M:
ast-array
infix-codegen
[
index>>
infix-codegen
prepare-operand
]
[
name>>
>local-word
]
bi
[
infix-nth
]
curry
compose
;
USING:
accessors
infix.ast
infix.private
kernel
sequences
;
M:
ast-function
infix-codegen
[
arguments>>
[
arguments-codegen
]
[
length
]
bi
]
[
name>>
]
bi
find-and-check
;
USING:
accessors
infix.ast
infix.private
;
M:
ast-local
infix-codegen
name>>
>local-word
;
USING:
accessors
combinators
infix.ast
infix.private
kernel
math
quotations
;
M:
ast-negation
infix-codegen
term>>
infix-codegen
{
{
[
dup
number?
]
[
neg
]
}
{
[
dup
callable?
]
[
[
neg
]
compose
]
}
[
[
neg
]
curry
]
}
cond
;
USING:
accessors
combinators
infix.ast
infix.private
kernel
math
;
M:
ast-op
infix-codegen
[
left>>
infix-codegen
]
[
right>>
infix-codegen
]
[
op>>
select-op
]
tri
2over
[
number?
]
both?
[
( a b -- c )
call-effect
]
[
[
[
prepare-operand
]
bi@
]
dip
[
compose
]
dip
compose
]
if
;
USING:
accessors
combinators
infix.ast
infix.private
kernel
;
M:
ast-slice
infix-codegen
{
[
from>>
[
infix-codegen
prepare-operand
]
[
[
f
]
]
if*
]
[
to>>
[
infix-codegen
prepare-operand
]
[
[
f
]
]
if*
]
[
step>>
[
infix-codegen
prepare-operand
]
[
[
f
]
]
if*
]
[
name>>
>local-word
]
}
cleave
[
[
compose
]
dip
compose
]
dip
[
infix-subseq
]
curry
compose
;
USING:
accessors
infix.ast
infix.private
;
M:
ast-value
infix-codegen
value>>
;