words: rename reset-props to remove-word-props.

db4
John Benediktsson 2015-06-09 11:53:46 -07:00
parent 77f980881b
commit aa00d59d59
10 changed files with 21 additions and 19 deletions

View File

@ -44,13 +44,14 @@ ERROR: bad-array-type ;
} 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 ;

View File

@ -333,7 +333,7 @@ M: struct-class reset-class
[ 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 ;

View File

@ -81,7 +81,7 @@ M: memoized definition "memo-quot" word-prop ;
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 )

View File

@ -62,7 +62,7 @@ M: class reset-class
"members"
"participants"
"predicate"
} reset-props ;
} remove-word-props ;
M: word reset-class drop ;

View File

@ -14,7 +14,7 @@ M: mixin-class (classes-intersect?)
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 ;

View File

@ -32,7 +32,7 @@ PRIVATE>
] 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 ;

View File

@ -353,7 +353,7 @@ M: tuple-class reset-class
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 ;

View File

@ -18,7 +18,7 @@ PREDICATE: generic < word
M: generic definition drop f ;
: make-generic ( word -- )
[ { "unannotated-def" } reset-props ]
[ "unannotated-def" remove-word-prop ]
[ dup "combination" word-prop perform-combination ]
bi ;

View File

@ -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." }
{ $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." } ;
@ -227,11 +232,6 @@ HELP: define
{ $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." }

View File

@ -33,6 +33,9 @@ M: word definition def>> ;
: 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 ]
@ -41,8 +44,6 @@ M: word definition def>> ;
: 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 ;
@ -169,7 +170,7 @@ M: word reset-word
"unannotated-def" "parsing" "inline" "recursive"
"foldable" "flushable" "reading" "writing" "reader"
"writer" "delimiter" "deprecated"
} reset-props ;
} remove-word-props ;
: reset-generic ( word -- )
[ subwords forget-all ]
@ -183,7 +184,7 @@ M: word reset-word
"default-method"
"engines"
"decision-tree"
} reset-props
} remove-word-props
] tri ;
: <word> ( name vocab -- word )