Remove method-specs in favor of M\
parent
3752c706da
commit
268abfcf2a
|
@ -130,8 +130,6 @@ M: node node>quot drop ;
|
||||||
|
|
||||||
GENERIC: optimized. ( quot/word -- )
|
GENERIC: optimized. ( quot/word -- )
|
||||||
|
|
||||||
M: method-spec optimized. first2 method optimized. ;
|
|
||||||
|
|
||||||
M: word optimized. specialized-def optimized. ;
|
M: word optimized. specialized-def optimized. ;
|
||||||
|
|
||||||
M: callable optimized. build-tree optimize-tree nodes>quot . ;
|
M: callable optimized. build-tree optimize-tree nodes>quot . ;
|
||||||
|
|
|
@ -22,7 +22,7 @@ HELP: edit
|
||||||
"A word's documentation:"
|
"A word's documentation:"
|
||||||
{ $code "\\ foo >link edit" }
|
{ $code "\\ foo >link edit" }
|
||||||
"A method definition:"
|
"A method definition:"
|
||||||
{ $code "{ editor draw-gadget* } edit" }
|
{ $code "M\\ fixnum + edit" }
|
||||||
"A help article:"
|
"A help article:"
|
||||||
{ $code "\"handbook\" >link edit" }
|
{ $code "\"handbook\" >link edit" }
|
||||||
} ;
|
} ;
|
||||||
|
|
|
@ -65,7 +65,6 @@ M: object specializer-declaration class ;
|
||||||
|
|
||||||
SYNTAX: HINTS:
|
SYNTAX: HINTS:
|
||||||
scan-object
|
scan-object
|
||||||
dup method-spec? [ first2 method ] when
|
|
||||||
[ redefined ]
|
[ redefined ]
|
||||||
[ parse-definition "specializer" set-word-prop ] bi ;
|
[ parse-definition "specializer" set-word-prop ] bi ;
|
||||||
|
|
||||||
|
@ -119,6 +118,6 @@ SYNTAX: HINTS:
|
||||||
|
|
||||||
\ >be { { bignum fixnum } { fixnum fixnum } } "specializer" set-word-prop
|
\ >be { { bignum fixnum } { fixnum fixnum } } "specializer" set-word-prop
|
||||||
|
|
||||||
\ hashtable \ at* method { { fixnum object } { word object } } "specializer" set-word-prop
|
M\ hashtable at* { { fixnum object } { word object } } "specializer" set-word-prop
|
||||||
|
|
||||||
\ hashtable \ set-at method { { object fixnum object } { object word object } } "specializer" set-word-prop
|
M\ hashtable set-at { { object fixnum object } { object word object } } "specializer" set-word-prop
|
||||||
|
|
|
@ -13,7 +13,12 @@ HELP: synopsis*
|
||||||
|
|
||||||
HELP: see
|
HELP: see
|
||||||
{ $values { "defspec" "a definition specifier" } }
|
{ $values { "defspec" "a definition specifier" } }
|
||||||
{ $contract "Prettyprints a definition." } ;
|
{ $contract "Prettyprints a definition." }
|
||||||
|
{ $examples
|
||||||
|
"A word:" { $code "\\ append see" }
|
||||||
|
"A method:" { $code "USE: arrays" "M\\ array length see" }
|
||||||
|
"A help article:" { $code "USE: help.topics" "\"help\" >link see" }
|
||||||
|
} ;
|
||||||
|
|
||||||
HELP: see-methods
|
HELP: see-methods
|
||||||
{ $values { "word" "a " { $link generic } " or a " { $link class } } }
|
{ $values { "word" "a " { $link generic } " or a " { $link class } } }
|
||||||
|
|
|
@ -76,9 +76,6 @@ M: hook-generic synopsis*
|
||||||
[ stack-effect. ]
|
[ stack-effect. ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
M: method-spec synopsis*
|
|
||||||
first2 method synopsis* ;
|
|
||||||
|
|
||||||
M: method-body synopsis*
|
M: method-body synopsis*
|
||||||
[ definer. ]
|
[ definer. ]
|
||||||
[ "method-class" word-prop pprint-word ]
|
[ "method-class" word-prop pprint-word ]
|
||||||
|
@ -122,9 +119,6 @@ M: object see*
|
||||||
block>
|
block>
|
||||||
] with-use ;
|
] with-use ;
|
||||||
|
|
||||||
M: method-spec see*
|
|
||||||
first2 method see* ;
|
|
||||||
|
|
||||||
GENERIC: see-class* ( word -- )
|
GENERIC: see-class* ( word -- )
|
||||||
|
|
||||||
M: union-class see-class*
|
M: union-class see-class*
|
||||||
|
|
|
@ -20,9 +20,6 @@ M: word reset
|
||||||
f "unannotated-def" set-word-prop
|
f "unannotated-def" set-word-prop
|
||||||
] [ drop ] if ;
|
] [ drop ] if ;
|
||||||
|
|
||||||
M: method-spec reset
|
|
||||||
first2 method reset ;
|
|
||||||
|
|
||||||
ERROR: cannot-annotate-twice word ;
|
ERROR: cannot-annotate-twice word ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -32,9 +29,6 @@ ERROR: cannot-annotate-twice word ;
|
||||||
cannot-annotate-twice
|
cannot-annotate-twice
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: method-spec>word ( obj -- word )
|
|
||||||
dup method-spec? [ first2 method ] when ;
|
|
||||||
|
|
||||||
: save-unannotated-def ( word -- )
|
: save-unannotated-def ( word -- )
|
||||||
dup def>> "unannotated-def" set-word-prop ;
|
dup def>> "unannotated-def" set-word-prop ;
|
||||||
|
|
||||||
|
@ -44,7 +38,7 @@ ERROR: cannot-annotate-twice word ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: annotate ( word quot -- )
|
: annotate ( word quot -- )
|
||||||
[ method-spec>word check-annotate-twice ] dip
|
[ check-annotate-twice ] dip
|
||||||
[ over save-unannotated-def (annotate) ] with-compilation-unit ;
|
[ over save-unannotated-def (annotate) ] with-compilation-unit ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -103,9 +97,6 @@ M: generic annotate-methods
|
||||||
M: word annotate-methods
|
M: word annotate-methods
|
||||||
annotate ;
|
annotate ;
|
||||||
|
|
||||||
M: method-spec annotate-methods
|
|
||||||
annotate ;
|
|
||||||
|
|
||||||
: breakpoint ( word -- )
|
: breakpoint ( word -- )
|
||||||
[ add-breakpoint ] annotate-methods ;
|
[ add-breakpoint ] annotate-methods ;
|
||||||
|
|
||||||
|
|
|
@ -170,8 +170,6 @@ IN: tools.deploy.shaker
|
||||||
|
|
||||||
strip-prettyprint? [
|
strip-prettyprint? [
|
||||||
{
|
{
|
||||||
"break-before"
|
|
||||||
"break-after"
|
|
||||||
"delimiter"
|
"delimiter"
|
||||||
"flushable"
|
"flushable"
|
||||||
"foldable"
|
"foldable"
|
||||||
|
|
|
@ -16,8 +16,6 @@ M: pair disassemble first2 disassemble* [ tabs>spaces print ] each ;
|
||||||
|
|
||||||
M: word disassemble word-xt 2array disassemble ;
|
M: word disassemble word-xt 2array disassemble ;
|
||||||
|
|
||||||
M: method-spec disassemble first2 method disassemble ;
|
|
||||||
|
|
||||||
cpu x86?
|
cpu x86?
|
||||||
"tools.disassembler.udis"
|
"tools.disassembler.udis"
|
||||||
"tools.disassembler.gdb" ?
|
"tools.disassembler.gdb" ?
|
||||||
|
|
|
@ -24,11 +24,6 @@ M: generic definition drop f ;
|
||||||
: method ( class generic -- method/f )
|
: method ( class generic -- method/f )
|
||||||
"methods" word-prop at ;
|
"methods" word-prop at ;
|
||||||
|
|
||||||
PREDICATE: method-spec < pair
|
|
||||||
first2 generic? swap class? and ;
|
|
||||||
|
|
||||||
INSTANCE: method-spec definition
|
|
||||||
|
|
||||||
: order ( generic -- seq )
|
: order ( generic -- seq )
|
||||||
"methods" word-prop keys sort-classes ;
|
"methods" word-prop keys sort-classes ;
|
||||||
|
|
||||||
|
@ -90,9 +85,6 @@ TUPLE: check-method class generic ;
|
||||||
PREDICATE: method-body < word
|
PREDICATE: method-body < word
|
||||||
"method-generic" word-prop >boolean ;
|
"method-generic" word-prop >boolean ;
|
||||||
|
|
||||||
M: method-spec stack-effect
|
|
||||||
first2 method stack-effect ;
|
|
||||||
|
|
||||||
M: method-body stack-effect
|
M: method-body stack-effect
|
||||||
"method-generic" word-prop stack-effect ;
|
"method-generic" word-prop stack-effect ;
|
||||||
|
|
||||||
|
@ -139,24 +131,6 @@ M: default-method irrelevant? drop t ;
|
||||||
dupd <default-method> "default-method" set-word-prop ;
|
dupd <default-method> "default-method" set-word-prop ;
|
||||||
|
|
||||||
! Definition protocol
|
! Definition protocol
|
||||||
M: method-spec where
|
|
||||||
dup first2 method [ ] [ second ] ?if where ;
|
|
||||||
|
|
||||||
M: method-spec set-where
|
|
||||||
first2 method set-where ;
|
|
||||||
|
|
||||||
M: method-spec definer
|
|
||||||
first2 method definer ;
|
|
||||||
|
|
||||||
M: method-spec definition
|
|
||||||
first2 method definition ;
|
|
||||||
|
|
||||||
M: method-spec forget*
|
|
||||||
first2 method [ forgotten-definition ] [ forget* ] bi ;
|
|
||||||
|
|
||||||
M: method-spec smart-usage
|
|
||||||
second smart-usage ;
|
|
||||||
|
|
||||||
M: method-body definer
|
M: method-body definer
|
||||||
drop \ M: \ ; ;
|
drop \ M: \ ; ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue