} cond ;
: reset-c-type ( word -- )
- dup "struct-size" word-prop
- [ dup [ forget-class ] [ { "struct-size" } reset-props ] bi ] when
+ dup "struct-size" word-prop [
+ dup [ forget-class ] [ "struct-size" remove-word-prop ] bi
+ ] when
{
"c-type"
"callback-effect"
"callback-library"
- } reset-props ;
+ } remove-word-props ;
ERROR: *-in-c-type-name name ;
[ forget-struct-slot-values-method ]
[ forget-clone-method ] bi
]
- [ { "c-type" "layout" "struct-size" } reset-props ]
+ [ { "c-type" "layout" "struct-size" } remove-word-props ]
[ call-next-method ]
} cleave ;
M: memoized reset-word
[ call-next-method ]
- [ { "memoize" "memo-quot" } reset-props ]
+ [ { "memoize" "memo-quot" } remove-word-props ]
bi ;
: memoize-quot ( quot effect -- memo-quot )
"members"
"participants"
"predicate"
- } reset-props ;
+ } remove-word-props ;
M: word reset-class drop ;
members [ classes-intersect? ] with any? ;
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 ;
] 3tri ;
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 ;
dup "slots" word-prop forget-slot-accessors
] [
[ call-next-method ]
- [ { "layout" "slots" "boa-check" "prototype" "final" } reset-props ]
+ [ { "layout" "slots" "boa-check" "prototype" "final" } remove-word-props ]
bi
] bi ;
M: generic definition drop f ;
: make-generic ( word -- )
- [ { "unannotated-def" } reset-props ]
+ [ "unannotated-def" remove-word-prop ]
[ dup "combination" word-prop perform-combination ]
bi ;
{ $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" } ;
+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
{ $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." } ;
{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
{ $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
{ $values { "word" word } }
{ $description "Reset word declarations." }
: 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 -- )
over
[ pick props>> ?set-at >>props drop ]
: change-word-prop ( ..a word prop quot: ( ..a value -- ..b newvalue ) -- ..b )
[ swap props>> ] dip change-at ; inline
-: reset-props ( word seq -- ) [ remove-word-prop ] with each ;
-
<PRIVATE
: caller ( callstack -- word ) callstack>array <reversed> third ;
"unannotated-def" "parsing" "inline" "recursive"
"foldable" "flushable" "reading" "writing" "reader"
"writer" "delimiter" "deprecated"
- } reset-props ;
+ } remove-word-props ;
: reset-generic ( word -- )
[ subwords forget-all ]
"default-method"
"engines"
"decision-tree"
- } reset-props
+ } remove-word-props
] tri ;
: <word> ( name vocab -- word )