words: rename reset-props to remove-word-props.
							parent
							
								
									77f980881b
								
							
						
					
					
						commit
						aa00d59d59
					
				| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,7 @@ M: class reset-class
 | 
			
		|||
        "members"
 | 
			
		||||
        "participants"
 | 
			
		||||
        "predicate"
 | 
			
		||||
    } reset-props ;
 | 
			
		||||
    } remove-word-props ;
 | 
			
		||||
 | 
			
		||||
M: word reset-class drop ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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." }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue