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