Handbook
Glossary
localize ( args obj -- args quot )
Vocabulary
locals
.
rewrite
Inputs
args
an
object
obj
an
object
Outputs
args
an
object
quot
an
object
Definition
IN:
locals.rewrite
GENERIC:
localize
( args obj -- args quot )
Methods
USING:
kernel
locals.backend
locals.rewrite
locals.types
sequences
;
M:
local-reader
localize
dupd
read-local-quot
[
local-value
]
append
;
USING:
kernel
locals.backend
locals.rewrite
locals.types
sequences
words
;
M:
local-writer
localize
dupd
"local-reader"
word-prop
read-local-quot
[
set-local-value
]
append
;
USING:
kernel
locals.rewrite
locals.types
;
M:
local
localize
dupd
read-local-quot
;
USING:
accessors
arrays
combinators
fry.private
kernel
locals.backend
locals.rewrite
locals.types
math
sequences
;
M:
multi-def
localize
locals>>
<reversed>
[
prepend
]
[
[
[
local-reader?
]
dip
[
[
[
1array
]
]
]
dip
[
[ndip]
]
curry
compose
[
[
]
]
if
]
map-index
concat
]
[
length
{
{
[
dup
1
>
]
[
[
load-locals
]
curry
]
}
{
[
dup
1
=
]
[
drop
[
load-local
]
]
}
[
drop
[
]
]
}
cond
]
tri
append
;
USING:
kernel
locals.rewrite
quotations
;
M:
object
localize
1quotation
;
USING:
accessors
kernel
locals.rewrite
locals.types
;
M:
quote
localize
dupd
local>>
read-local-quot
;