words: rename reset-props to remove-word-props.
parent
77f980881b
commit
aa00d59d59
|
@ -44,13 +44,14 @@ ERROR: bad-array-type ;
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
: reset-c-type ( word -- )
|
: reset-c-type ( word -- )
|
||||||
dup "struct-size" word-prop
|
dup "struct-size" word-prop [
|
||||||
[ dup [ forget-class ] [ { "struct-size" } reset-props ] bi ] when
|
dup [ forget-class ] [ "struct-size" remove-word-prop ] bi
|
||||||
|
] when
|
||||||
{
|
{
|
||||||
"c-type"
|
"c-type"
|
||||||
"callback-effect"
|
"callback-effect"
|
||||||
"callback-library"
|
"callback-library"
|
||||||
} reset-props ;
|
} remove-word-props ;
|
||||||
|
|
||||||
ERROR: *-in-c-type-name name ;
|
ERROR: *-in-c-type-name name ;
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ M: struct-class reset-class
|
||||||
[ forget-struct-slot-values-method ]
|
[ forget-struct-slot-values-method ]
|
||||||
[ forget-clone-method ] bi
|
[ forget-clone-method ] bi
|
||||||
]
|
]
|
||||||
[ { "c-type" "layout" "struct-size" } reset-props ]
|
[ { "c-type" "layout" "struct-size" } remove-word-props ]
|
||||||
[ call-next-method ]
|
[ call-next-method ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ M: memoized definition "memo-quot" word-prop ;
|
||||||
|
|
||||||
M: memoized reset-word
|
M: memoized reset-word
|
||||||
[ call-next-method ]
|
[ call-next-method ]
|
||||||
[ { "memoize" "memo-quot" } reset-props ]
|
[ { "memoize" "memo-quot" } remove-word-props ]
|
||||||
bi ;
|
bi ;
|
||||||
|
|
||||||
: memoize-quot ( quot effect -- memo-quot )
|
: memoize-quot ( quot effect -- memo-quot )
|
||||||
|
|
|
@ -62,7 +62,7 @@ M: class reset-class
|
||||||
"members"
|
"members"
|
||||||
"participants"
|
"participants"
|
||||||
"predicate"
|
"predicate"
|
||||||
} reset-props ;
|
} remove-word-props ;
|
||||||
|
|
||||||
M: word reset-class drop ;
|
M: word reset-class drop ;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ M: mixin-class (classes-intersect?)
|
||||||
members [ classes-intersect? ] with any? ;
|
members [ classes-intersect? ] with any? ;
|
||||||
|
|
||||||
M: mixin-class reset-class
|
M: mixin-class reset-class
|
||||||
[ call-next-method ] [ { "mixin" } reset-props ] bi ;
|
[ call-next-method ] [ "mixin" remove-word-prop ] bi ;
|
||||||
|
|
||||||
M: mixin-class rank-class drop 8 ;
|
M: mixin-class rank-class drop 8 ;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ PRIVATE>
|
||||||
] 3tri ;
|
] 3tri ;
|
||||||
|
|
||||||
M: predicate-class reset-class
|
M: predicate-class reset-class
|
||||||
[ call-next-method ] [ { "predicate-definition" } reset-props ] bi ;
|
[ call-next-method ] [ "predicate-definition" remove-word-prop ] bi ;
|
||||||
|
|
||||||
M: predicate-class rank-class drop 2 ;
|
M: predicate-class rank-class drop 2 ;
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,7 @@ M: tuple-class reset-class
|
||||||
dup "slots" word-prop forget-slot-accessors
|
dup "slots" word-prop forget-slot-accessors
|
||||||
] [
|
] [
|
||||||
[ call-next-method ]
|
[ call-next-method ]
|
||||||
[ { "layout" "slots" "boa-check" "prototype" "final" } reset-props ]
|
[ { "layout" "slots" "boa-check" "prototype" "final" } remove-word-props ]
|
||||||
bi
|
bi
|
||||||
] bi ;
|
] bi ;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ PREDICATE: generic < word
|
||||||
M: generic definition drop f ;
|
M: generic definition drop f ;
|
||||||
|
|
||||||
: make-generic ( word -- )
|
: make-generic ( word -- )
|
||||||
[ { "unannotated-def" } reset-props ]
|
[ "unannotated-def" remove-word-prop ]
|
||||||
[ dup "combination" word-prop perform-combination ]
|
[ dup "combination" word-prop perform-combination ]
|
||||||
bi ;
|
bi ;
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,11 @@ HELP: remove-word-prop
|
||||||
{ $description "Removes a word property, so future lookups will output " { $link f } " until it is set again. Word property names are conventionally strings." }
|
{ $description "Removes a word property, so future lookups will output " { $link f } " until it is set again. Word property names are conventionally strings." }
|
||||||
{ $side-effects "word" } ;
|
{ $side-effects "word" } ;
|
||||||
|
|
||||||
|
HELP: remove-word-props
|
||||||
|
{ $values { "word" word } { "seq" "a sequence of word property names" } }
|
||||||
|
{ $description "Removes all listed word properties from the word." }
|
||||||
|
{ $side-effects "word" } ;
|
||||||
|
|
||||||
HELP: word-code
|
HELP: word-code
|
||||||
{ $values { "word" word } { "start" "the word's start address" } { "end" "the word's end address" } }
|
{ $values { "word" word } { "start" "the word's start address" } { "end" "the word's end address" } }
|
||||||
{ $description "Outputs the memory range containing the word's machine code." } ;
|
{ $description "Outputs the memory range containing the word's machine code." } ;
|
||||||
|
@ -227,11 +232,6 @@ HELP: define
|
||||||
{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
|
{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
|
||||||
{ $side-effects "word" } ;
|
{ $side-effects "word" } ;
|
||||||
|
|
||||||
HELP: reset-props
|
|
||||||
{ $values { "word" word } { "seq" "a sequence of word property names" } }
|
|
||||||
{ $description "Removes all listed word properties from the word." }
|
|
||||||
{ $side-effects "word" } ;
|
|
||||||
|
|
||||||
HELP: reset-word
|
HELP: reset-word
|
||||||
{ $values { "word" word } }
|
{ $values { "word" word } }
|
||||||
{ $description "Reset word declarations." }
|
{ $description "Reset word declarations." }
|
||||||
|
|
|
@ -33,6 +33,9 @@ M: word definition def>> ;
|
||||||
|
|
||||||
: remove-word-prop ( word name -- ) swap props>> delete-at ;
|
: remove-word-prop ( word name -- ) swap props>> delete-at ;
|
||||||
|
|
||||||
|
: remove-word-props ( word seq -- )
|
||||||
|
swap props>> [ delete-at ] curry each ;
|
||||||
|
|
||||||
: set-word-prop ( word value name -- )
|
: set-word-prop ( word value name -- )
|
||||||
over
|
over
|
||||||
[ pick props>> ?set-at >>props drop ]
|
[ pick props>> ?set-at >>props drop ]
|
||||||
|
@ -41,8 +44,6 @@ M: word definition def>> ;
|
||||||
: change-word-prop ( ..a word prop quot: ( ..a value -- ..b newvalue ) -- ..b )
|
: change-word-prop ( ..a word prop quot: ( ..a value -- ..b newvalue ) -- ..b )
|
||||||
[ swap props>> ] dip change-at ; inline
|
[ swap props>> ] dip change-at ; inline
|
||||||
|
|
||||||
: reset-props ( word seq -- ) [ remove-word-prop ] with each ;
|
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: caller ( callstack -- word ) callstack>array <reversed> third ;
|
: caller ( callstack -- word ) callstack>array <reversed> third ;
|
||||||
|
@ -169,7 +170,7 @@ M: word reset-word
|
||||||
"unannotated-def" "parsing" "inline" "recursive"
|
"unannotated-def" "parsing" "inline" "recursive"
|
||||||
"foldable" "flushable" "reading" "writing" "reader"
|
"foldable" "flushable" "reading" "writing" "reader"
|
||||||
"writer" "delimiter" "deprecated"
|
"writer" "delimiter" "deprecated"
|
||||||
} reset-props ;
|
} remove-word-props ;
|
||||||
|
|
||||||
: reset-generic ( word -- )
|
: reset-generic ( word -- )
|
||||||
[ subwords forget-all ]
|
[ subwords forget-all ]
|
||||||
|
@ -183,7 +184,7 @@ M: word reset-word
|
||||||
"default-method"
|
"default-method"
|
||||||
"engines"
|
"engines"
|
||||||
"decision-tree"
|
"decision-tree"
|
||||||
} reset-props
|
} remove-word-props
|
||||||
] tri ;
|
] tri ;
|
||||||
|
|
||||||
: <word> ( name vocab -- word )
|
: <word> ( name vocab -- word )
|
||||||
|
|
Loading…
Reference in New Issue