]> gitweb.factorcode.org Git - factor.git/commitdiff
core: removing unnecessary method stack effects.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 9 Sep 2020 18:12:50 +0000 (11:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 9 Sep 2020 22:00:53 +0000 (15:00 -0700)
16 files changed:
core/assocs/assocs.factor
core/classes/classes.factor
core/classes/tuple/tuple.factor
core/compiler/units/units.factor
core/effects/effects.factor
core/generic/single/single.factor
core/growable/growable.factor
core/io/encodings/encodings.factor
core/io/encodings/utf16/utf16.factor
core/io/files/files.factor
core/io/pathnames/pathnames.factor
core/math/integers/integers.factor
core/math/order/order.factor
core/sequences/sequences.factor
core/slots/slots.factor
core/vocabs/loader/loader.factor

index e6f5594e95e7a980f54dbe03eba1435e973602d8..6955efbe9c0d6d418e3fb443777e49efd1d02387 100644 (file)
@@ -120,7 +120,7 @@ PRIVATE>
 : of ( assoc key -- value/f )
     swap at ; inline
 
-M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
+M: assoc assoc-clone-like
     [ dup assoc-size ] dip new-assoc
     [ [ set-at ] with-assoc assoc-each ] keep ; inline
 
@@ -299,7 +299,7 @@ M: enumerated set-at seq>> set-nth ; inline
 
 M: enumerated delete-at seq>> remove-nth! drop ; inline
 
-M: enumerated >alist ( enumerated -- alist ) ; inline
+M: enumerated >alist ; inline
 
 M: enumerated keys seq>> length <iota> >array ; inline
 
index f33d8bbaf756f2b6f17a13206d0a451afb6c2ff8..8401a654a190f4aae601ac3b58dc18412db18de2 100644 (file)
@@ -253,7 +253,7 @@ PRIVATE>
 M: class metaclass-changed
     swap class? [ drop ] [ forget-class ] if ;
 
-M: class forget* ( class -- )
+M: class forget*
     [ call-next-method ] [ forget-class ] bi ;
 
 ERROR: not-an-instance obj class ;
index 86ddf242574297e257662cbaf87fd5f8121b5131..ba0b9c5704d32b6d0460e3a86da39b388aa45ed7 100644 (file)
@@ -93,7 +93,7 @@ PRIVATE>
 
 GENERIC: slots>tuple ( seq class -- tuple )
 
-M: tuple-class slots>tuple ( seq class -- tuple )
+M: tuple-class slots>tuple
     check-slots pad-slots
     tuple-layout <tuple> [
         [ tuple-size <iota> ]
index a458ff6fbb0eb77f43414614fbab6697b08c4301..b349108845a66cfc2e8fb3b3ec9699682029119b 100644 (file)
@@ -49,13 +49,13 @@ HOOK: update-call-sites compiler-impl ( class generic -- words )
 : changed-call-sites ( class generic -- )
     update-call-sites [ changed-definition ] each ;
 
-M: generic update-generic ( class generic -- )
+M: generic update-generic
     [ changed-call-sites ]
     [ remake-generic drop ]
     [ changed-conditionally drop ]
     2tri ;
 
-M: sequence update-methods ( class seq -- )
+M: sequence update-methods
     implementors [ update-generic ] with each ;
 
 HOOK: recompile compiler-impl ( words -- alist )
index 44ddb71c49b0b0047d1b913323050a5e64c249cc..f14f5cfecb35a8ae4c8705c0aa6521710a2fc53e 100644 (file)
@@ -71,7 +71,7 @@ M: pair effect>string
 
 PRIVATE>
 
-M: effect effect>string ( effect -- string )
+M: effect effect>string
     [
         "( " %
         dup in-var>> var-picture%
index bc255e72ee076952c1b76e90cdec0ccf24ce98c1..4dec5b9d83debe2ba58b1e184bfdae055ab3d776 100644 (file)
@@ -39,7 +39,7 @@ SYMBOL: combination
 
 HOOK: picker combination ( -- quot )
 
-M: single-combination next-method-quot* ( class generic combination -- quot )
+M: single-combination next-method-quot*
     [
         2dup next-method dup [
             [
index 2f7554a76287be101ae1cef43cadf8be2e95e5c5..919e5ef3077abf4ad69f3ea3149f9b5c41fbdb6a 100644 (file)
@@ -32,12 +32,12 @@ PRIVATE>
 
 GENERIC: contract ( len seq -- )
 
-M: growable contract ( len seq -- )
+M: growable contract
     [ length ] keep
     [ [ 0 ] 2dip set-nth-unsafe ] curry
     (each-integer) ; inline
 
-M: growable set-length ( n seq -- )
+M: growable set-length
     bounds-check-head
     2dup length < [
         2dup contract
@@ -62,13 +62,13 @@ M: growable set-nth ensure set-nth-unsafe ; inline
 
 M: growable clone (clone) [ clone ] change-underlying ; inline
 
-M: growable lengthen ( n seq -- )
+M: growable lengthen
     2dup length > [
         2dup capacity > [ over new-size over expand ] when
         2dup length<<
     ] when 2drop ; inline
 
-M: growable shorten ( n seq -- )
+M: growable shorten
     bounds-check-head
     2dup length < [
         2dup contract
index 5fef2f1be637e6c2c1bc219255ec3975bf9890d5..fd945bdf20599fb961c588fcdd5c00878fe1e908 100644 (file)
@@ -109,7 +109,7 @@ M: decoder stream-element-type
         over cr- dup CHAR: \n eq? [ drop (read1) ] [ nip ] if
     ] [ nip ] if ; inline
 
-M: decoder stream-read1 ( decoder -- ch )
+M: decoder stream-read1
     dup (read1) fix-cr ; inline
 
 : (read-first) ( n buf decoder -- buf stream encoding n c )
index 112667575b4be9e01465f75ff5ab262d93361496..254f668c903d648360a8d19be9d680d9244c84f0 100644 (file)
@@ -87,7 +87,7 @@ M: utf16le decode-char
         [ [ encode-second ] dip stream-write2 ] 2bi
     ] [ [ h>b/b swap ] dip stream-write2 ] if ; inline
 
-M: utf16be encode-char ( char stream encoding -- )
+M: utf16be encode-char
     drop char>utf16be ;
 
 : char>utf16le ( char stream -- )
@@ -97,7 +97,7 @@ M: utf16be encode-char ( char stream encoding -- )
         [ [ encode-second swap ] dip stream-write2 ] 2bi
     ] [ [ h>b/b ] dip stream-write2 ] if ; inline
 
-M: utf16le encode-char ( char stream encoding -- )
+M: utf16le encode-char
     drop char>utf16le ;
 
 : ascii-char>utf16-byte-array ( off n byte-array string -- )
@@ -155,10 +155,10 @@ CONSTANT: bom-be B{ 0xfe 0xff }
         bom-be sequence= [ utf16be ] [ missing-bom ] if
     ] if ;
 
-M: utf16 <decoder> ( stream utf16 -- decoder )
+M: utf16 <decoder>
     drop 2 over stream-read bom>le/be <decoder> ;
 
-M: utf16 <encoder> ( stream utf16 -- encoder )
+M: utf16 <encoder>
     drop bom-le over stream-write utf16le <encoder> ;
 
 PRIVATE>
index e96dbc8ab5a791a7c2c3027ee188f211f12daff7..798d6d7dcefd4ab3cbff191e7c652c8bd63948bd 100644 (file)
@@ -80,7 +80,7 @@ HOOK: cd io-backend ( path -- )
 
 HOOK: cwd io-backend ( -- path )
 
-M: object cwd ( -- path ) "." ;
+M: object cwd "." ;
 
 PRIVATE>
 
index bbd9298dcd09e51be415103ff1f664f35ae1b503..b54b207bca2ed5098c94d4336a84426766525f0a 100644 (file)
@@ -21,7 +21,7 @@ SYMBOL: current-directory
 
 HOOK: root-directory? io-backend ( path -- ? )
 
-M: object root-directory? ( path -- ? )
+M: object root-directory?
     [ f ] [ [ path-separator? ] all? ] if-empty ;
 
 ERROR: no-parent-directory path ;
@@ -163,7 +163,7 @@ M: string absolute-path
         ] if ] if
     ] if ;
 
-M: object normalize-path ( path -- path' )
+M: object normalize-path
     absolute-path ;
 
 : root-path* ( path -- path' )
@@ -229,4 +229,4 @@ C: <pathname> pathname
 
 M: pathname absolute-path string>> absolute-path ;
 
-M: pathname <=> [ string>> ] compare ;
\ No newline at end of file
+M: pathname <=> [ string>> ] compare ;
index 6467361a608b785c6a4eb7b8a764c2497ee194b6..c060e50d8f7f3aaae359c4aec1665c5478692fc0 100644 (file)
@@ -223,7 +223,7 @@ M: bignum (log2) bignum-log2 ; inline
 : bignum/f ( m n -- f )
     [ [ abs ] bi@ /f-abs ] [ [ 0 < ] bi@ xor ] 2bi [ neg ] when ; inline
 
-M: bignum /f ( m n -- f ) { bignum bignum } declare bignum/f ;
+M: bignum /f { bignum bignum } declare bignum/f ;
 
 CONSTANT: bignum/f-threshold 0x20,0000,0000,0000
 
index 5ebe77c45940939b1df0665262f42fef695350f1..a07f3a979ea7ac73cac70c9b12865621bf8ee440 100644 (file)
@@ -37,15 +37,15 @@ GENERIC: after? ( obj1 obj2 -- ? )
 GENERIC: before=? ( obj1 obj2 -- ? )
 GENERIC: after=? ( obj1 obj2 -- ? )
 
-M: object before? ( obj1 obj2 -- ? ) <=> +lt+ eq? ; inline
-M: object after? ( obj1 obj2 -- ? ) <=> +gt+ eq? ; inline
-M: object before=? ( obj1 obj2 -- ? ) <=> +gt+ eq? not ; inline
-M: object after=? ( obj1 obj2 -- ? ) <=> +lt+ eq? not ; inline
-
-M: real before? ( obj1 obj2 -- ? ) < ; inline
-M: real after? ( obj1 obj2 -- ? ) > ; inline
-M: real before=? ( obj1 obj2 -- ? ) <= ; inline
-M: real after=? ( obj1 obj2 -- ? ) >= ; inline
+M: object before? <=> +lt+ eq? ; inline
+M: object after? <=> +gt+ eq? ; inline
+M: object before=? <=> +gt+ eq? not ; inline
+M: object after=? <=> +lt+ eq? not ; inline
+
+M: real before? < ; inline
+M: real after? > ; inline
+M: real before=? <= ; inline
+M: real after=? >= ; inline
 
 GENERIC: min ( obj1 obj2 -- obj )
 GENERIC: max ( obj1 obj2 -- obj )
index d0b2a7bc426cf2875cb7847b2a4a9c7f1e3bfd3e..bb76410c2e7ff4c85eb5c46df9d00242dfc552fc 100644 (file)
@@ -53,7 +53,7 @@ ERROR: bounds-error index seq ;
 
 GENERIC#: bounds-check? 1 ( n seq -- ? )
 
-M: integer bounds-check? ( n seq -- ? )
+M: integer bounds-check?
     dupd length < [ 0 >= ] [ drop f ] if ; inline
 
 : bounds-check ( n seq -- n seq )
index 5afaf618d24872991a3099e73c2d46b2c6f6e6d5..0ec351a5ef319089c7c63db77905d886006207cf 100644 (file)
@@ -72,7 +72,7 @@ ERROR: bad-slot-value value class ;
 
 GENERIC: instance-check-quot ( obj -- quot )
 
-M: class instance-check-quot ( class -- quot )
+M: class instance-check-quot
     {
         { [ dup object bootstrap-word eq? ] [ drop [ ] ] }
         { [ dup "coercer" word-prop ] [ "coercer" word-prop ] }
index e0b8b12aea79fb8c43eeb32b38c377949f116bf8..9ca8c158772dc5085457fc0c3d2f6c52a4083c5c 100644 (file)
@@ -36,7 +36,7 @@ ERROR: not-found-in-roots path ;
 : find-root-for ( path -- path/f )
     vocab-roots get [ prepend-path exists? ] with find nip ;
 
-M: string vocab-path ( string -- path/f )
+M: string vocab-path
     dup find-root-for [ prepend-path ] [ not-found-in-roots ] if* ;
 
 PRIVATE>