From 6d47257a6a7fdaa23e3843d91d21c829e16a1879 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 20 Jun 2016 12:21:49 -0700 Subject: [PATCH] factor: rename GENERIC# to GENERIC#: --- collections/cursors/cursors.factor | 6 ++--- core/alien/strings/strings.factor | 4 ++-- core/bootstrap/syntax.factor | 2 +- core/classes/mixin/mixin.factor | 2 +- core/classes/tuple/parser/parser.factor | 2 +- core/classes/tuple/tuple-tests.factor | 4 ++-- core/classes/tuple/tuple.factor | 2 +- core/delegate/delegate-tests.factor | 2 +- core/delegate/delegate.factor | 2 +- core/generic/generic-docs.factor | 6 ++--- core/generic/generic.factor | 2 +- core/generic/standard/standard-docs.factor | 2 +- core/generic/standard/standard-tests.factor | 8 +++---- core/generic/standard/standard.factor | 2 +- core/io/encodings/encodings.factor | 4 ++-- core/io/encodings/utf16/utf16.factor | 4 ++-- core/io/encodings/utf8/utf8.factor | 2 +- core/locals/locals-tests.factor | 4 ++-- core/math/math.factor | 4 ++-- core/math/parser/parser.factor | 2 +- core/modern/compiler/compiler.factor | 2 +- core/parser/parser-tests.factor | 2 +- core/sequences/sequences.factor | 2 +- core/slots/slots.factor | 4 ++-- core/syntax/attributes/attributes.factor | 2 +- core/syntax/syntax-docs.factor | 6 ++--- core/syntax/syntax.factor | 2 +- demos/project-euler/215/215.factor | 4 ++-- ffi/mongodb/driver/driver.factor | 2 +- ffi/unix/linux/proc/proc.factor | 2 +- frameworks/db/db.factor | 4 ++-- frameworks/game/loop/loop.factor | 2 +- frameworks/game/models/loader/loader.factor | 2 +- .../gpu/framebuffers/framebuffers.factor | 2 +- frameworks/gpu/render/render.factor | 14 +++++------ frameworks/gpu/textures/textures.factor | 10 ++++---- frameworks/ui/gadgets/worlds/worlds.factor | 2 +- .../ui/pixel-formats/pixel-formats.factor | 2 +- .../listener/completion/completion.factor | 2 +- frameworks/ui/traverse/traverse.factor | 2 +- .../compiler/cfg/gc-checks/gc-checks.factor | 2 +- .../intrinsics/simd/backend/backend.factor | 2 +- .../coalescing/coalescing.factor | 2 +- .../compiler/cfg/stacks/height/height.factor | 2 +- language/compiler/tests/redefine16.factor | 4 ++-- language/cpu/arm/assembler/assembler.factor | 6 ++--- language/cpu/x86/assembler/assembler.factor | 6 ++--- language/io/files/info/unix/unix.factor | 2 +- language/io/sockets/sockets.factor | 2 +- language/io/streams/limited/limited.factor | 2 +- language/monads/monads.factor | 6 ++--- language/variants/variants.factor | 2 +- libs/calendar/calendar.factor | 2 +- libs/concurrency/mailboxes/mailboxes.factor | 2 +- libs/gml/types/types.factor | 4 ++-- libs/images/loader/loader.factor | 2 +- libs/json/writer/writer.factor | 2 +- libs/math/floats/env/env.factor | 8 +++---- libs/math/functions/functions.factor | 4 ++-- libs/math/vectors/vectors.factor | 24 +++++++++---------- libs/random/random.factor | 4 ++-- libs/regexp/classes/classes.factor | 4 ++-- libs/zeromq/zeromq.factor | 4 ++-- tools/graphviz/notation/notation.factor | 2 +- tools/listener/listener.factor | 2 +- tools/tools/annotations/annotations.factor | 4 ++-- tools/tools/crossref/crossref.factor | 2 +- tools/tools/dns/dns.factor | 2 +- unmaintained/ui/gadgets/layout/layout.factor | 4 ++-- 69 files changed, 125 insertions(+), 125 deletions(-) diff --git a/collections/cursors/cursors.factor b/collections/cursors/cursors.factor index 805d634544..28617716ff 100644 --- a/collections/cursors/cursors.factor +++ b/collections/cursors/cursors.factor @@ -40,8 +40,8 @@ GENERIC: dec-cursor ( cursor -- cursor' ) ; mixin: random-access-cursor INSTANCE: random-access-cursor bidirectional-cursor ; -GENERIC# cursor+ 1 ( cursor n -- cursor' ) ; -GENERIC# cursor- 1 ( cursor n -- cursor' ) ; +GENERIC#: cursor+ 1 ( cursor n -- cursor' ) ; +GENERIC#: cursor- 1 ( cursor n -- cursor' ) ; GENERIC: cursor-distance ( cursor cursor -- n ) ; GENERIC: cursor< ( cursor cursor -- ? ) ; GENERIC: cursor> ( cursor cursor -- ? ) ; @@ -391,7 +391,7 @@ M: pusher-cursor set-cursor-value growable>> push ; inline : new-growable-cursor ( begin end exemplar -- cursor result ) [ swap cursor-distance-hint ] dip new-resizable [ ] keep ; inline -GENERIC# new-sequence-cursor 1 ( begin end exemplar -- cursor result ) ; +GENERIC#: new-sequence-cursor 1 ( begin end exemplar -- cursor result ) ; M: random-access-cursor new-sequence-cursor [ swap cursor-distance ] dip new-sequence [ begin-cursor ] keep ; inline diff --git a/core/alien/strings/strings.factor b/core/alien/strings/strings.factor index 310606e7b3..14bc119cb8 100644 --- a/core/alien/strings/strings.factor +++ b/core/alien/strings/strings.factor @@ -7,7 +7,7 @@ namespaces sequences sequences.private strings strings.private system system.private ; in: alien.strings -GENERIC# alien>string 1 ( c-ptr encoding -- string/f ) ; +GENERIC#: alien>string 1 ( c-ptr encoding -- string/f ) ; M: c-ptr alien>string [ ] [ ] bi* @@ -24,7 +24,7 @@ ERROR: invalid-c-string string ; : check-string ( string -- ) 0 over member-eq? [ invalid-c-string ] [ drop ] if ; -GENERIC# string>alien 1 ( string encoding -- byte-array ) ; +GENERIC#: string>alien 1 ( string encoding -- byte-array ) ; M: c-ptr string>alien drop ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index d5e3ac071c..2b489aec23 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -24,7 +24,7 @@ in: bootstrap.syntax "ERROR:" "FORGET:" "forget:" - "GENERIC#" + "GENERIC#:" "GENERIC:" "HOOK:" "H{" diff --git a/core/classes/mixin/mixin.factor b/core/classes/mixin/mixin.factor index 350c3f4c86..b35a36bae0 100644 --- a/core/classes/mixin/mixin.factor +++ b/core/classes/mixin/mixin.factor @@ -68,7 +68,7 @@ PRIVATE< PRIVATE> -GENERIC# add-mixin-instance 1 ( class mixin -- ) ; +GENERIC#: add-mixin-instance 1 ( class mixin -- ) ; M: class add-mixin-instance [ 2drop ] [ (add-mixin-instance) ] if-mixin-member? ; diff --git a/core/classes/tuple/parser/parser.factor b/core/classes/tuple/parser/parser.factor index 9c2cd5db16..d3479876aa 100644 --- a/core/classes/tuple/parser/parser.factor +++ b/core/classes/tuple/parser/parser.factor @@ -91,7 +91,7 @@ ERROR: bad-slot-name class slot ; : parse-slot-values ( class slots -- values ) [ (parse-slot-values) ] { } make ; -GENERIC# boa>object 1 ( class slots -- tuple ) ; +GENERIC#: boa>object 1 ( class slots -- tuple ) ; M: tuple-class boa>object swap slots>tuple ; diff --git a/core/classes/tuple/tuple-tests.factor b/core/classes/tuple/tuple-tests.factor index 2ddb6e6bea..fec38c4c87 100644 --- a/core/classes/tuple/tuple-tests.factor +++ b/core/classes/tuple/tuple-tests.factor @@ -139,8 +139,8 @@ M: integer forget-robustness-generic ; ] with-compilation-unit ! rapido found this one -GENERIC# m1 0 ( s n -- n ) ; -GENERIC# m2 1 ( s n -- v ) ; +GENERIC#: m1 0 ( s n -- n ) ; +GENERIC#: m2 1 ( s n -- v ) ; TUPLE: t1 ; diff --git a/core/classes/tuple/tuple.factor b/core/classes/tuple/tuple.factor index fc637e03b4..03c224bb52 100644 --- a/core/classes/tuple/tuple.factor +++ b/core/classes/tuple/tuple.factor @@ -277,7 +277,7 @@ M: tuple-class update-class dup final-class? [ bad-superclass ] when dup class? [ bad-superclass ] unless drop ; -GENERIC# (define-tuple-class) 2 ( class superclass slots -- ) ; +GENERIC#: (define-tuple-class) 2 ( class superclass slots -- ) ; : thrower-effect ( slots -- effect ) [ name>> ] map { "*" } ; diff --git a/core/delegate/delegate-tests.factor b/core/delegate/delegate-tests.factor index 6d57b9f6c5..47ffae4286 100644 --- a/core/delegate/delegate-tests.factor +++ b/core/delegate/delegate-tests.factor @@ -12,7 +12,7 @@ C: goodbye ; GENERIC: foo ( x -- y ) ; GENERIC: bar ( a -- b ) ; -GENERIC# whoa 1 ( s t -- w ) ; +GENERIC#: whoa 1 ( s t -- w ) ; PROTOCOL: baz foo { bar 0 } { whoa 1 } ; : hello-test ( hello/goodbye -- array ) diff --git a/core/delegate/delegate.factor b/core/delegate/delegate.factor index 5a87555b00..6330a40a77 100644 --- a/core/delegate/delegate.factor +++ b/core/delegate/delegate.factor @@ -62,7 +62,7 @@ PREDICATE: consult-method < method M: consult-method reset-word [ call-next-method ] [ f "consultation" set-word-prop ] bi ; -GENERIC# (consult-method-quot) 2 ( consultation quot word -- object ) ; +GENERIC#: (consult-method-quot) 2 ( consultation quot word -- object ) ; M: consultation (consult-method-quot) '[ _ call _ execute ] nip ; diff --git a/core/generic/generic-docs.factor b/core/generic/generic-docs.factor index 59324d0217..811700c45e 100644 --- a/core/generic/generic-docs.factor +++ b/core/generic/generic-docs.factor @@ -61,7 +61,7 @@ ARTICLE: "method-combination" "Custom method combination" "A table of built-in method combination defining words, and the method combinations themselves:" { $table { { $link postpone\ GENERIC: } { $link standard-combination } } - { { $link postpone\ GENERIC# } { $link standard-combination } } + { { $link postpone\ GENERIC#: } { $link standard-combination } } { { $link postpone\ HOOK: } { $link hook-combination } } { { $link postpone\ MATH: } { $link math-combination } } } @@ -93,7 +93,7 @@ $nl "Generic words which dispatch on the object at the top of the stack:" { $subsections postpone\ GENERIC: } "A method combination which dispatches on a specified stack position:" -{ $subsections postpone\ GENERIC# } +{ $subsections postpone\ GENERIC#: } "A method combination which dispatches on the value of a variable at the time the generic word is called:" { $subsections postpone\ HOOK: } "A method combination which dispatches on a pair of stack values, which must be numbers, and upgrades both to the same type of number:" @@ -114,7 +114,7 @@ about: "generic" HELP: generic { $class-description "The class of generic words, documented in " { $link "generic" } "." } ; -{ generic define-generic define-simple-generic postpone\ GENERIC: postpone\ GENERIC# postpone\ MATH: postpone\ HOOK: } related-words +{ generic define-generic define-simple-generic postpone\ GENERIC: postpone\ GENERIC#: postpone\ MATH: postpone\ HOOK: } related-words HELP: make-generic { $values { "word" generic } } diff --git a/core/generic/generic.factor b/core/generic/generic.factor index 4945ac806e..9218cc8e7f 100644 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -186,7 +186,7 @@ M: method forget* [ call-next-method ] bi ] if ; -GENERIC# check-combination-effect 1 ( combination effect -- ) ; +GENERIC#: check-combination-effect 1 ( combination effect -- ) ; M: object check-combination-effect 2drop ; diff --git a/core/generic/standard/standard-docs.factor b/core/generic/standard/standard-docs.factor index c45facff8e..9768fb872c 100644 --- a/core/generic/standard/standard-docs.factor +++ b/core/generic/standard/standard-docs.factor @@ -10,7 +10,7 @@ HELP: standard-combination { $examples "A generic word for append strings and characters to a sequence, dispatching on the object underneath the top of the stack:" { $code - "GENERIC# build-string 1 ( elt str -- )" + "GENERIC#: build-string 1 ( elt str -- )" "M: string build-string swap push-all ;" "M: integer build-string push ;" } diff --git a/core/generic/standard/standard-tests.factor b/core/generic/standard/standard-tests.factor index 168667a3e5..b60ed9093a 100644 --- a/core/generic/standard/standard-tests.factor +++ b/core/generic/standard/standard-tests.factor @@ -194,7 +194,7 @@ M: byte-array small-lo-tag drop "byte-array" ; ] must-fail { } [ "in: generic.standard.tests GENERIC: unhappy ( x -- x ) ;" eval( -- ) ] unit-test -GENERIC# complex-combination 1 ( a b -- c ) ; +GENERIC#: complex-combination 1 ( a b -- c ) ; M: string complex-combination drop ; M: object complex-combination nip ; @@ -368,13 +368,13 @@ M: c funky* "c" , call-next-method ; [ "in: generic.standard.tests GENERIC: broken-generic ( -- ) ;" eval( -- ) ] [ error>> bad-dispatch-position? ] must-fail-with -[ "in: generic.standard.tests GENERIC# broken-generic# -1 ( a -- b ) ;" eval( -- ) ] +[ "in: generic.standard.tests GENERIC#: broken-generic# -1 ( a -- b ) ;" eval( -- ) ] [ error>> bad-dispatch-position? ] must-fail-with -[ "in: generic.standard.tests GENERIC# broken-generic# 1 ( a -- b ) ;" eval( -- ) ] +[ "in: generic.standard.tests GENERIC#: broken-generic# 1 ( a -- b ) ;" eval( -- ) ] [ error>> bad-dispatch-position? ] must-fail-with -[ "in: generic.standard.tests GENERIC# broken-generic# 2/3 ( a b c -- ) ;" eval( -- ) ] +[ "in: generic.standard.tests GENERIC#: broken-generic# 2/3 ( a b c -- ) ;" eval( -- ) ] [ error>> bad-dispatch-position? ] must-fail-with diff --git a/core/generic/standard/standard.factor b/core/generic/standard/standard.factor index fb5794ad52..227363b88f 100644 --- a/core/generic/standard/standard.factor +++ b/core/generic/standard/standard.factor @@ -63,6 +63,6 @@ M: standard-combination inline-cache-quots M: standard-combination mega-cache-quot combination get #>> make-empty-cache \ mega-cache-lookup [ ] 4sequence ; -M: standard-generic definer drop \ GENERIC# f ; +M: standard-generic definer drop \ GENERIC#: f ; M: simple-generic definer drop \ GENERIC: f ; diff --git a/core/io/encodings/encodings.factor b/core/io/encodings/encodings.factor index 24ec3a7238..6bcbac40ed 100644 --- a/core/io/encodings/encodings.factor +++ b/core/io/encodings/encodings.factor @@ -205,7 +205,7 @@ INSTANCE: encoder plain-writer ; PRIVATE> -GENERIC# re-encode 1 ( stream encoding -- newstream ) ; +GENERIC#: re-encode 1 ( stream encoding -- newstream ) ; M: object re-encode ; @@ -218,7 +218,7 @@ M: encoder re-encode [ stream>> ] dip re-encode ; [ [ output-stream get ] dip re-encode ] dip with-output-stream* ; inline -GENERIC# re-decode 1 ( stream encoding -- newstream ) ; +GENERIC#: re-decode 1 ( stream encoding -- newstream ) ; M: object re-decode ; diff --git a/core/io/encodings/utf16/utf16.factor b/core/io/encodings/utf16/utf16.factor index 98f5c9848d..2f10637616 100644 --- a/core/io/encodings/utf16/utf16.factor +++ b/core/io/encodings/utf16/utf16.factor @@ -114,7 +114,7 @@ M: utf16le encode-char ( char stream encoding -- ) : ascii-string>utf16be ( string stream -- ) [ 1 swap ascii-string>utf16-byte-array ] dip stream-write ; inline -GENERIC# encode-string-utf16le 1 ( string stream -- ) ; +GENERIC#: encode-string-utf16le 1 ( string stream -- ) ; M: object encode-string-utf16le [ char>utf16le ] curry each ; inline @@ -126,7 +126,7 @@ M: string encode-string-utf16le M: utf16le encode-string drop encode-string-utf16le ; -GENERIC# encode-string-utf16be 1 ( string stream -- ) ; +GENERIC#: encode-string-utf16be 1 ( string stream -- ) ; M: object encode-string-utf16be [ char>utf16be ] curry each ; inline diff --git a/core/io/encodings/utf8/utf8.factor b/core/io/encodings/utf8/utf8.factor index d2139ddabb..a4923a25b3 100644 --- a/core/io/encodings/utf8/utf8.factor +++ b/core/io/encodings/utf8/utf8.factor @@ -84,7 +84,7 @@ M: utf8 decode-until (decode-until) ; M: utf8 encode-char drop char>utf8 ; -GENERIC# encode-string-utf8 1 ( string stream -- ) ; +GENERIC#: encode-string-utf8 1 ( string stream -- ) ; M: object encode-string-utf8 [ char>utf8 ] curry each ; inline diff --git a/core/locals/locals-tests.factor b/core/locals/locals-tests.factor index e0ecd4bce2..8245ac3e41 100644 --- a/core/locals/locals-tests.factor +++ b/core/locals/locals-tests.factor @@ -103,7 +103,7 @@ write-test-2 "q" set GENERIC: lambda-generic ( a b -- c ) ; -GENERIC# lambda-generic-1 1 ( a b -- c ) ; +GENERIC#: lambda-generic-1 1 ( a b -- c ) ; M:: integer lambda-generic-1 ( a b -- c ) a b * ; @@ -112,7 +112,7 @@ M:: string lambda-generic-1 ( a b -- c ) M:: integer lambda-generic ( a b -- c ) a b lambda-generic-1 ; -GENERIC# lambda-generic-2 1 ( a b -- c ) ; +GENERIC#: lambda-generic-2 1 ( a b -- c ) ; M:: integer lambda-generic-2 ( a b -- c ) a char: x b lambda-generic ; diff --git a/core/math/math.factor b/core/math/math.factor index cfdbb0a8e3..0838ec9bff 100644 --- a/core/math/math.factor +++ b/core/math/math.factor @@ -119,9 +119,9 @@ MATH: /mod ( x y -- z w ) ; foldable MATH: bitand ( x y -- z ) ; foldable MATH: bitor ( x y -- z ) ; foldable MATH: bitxor ( x y -- z ) ; foldable -GENERIC# shift 1 ( x n -- y ) ; foldable +GENERIC#: shift 1 ( x n -- y ) ; foldable GENERIC: bitnot ( x -- y ) ; foldable -GENERIC# bit? 1 ( x n -- ? ) ; foldable +GENERIC#: bit? 1 ( x n -- ? ) ; foldable GENERIC: abs ( x -- y ) ; foldable diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 7e64f3991e..c451f26093 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -464,7 +464,7 @@ M: fixnum (positive>dec) PRIVATE> -GENERIC# >base 1 ( n radix -- str ) ; +GENERIC#: >base 1 ( n radix -- str ) ; : number>string ( n -- str ) 10 >base ; inline diff --git a/core/modern/compiler/compiler.factor b/core/modern/compiler/compiler.factor index 3a45ae018f..8e2d9f731e 100644 --- a/core/modern/compiler/compiler.factor +++ b/core/modern/compiler/compiler.factor @@ -233,7 +233,7 @@ ERROR: word-not-found word ; word-not-found ] if ; -GENERIC# lookup-literal 1 ( literal namespace -- obj ) ; +GENERIC#: lookup-literal 1 ( literal namespace -- obj ) ; M: tag-literal lookup-literal [ tag>> ] dip lookup-in-namespace ; diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index c5ed236719..988668e699 100644 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -438,7 +438,7 @@ defer: foo { "in: parser.tests" "USING: math arrays kernel ;" - "GENERIC# change-combination 1 ( obj a -- b )" + "GENERIC#: change-combination 1 ( obj a -- b )" "M: integer change-combination 2drop 1 ;" "M: array change-combination 2drop 2 ;" } "\n" join "change-combination-test" parse-stream drop diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 7bdd880feb..f3dfd1ec1e 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -51,7 +51,7 @@ M: sequence shorten 2dup length < [ set-length ] [ 2drop ] if ; inline ERROR: bounds-error index seq ; -GENERIC# bounds-check? 1 ( n seq -- ? ) ; +GENERIC#: bounds-check? 1 ( n seq -- ? ) ; M: integer bounds-check? ( n seq -- ? ) dupd length < [ 0 >= ] [ drop f ] if ; inline diff --git a/core/slots/slots.factor b/core/slots/slots.factor index b9ee0863ff..e3cfb47497 100644 --- a/core/slots/slots.factor +++ b/core/slots/slots.factor @@ -33,7 +33,7 @@ PREDICATE: writer-method < method "writing" word-prop >boolean ; [ 2drop make-inline ] 3tri ; -GENERIC# reader-quot 1 ( class slot-spec -- quot ) ; +GENERIC#: reader-quot 1 ( class slot-spec -- quot ) ; M: object reader-quot nip [ @@ -87,7 +87,7 @@ M: object instance-check-quot \ unless , ] [ ] make ; -GENERIC# writer-quot 1 ( class slot-spec -- quot ) ; +GENERIC#: writer-quot 1 ( class slot-spec -- quot ) ; M: object writer-quot nip diff --git a/core/syntax/attributes/attributes.factor b/core/syntax/attributes/attributes.factor index b6024e3326..6b86e8579b 100644 --- a/core/syntax/attributes/attributes.factor +++ b/core/syntax/attributes/attributes.factor @@ -20,7 +20,7 @@ ARITY: \ INSTANCE: 2 ARITY: \ GENERIC: 2 ARITY: \ PRIMITIVE: 2 -ARITY: \ GENERIC# 3 +ARITY: \ GENERIC#: 3 ARITY: \ HOOK: 3 LEFT-DECORATOR: \ inline diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 5531fb46b3..f092d3e9d2 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -669,14 +669,14 @@ HELP: \ GENERIC: { $values { "word" "a new word to define" } } { $description "Defines a new generic word in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." } ; -HELP: \ GENERIC# -{ $syntax "GENERIC# word n ( stack -- effect )" } +HELP: \ GENERIC#: +{ $syntax "GENERIC#: word n ( stack -- effect )" } { $values { "word" "a new word to define" } { "n" "the stack position to dispatch on" } } { $description "Defines a new generic word which dispatches on the " { $snippet "n" } "th most element from the top of the stack in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." } { $notes "The following two definitions are equivalent:" { $code "GENERIC: foo ( obj -- ) ;" } - { $code "GENERIC# foo 0 ( obj -- ) ;" } + { $code "GENERIC#: foo 0 ( obj -- ) ;" } } ; HELP: \ MATH: diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 990ec84a87..0f6de42078 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -214,7 +214,7 @@ in: bootstrap.syntax [ simple-combination ] (GENERIC:) ] define-core-syntax - "GENERIC#" [ + "GENERIC#:" [ [ scan-number ] (GENERIC:) ] define-core-syntax diff --git a/demos/project-euler/215/215.factor b/demos/project-euler/215/215.factor index d5a056a1ff..786fdf9a41 100644 --- a/demos/project-euler/215/215.factor +++ b/demos/project-euler/215/215.factor @@ -42,8 +42,8 @@ C: end ; [ [ two>> ] [ three>> ] bi ] 2dip bi* ; inline GENERIC: merge ( t t -- t ) ; -GENERIC# block-merge 1 ( t t -- t ) ; -GENERIC# end-merge 1 ( t t -- t ) ; +GENERIC#: block-merge 1 ( t t -- t ) ; +GENERIC#: end-merge 1 ( t t -- t ) ; M: block merge block-merge ; M: end merge end-merge ; M: block block-merge [ [ two>> ] bi@ merge ] diff --git a/ffi/mongodb/driver/driver.factor b/ffi/mongodb/driver/driver.factor index beb4f4a30d..438d03db08 100644 --- a/ffi/mongodb/driver/driver.factor +++ b/ffi/mongodb/driver/driver.factor @@ -214,7 +214,7 @@ PRIVATE> : key-spec ( spec-quot -- spec-assoc ) output>array >hashtable ; inline -GENERIC# hint 1 ( mdb-query-msg index-hint -- mdb-query-msg ) ; +GENERIC#: hint 1 ( mdb-query-msg index-hint -- mdb-query-msg ) ; M: mdb-query-msg hint >>hint ; diff --git a/ffi/unix/linux/proc/proc.factor b/ffi/unix/linux/proc/proc.factor index 5af35d43ce..557baa329c 100644 --- a/ffi/unix/linux/proc/proc.factor +++ b/ffi/unix/linux/proc/proc.factor @@ -278,7 +278,7 @@ TUPLE: proc-uptime up idle ; ! /proc/pid/* -GENERIC# proc-pid-path 1 ( object string -- path ) ; +GENERIC#: proc-pid-path 1 ( object string -- path ) ; M: integer proc-pid-path ( pid string -- path ) [ "/proc/" ] 2dip diff --git a/frameworks/db/db.factor b/frameworks/db/db.factor index 358024127a..6bbf2866bd 100644 --- a/frameworks/db/db.factor +++ b/frameworks/db/db.factor @@ -41,8 +41,8 @@ TUPLE: result-set sql in-params out-params handle n max ; GENERIC: query-results ( query -- result-set ) ; GENERIC: #rows ( result-set -- n ) ; GENERIC: #columns ( result-set -- n ) ; -GENERIC# row-column 1 ( result-set column -- obj ) ; -GENERIC# row-column-typed 1 ( result-set column -- sql ) ; +GENERIC#: row-column 1 ( result-set column -- obj ) ; +GENERIC#: row-column-typed 1 ( result-set column -- sql ) ; GENERIC: advance-row ( result-set -- ) ; GENERIC: more-rows? ( result-set -- ? ) ; diff --git a/frameworks/game/loop/loop.factor b/frameworks/game/loop/loop.factor index 98a03acd2f..8aefaea3ac 100755 --- a/frameworks/game/loop/loop.factor +++ b/frameworks/game/loop/loop.factor @@ -38,7 +38,7 @@ PRIVATE< [ draw-timer>> iteration-start-nanos>> nano-count swap - ] [ tick-interval-nanos>> ] bi /f 1.0 min ; -GENERIC# record-benchmarking 1 ( loop quot -- ) ; +GENERIC#: record-benchmarking 1 ( loop quot -- ) ; M: object record-benchmarking call( loop -- ) ; diff --git a/frameworks/game/models/loader/loader.factor b/frameworks/game/models/loader/loader.factor index 36b9eb1fc2..680c8287db 100644 --- a/frameworks/game/models/loader/loader.factor +++ b/frameworks/game/models/loader/loader.factor @@ -26,7 +26,7 @@ types [ H{ } clone ] initialize PRIVATE> -GENERIC# load-models* 2 ( obj encoding class -- models ) ; +GENERIC#: load-models* 2 ( obj encoding class -- models ) ; GENERIC: stream>models ( stream class -- models ) ; diff --git a/frameworks/gpu/framebuffers/framebuffers.factor b/frameworks/gpu/framebuffers/framebuffers.factor index 45834ec13a..6cb731158b 100644 --- a/frameworks/gpu/framebuffers/framebuffers.factor +++ b/frameworks/gpu/framebuffers/framebuffers.factor @@ -141,7 +141,7 @@ GENERIC: framebuffer-handle ( framebuffer -- handle ) ; M: system-framebuffer framebuffer-handle drop 0 ; M: framebuffer framebuffer-handle handle>> ; -GENERIC# allocate-framebuffer-attachment 1 ( framebuffer-attachment dim -- ) ; +GENERIC#: allocate-framebuffer-attachment 1 ( framebuffer-attachment dim -- ) ; M: texture-attachment allocate-framebuffer-attachment [ [ texture>> ] [ level>> ] bi ] dip f allocate-texture ; diff --git a/frameworks/gpu/render/render.factor b/frameworks/gpu/render/render.factor index db3cce44b3..fa27dc2f56 100755 --- a/frameworks/gpu/render/render.factor +++ b/frameworks/gpu/render/render.factor @@ -139,7 +139,7 @@ PRIVATE< GENERIC: render-vertex-indexes ( primitive-mode vertex-indexes -- ) ; -GENERIC# render-vertex-indexes-instanced 1 ( primitive-mode vertex-indexes instances -- ) ; +GENERIC#: render-vertex-indexes-instanced 1 ( primitive-mode vertex-indexes instances -- ) ; GENERIC: gl-array-element-type ( array -- type ) ; M: uchar-array gl-array-element-type drop GL_UNSIGNED_BYTE ; inline @@ -264,14 +264,14 @@ GENERIC: >uniform-int-array ( sequence -- c-array ) ; GENERIC: >uniform-uint-array ( sequence -- c-array ) ; GENERIC: >uniform-float-array ( sequence -- c-array ) ; -GENERIC# >uniform-bvec-array 1 ( sequence dim -- c-array ) ; -GENERIC# >uniform-ivec-array 1 ( sequence dim -- c-array ) ; -GENERIC# >uniform-uvec-array 1 ( sequence dim -- c-array ) ; -GENERIC# >uniform-vec-array 1 ( sequence dim -- c-array ) ; +GENERIC#: >uniform-bvec-array 1 ( sequence dim -- c-array ) ; +GENERIC#: >uniform-ivec-array 1 ( sequence dim -- c-array ) ; +GENERIC#: >uniform-uvec-array 1 ( sequence dim -- c-array ) ; +GENERIC#: >uniform-vec-array 1 ( sequence dim -- c-array ) ; -GENERIC# >uniform-matrix 2 ( sequence cols rows -- c-array ) ; +GENERIC#: >uniform-matrix 2 ( sequence cols rows -- c-array ) ; -GENERIC# >uniform-matrix-array 2 ( sequence cols rows -- c-array ) ; +GENERIC#: >uniform-matrix-array 2 ( sequence cols rows -- c-array ) ; GENERIC: bind-uniform-bvec2 ( index sequence -- ) ; GENERIC: bind-uniform-bvec3 ( index sequence -- ) ; diff --git a/frameworks/gpu/textures/textures.factor b/frameworks/gpu/textures/textures.factor index a0db3115fd..197d5c35d6 100644 --- a/frameworks/gpu/textures/textures.factor +++ b/frameworks/gpu/textures/textures.factor @@ -203,7 +203,7 @@ M: cube-map-face texture-data-gl-target PRIVATE> -GENERIC# allocate-texture 3 ( tdt level dim data -- ) ; +GENERIC#: allocate-texture 3 ( tdt level dim data -- ) ; M: texture-1d-data-target allocate-texture ( tdt level dim data -- ) [ ] [ glTexImage1D ] (allocate-texture) ; @@ -214,7 +214,7 @@ M: texture-2d-data-target allocate-texture ( tdt level dim data -- ) M: texture-3d-data-target allocate-texture ( tdt level dim data -- ) [ first3 ] [ glTexImage3D ] (allocate-texture) ; -GENERIC# allocate-compressed-texture 3 ( tdt level dim compressed-data -- ) ; +GENERIC#: allocate-compressed-texture 3 ( tdt level dim compressed-data -- ) ; M: texture-1d-data-target allocate-compressed-texture ( tdt level dim compressed-data -- ) [ ] [ glCompressedTexImage1D ] (allocate-compressed-texture) ; @@ -225,7 +225,7 @@ M: texture-2d-data-target allocate-compressed-texture ( tdt level dim compressed M: texture-3d-data-target allocate-compressed-texture ( tdt level dim compressed-data -- ) [ first3 ] [ glCompressedTexImage3D ] (allocate-compressed-texture) ; -GENERIC# update-texture 4 ( tdt level loc dim data -- ) ; +GENERIC#: update-texture 4 ( tdt level loc dim data -- ) ; M: texture-1d-data-target update-texture ( tdt level loc dim data -- ) [ ] [ glTexSubImage1D ] (update-texture) ; @@ -236,7 +236,7 @@ M: texture-2d-data-target update-texture ( tdt level loc dim data -- ) M: texture-3d-data-target update-texture ( tdt level loc dim data -- ) [ first3 ] [ glTexSubImage3D ] (update-texture) ; -GENERIC# update-compressed-texture 4 ( tdt level loc dim compressed-data -- ) ; +GENERIC#: update-compressed-texture 4 ( tdt level loc dim compressed-data -- ) ; M: texture-1d-data-target update-compressed-texture ( tdt level loc dim compressed-data -- ) [ ] [ glCompressedTexSubImage1D ] (update-compressed-texture) ; @@ -251,7 +251,7 @@ M: texture-3d-data-target update-compressed-texture ( tdt level loc dim compress { [ dim>> ] [ bitmap>> ] [ component-order>> ] [ component-type>> ] } cleave ; inline -GENERIC# texture-dim 1 ( tdt level -- dim ) ; +GENERIC#: texture-dim 1 ( tdt level -- dim ) ; M:: texture-1d-data-target texture-dim ( tdt level -- dim ) tdt bind-tdt :> texture diff --git a/frameworks/ui/gadgets/worlds/worlds.factor b/frameworks/ui/gadgets/worlds/worlds.factor index be23d22711..966a3909ea 100644 --- a/frameworks/ui/gadgets/worlds/worlds.factor +++ b/frameworks/ui/gadgets/worlds/worlds.factor @@ -129,7 +129,7 @@ M: world request-focus-on ( child gadget -- ) [ T{ rgba f 0.0 0.0 0.0 0.0 } ] [ T{ rgba f 1.0 1.0 1.0 1.0 } ] if ; -GENERIC# apply-world-attributes 1 ( world attributes -- world ) ; +GENERIC#: apply-world-attributes 1 ( world attributes -- world ) ; M: world apply-world-attributes { diff --git a/frameworks/ui/pixel-formats/pixel-formats.factor b/frameworks/ui/pixel-formats/pixel-formats.factor index d0f1f28831..17048e7332 100644 --- a/frameworks/ui/pixel-formats/pixel-formats.factor +++ b/frameworks/ui/pixel-formats/pixel-formats.factor @@ -90,4 +90,4 @@ PRIVATE> GENERIC: world-pixel-format-attributes ( world -- attributes ) ; -GENERIC# check-world-pixel-format 1 ( world pixel-format -- ) ; +GENERIC#: check-world-pixel-format 1 ( world pixel-format -- ) ; diff --git a/frameworks/ui/tools/listener/completion/completion.factor b/frameworks/ui/tools/listener/completion/completion.factor index f9f1862585..f983be5152 100644 --- a/frameworks/ui/tools/listener/completion/completion.factor +++ b/frameworks/ui/tools/listener/completion/completion.factor @@ -126,7 +126,7 @@ M: object completion-string present ; M: method completion-string method-completion-string ; -GENERIC# accept-completion-hook 1 ( item popup -- ) ; +GENERIC#: accept-completion-hook 1 ( item popup -- ) ; : insert-completion ( item popup -- ) [ completion-string ] [ completion-loc/doc/elt ] bi* set-elt-string ; diff --git a/frameworks/ui/traverse/traverse.factor b/frameworks/ui/traverse/traverse.factor index 480a4e119a..9b0907bf5f 100644 --- a/frameworks/ui/traverse/traverse.factor +++ b/frameworks/ui/traverse/traverse.factor @@ -89,7 +89,7 @@ M: node gadget-text* : gadget-at-path ( parent path -- gadget ) [ swap nth-gadget ] each ; -GENERIC# leaves* 1 ( tree set -- ) ; +GENERIC#: leaves* 1 ( tree set -- ) ; M: node leaves* [ children>> ] dip leaves* ; diff --git a/language/compiler/cfg/gc-checks/gc-checks.factor b/language/compiler/cfg/gc-checks/gc-checks.factor index fe1b7b3922..f6c2643d64 100644 --- a/language/compiler/cfg/gc-checks/gc-checks.factor +++ b/language/compiler/cfg/gc-checks/gc-checks.factor @@ -16,7 +16,7 @@ PRIVATE< : blocks-with-gc ( cfg -- bbs ) post-order [ insert-gc-check? ] filter ; -GENERIC# gc-check-offsets* 1 ( call-index seen-allocation? insn n -- call-index seen-allocation? ) ; +GENERIC#: gc-check-offsets* 1 ( call-index seen-allocation? insn n -- call-index seen-allocation? ) ; :: gc-check-here ( call-index seen-allocation? insn insn-index -- call-index seen-allocation? ) seen-allocation? [ call-index , ] when diff --git a/language/compiler/cfg/intrinsics/simd/backend/backend.factor b/language/compiler/cfg/intrinsics/simd/backend/backend.factor index 7a551eb895..5318ee081a 100644 --- a/language/compiler/cfg/intrinsics/simd/backend/backend.factor +++ b/language/compiler/cfg/intrinsics/simd/backend/backend.factor @@ -71,7 +71,7 @@ M: ##horizontal-shr-vector-imm insn-available? rep>> %horizontal-shr-vector-imm- : [vector-op-checked] ( #dup quot -- quot ) '[ _ ndup [ @ ] { } make dup [ insn-available? ] all? ] ; -GENERIC# >vector-op-cond 2 ( quot #pick #dup -- quotpair ) ; +GENERIC#: >vector-op-cond 2 ( quot #pick #dup -- quotpair ) ; M:: callable >vector-op-cond ( quot #pick #dup -- quotpair ) #dup quot [vector-op-checked] '[ 2drop @ ] #dup '[ % _ nnip ] diff --git a/language/compiler/cfg/representations/coalescing/coalescing.factor b/language/compiler/cfg/representations/coalescing/coalescing.factor index 34b8246cee..3bd37d3e9f 100644 --- a/language/compiler/cfg/representations/coalescing/coalescing.factor +++ b/language/compiler/cfg/representations/coalescing/coalescing.factor @@ -16,7 +16,7 @@ symbol: components ] each ] simple-analysis ; -GENERIC# visit-insn 1 ( insn disjoint-set -- ) ; +GENERIC#: visit-insn 1 ( insn disjoint-set -- ) ; M: ##copy visit-insn [ [ dst>> ] [ src>> ] bi ] dip equate ; diff --git a/language/compiler/cfg/stacks/height/height.factor b/language/compiler/cfg/stacks/height/height.factor index db456bc636..3d06dda151 100644 --- a/language/compiler/cfg/stacks/height/height.factor +++ b/language/compiler/cfg/stacks/height/height.factor @@ -6,7 +6,7 @@ in: compiler.cfg.stacks.height : record-stack-heights ( ds-height rs-height bb -- ) [ rs-height<< ] keep ds-height<< ; -GENERIC# untranslate-loc 1 ( loc bb -- loc' ) ; +GENERIC#: untranslate-loc 1 ( loc bb -- loc' ) ; M: ds-loc untranslate-loc ( loc bb -- loc' ) [ n>> ] [ ds-height>> ] bi* + ; diff --git a/language/compiler/tests/redefine16.factor b/language/compiler/tests/redefine16.factor index ad2ecf19a9..48b929f79e 100644 --- a/language/compiler/tests/redefine16.factor +++ b/language/compiler/tests/redefine16.factor @@ -4,8 +4,8 @@ in: compiler.tests.redefine16 [ ] [ [ "blah" "compiler.tests.redefine16" lookup-word forget ] with-compilation-unit ] unit-test -[ ] [ "in: compiler.tests.redefine16 GENERIC# blah 2 ( foo bar baz -- ) ;" eval( -- ) ] unit-test +[ ] [ "in: compiler.tests.redefine16 GENERIC#: blah 2 ( foo bar baz -- ) ;" eval( -- ) ] unit-test [ ] [ "in: compiler.tests.redefine16 USING: strings math arrays prettyprint ; M: string blah 1 + 3array . ;" eval( -- ) ] unit-test -[ ] [ "in: compiler.tests.redefine16 GENERIC# blah 2 ( foo bar baz -- x ) ;" eval( -- ) ] unit-test +[ ] [ "in: compiler.tests.redefine16 GENERIC#: blah 2 ( foo bar baz -- x ) ;" eval( -- ) ] unit-test [ ] [ [ "blah" "compiler.tests.redefine16" lookup-word forget ] with-compilation-unit ] unit-test diff --git a/language/cpu/arm/assembler/assembler.factor b/language/cpu/arm/assembler/assembler.factor index 53b9ee995e..8bd595a2d7 100644 --- a/language/cpu/arm/assembler/assembler.factor +++ b/language/cpu/arm/assembler/assembler.factor @@ -84,7 +84,7 @@ PRIVATE< : insn ( bitspec -- ) bitfield (insn) ; inline ! Branching instructions -GENERIC# (B) 1 ( target l -- ) ; +GENERIC#: (B) 1 ( target l -- ) ; M: integer (B) { 24 { 1 25 } { 0 26 } { 1 27 } 0 } insn ; @@ -109,7 +109,7 @@ PRIVATE< : sinsn ( bitspec -- ) bitfield S> [ 20 2^ bitor ] when (insn) ; inline -GENERIC# shift-imm/reg 2 ( shift-imm/Rs Rm shift -- n ) ; +GENERIC#: shift-imm/reg 2 ( shift-imm/Rs Rm shift -- n ) ; M: integer shift-imm/reg ( shift-imm Rm shift -- n ) { { 0 4 } 5 { register 0 } 7 } bitfield ; @@ -294,7 +294,7 @@ symbol: have-BLX? PRIVATE< -GENERIC# (BX) 1 ( Rm l -- ) ; +GENERIC#: (BX) 1 ( Rm l -- ) ; M: register-class (BX) ( Rm l -- ) { diff --git a/language/cpu/x86/assembler/assembler.factor b/language/cpu/x86/assembler/assembler.factor index c010e847a0..036782c55f 100644 --- a/language/cpu/x86/assembler/assembler.factor +++ b/language/cpu/x86/assembler/assembler.factor @@ -61,7 +61,7 @@ M: indirect modifier M: register modifier drop 0b11 ; -GENERIC# n, 1 ( value n -- ) ; +GENERIC#: n, 1 ( value n -- ) ; M: integer n, >le % ; M: byte n, [ value>> ] dip n, ; @@ -214,7 +214,7 @@ PRIVATE< : maybe-zero-extend ( reg imm -- reg' imm ) dup zero-extendable? [ [ 32-bit-version-of ] dip ] when ; -GENERIC# (MOV-I) 1 ( dst src -- ) ; +GENERIC#: (MOV-I) 1 ( dst src -- ) ; M: register (MOV-I) { @@ -273,7 +273,7 @@ M: operand CALL { 0b010 t 0xff } 1-operand ; PRIVATE< -GENERIC# JUMPcc 1 ( addr opcode -- ) ; +GENERIC#: JUMPcc 1 ( addr opcode -- ) ; M: integer JUMPcc extended-opcode, 4, ; : SETcc ( dst opcode -- ) diff --git a/language/io/files/info/unix/unix.factor b/language/io/files/info/unix/unix.factor index e2928d0cac..3c3a616f7b 100644 --- a/language/io/files/info/unix/unix.factor +++ b/language/io/files/info/unix/unix.factor @@ -111,7 +111,7 @@ PRIVATE< [ dup stat-mode ] 2dip [ bitor ] [ unmask ] if [ chmod ] unix-system-call drop ; -GENERIC# file-mode? 1 ( obj mask -- ? ) ; +GENERIC#: file-mode? 1 ( obj mask -- ? ) ; M: integer file-mode? mask? ; M: string file-mode? [ stat-mode ] dip mask? ; diff --git a/language/io/sockets/sockets.factor b/language/io/sockets/sockets.factor index 9f1ebf644b..f424e5c76c 100644 --- a/language/io/sockets/sockets.factor +++ b/language/io/sockets/sockets.factor @@ -16,7 +16,7 @@ COMPILE< { { [ os unix? ] [ "unix.ffi" ] } } cond use-vocab COMPILE> -GENERIC# with-port 1 ( addrspec port -- addrspec ) ; +GENERIC#: with-port 1 ( addrspec port -- addrspec ) ; ! Addressing PRIVATE< diff --git a/language/io/streams/limited/limited.factor b/language/io/streams/limited/limited.factor index 6e25f1fd3b..b1f3b693f2 100644 --- a/language/io/streams/limited/limited.factor +++ b/language/io/streams/limited/limited.factor @@ -20,7 +20,7 @@ INSTANCE: limited-stream input-stream ; [ drop file-info size>> ] 2bi ; -GENERIC# limit-stream 1 ( stream limit -- stream' ) ; +GENERIC#: limit-stream 1 ( stream limit -- stream' ) ; M: decoder limit-stream ( stream limit -- stream' ) '[ stream>> _ limit-stream ] [ code>> ] [ cr>> ] tri diff --git a/language/monads/monads.factor b/language/monads/monads.factor index b5ea64fe60..2edc960e46 100644 --- a/language/monads/monads.factor +++ b/language/monads/monads.factor @@ -6,9 +6,9 @@ shuffle ; in: monads ! Functors -GENERIC# fmap 1 ( functor quot -- functor' ) ; -GENERIC# <$ 1 ( functor quot -- functor' ) ; -GENERIC# $> 1 ( functor quot -- functor' ) ; +GENERIC#: fmap 1 ( functor quot -- functor' ) ; +GENERIC#: <$ 1 ( functor quot -- functor' ) ; +GENERIC#: $> 1 ( functor quot -- functor' ) ; ! Monads diff --git a/language/variants/variants.factor b/language/variants/variants.factor index 68fb3a0927..84c4e9ad31 100644 --- a/language/variants/variants.factor +++ b/language/variants/variants.factor @@ -55,7 +55,7 @@ SYNTAX: \ VARIANT-MEMBER: MACRO: unboa ( class -- quot ) \ boa [ ] 2sequence [undo] ; -GENERIC# (match-branch) 1 ( class quot -- class quot' ) ; +GENERIC#: (match-branch) 1 ( class quot -- class quot' ) ; M: singleton-class (match-branch) \ drop prefix ; diff --git a/libs/calendar/calendar.factor b/libs/calendar/calendar.factor index 6ed416eddd..2617f262d7 100644 --- a/libs/calendar/calendar.factor +++ b/libs/calendar/calendar.factor @@ -276,7 +276,7 @@ M: number +second ( timestamp n -- timestamp ) PRIVATE> -GENERIC# time+ 1 ( time1 time2 -- time3 ) ; +GENERIC#: time+ 1 ( time1 time2 -- time3 ) ; M: timestamp time+ [ clone ] dip (time+) drop ; diff --git a/libs/concurrency/mailboxes/mailboxes.factor b/libs/concurrency/mailboxes/mailboxes.factor index 77a33ae0be..01f0f8c798 100755 --- a/libs/concurrency/mailboxes/mailboxes.factor +++ b/libs/concurrency/mailboxes/mailboxes.factor @@ -40,7 +40,7 @@ M: mailbox mailbox-put : mailbox-peek ( mailbox -- obj ) data>> peek-back ; -GENERIC# mailbox-get-timeout 1 ( mailbox timeout -- obj ) ; +GENERIC#: mailbox-get-timeout 1 ( mailbox timeout -- obj ) ; M: mailbox mailbox-get-timeout block-if-empty data>> pop-back ; diff --git a/libs/gml/types/types.factor b/libs/gml/types/types.factor index bc17e7a5ea..7b18c33c40 100644 --- a/libs/gml/types/types.factor +++ b/libs/gml/types/types.factor @@ -23,12 +23,12 @@ INSTANCE: proc sequence ; : wrap ( n seq -- n seq ) [ length rem ] keep ; inline -GENERIC# (gml-get) 1 ( collection key -- elt ) ; +GENERIC#: (gml-get) 1 ( collection key -- elt ) ; M: sequence (gml-get) swap wrap nth ; M: hashtable (gml-get) of ; -GENERIC# (gml-put) 2 ( collection key elt -- ) ; +GENERIC#: (gml-put) 2 ( collection key elt -- ) ; M:: sequence (gml-put) ( collection key elt -- ) elt key collection wrap set-nth ; diff --git a/libs/images/loader/loader.factor b/libs/images/loader/loader.factor index 962f70bf8c..364310c215 100644 --- a/libs/images/loader/loader.factor +++ b/libs/images/loader/loader.factor @@ -22,7 +22,7 @@ PRIVATE> ! Image Decode -GENERIC# load-image* 1 ( obj class -- image ) ; +GENERIC#: load-image* 1 ( obj class -- image ) ; GENERIC: stream>image* ( stream class -- image ) ; diff --git a/libs/json/writer/writer.factor b/libs/json/writer/writer.factor index 0c6bb2cbec..f7b85a4fbd 100644 --- a/libs/json/writer/writer.factor +++ b/libs/json/writer/writer.factor @@ -22,7 +22,7 @@ symbol: json-escape-unicode? f json-escape-unicode? set-global ! Writes the object out to a stream in JSON format -GENERIC# stream-json-print 1 ( obj stream -- ) ; +GENERIC#: stream-json-print 1 ( obj stream -- ) ; : json-print ( obj -- ) output-stream get stream-json-print ; diff --git a/libs/math/floats/env/env.factor b/libs/math/floats/env/env.factor index 9aca64a1aa..f33e0f831b 100644 --- a/libs/math/floats/env/env.factor +++ b/libs/math/floats/env/env.factor @@ -67,16 +67,16 @@ HOOK: (fp-env-registers) cpu ( -- registers ) ; GENERIC: (set-fp-env-register) ( fp-env -- ) ; GENERIC: (get-exception-flags) ( fp-env -- exceptions ) ; -GENERIC# (set-exception-flags) 1 ( fp-env exceptions -- fp-env ) ; +GENERIC#: (set-exception-flags) 1 ( fp-env exceptions -- fp-env ) ; GENERIC: (get-fp-traps) ( fp-env -- exceptions ) ; -GENERIC# (set-fp-traps) 1 ( fp-env exceptions -- fp-env ) ; +GENERIC#: (set-fp-traps) 1 ( fp-env exceptions -- fp-env ) ; GENERIC: (get-rounding-mode) ( fp-env -- mode ) ; -GENERIC# (set-rounding-mode) 1 ( fp-env mode -- fp-env ) ; +GENERIC#: (set-rounding-mode) 1 ( fp-env mode -- fp-env ) ; GENERIC: (get-denormal-mode) ( fp-env -- mode ) ; -GENERIC# (set-denormal-mode) 1 ( fp-env mode -- fp-env ) ; +GENERIC#: (set-denormal-mode) 1 ( fp-env mode -- fp-env ) ; : change-fp-env-registers ( quot -- ) (fp-env-registers) swap [ (set-fp-env-register) ] compose each ; inline diff --git a/libs/math/functions/functions.factor b/libs/math/functions/functions.factor index e9a24a0c96..d921cd4f7e 100644 --- a/libs/math/functions/functions.factor +++ b/libs/math/functions/functions.factor @@ -32,7 +32,7 @@ PRIVATE< : (^n) ( z w -- z^w ) dup fixnum? [ (^fixnum) ] [ (^bignum) ] if ; inline -GENERIC# ^n 1 ( z w -- z^w ) ; foldable +GENERIC#: ^n 1 ( z w -- z^w ) ; foldable M: fixnum ^n (^n) ; @@ -168,7 +168,7 @@ M: integer frexp defer: copysign -GENERIC# ldexp 1 ( x exp -- y ) ; +GENERIC#: ldexp 1 ( x exp -- y ) ; M: float ldexp over fp-special? [ over zero? ] unless* [ drop ] [ diff --git a/libs/math/vectors/vectors.factor b/libs/math/vectors/vectors.factor index 80ad647b35..59006243c6 100644 --- a/libs/math/vectors/vectors.factor +++ b/libs/math/vectors/vectors.factor @@ -9,25 +9,25 @@ in: math.vectors GENERIC: vneg ( v -- w ) ; M: object vneg [ neg ] map ; inline -GENERIC# v+n 1 ( v n -- w ) ; +GENERIC#: v+n 1 ( v n -- w ) ; M: object v+n [ + ] curry map ; inline GENERIC: n+v ( n v -- w ) ; M: object n+v [ + ] with map ; inline -GENERIC# v-n 1 ( v n -- w ) ; +GENERIC#: v-n 1 ( v n -- w ) ; M: object v-n [ - ] curry map ; inline GENERIC: n-v ( n v -- w ) ; M: object n-v [ - ] with map ; inline -GENERIC# v*n 1 ( v n -- w ) ; +GENERIC#: v*n 1 ( v n -- w ) ; M: object v*n [ * ] curry map ; inline GENERIC: n*v ( n v -- w ) ; M: object n*v [ * ] with map ; inline -GENERIC# v/n 1 ( v n -- w ) ; +GENERIC#: v/n 1 ( v n -- w ) ; M: object v/n [ / ] curry map ; inline GENERIC: n/v ( n v -- w ) ; @@ -116,31 +116,31 @@ M: object vbitxor [ bitxor ] 2map ; inline GENERIC: vbitnot ( v -- w ) ; M: object vbitnot [ bitnot ] map ; inline -GENERIC# vbroadcast 1 ( u n -- v ) ; +GENERIC#: vbroadcast 1 ( u n -- v ) ; M:: object vbroadcast ( u n -- v ) u length n u nth u like ; inline -GENERIC# vshuffle-elements 1 ( v perm -- w ) ; +GENERIC#: vshuffle-elements 1 ( v perm -- w ) ; M: object vshuffle-elements over length 0 pad-tail swap [ '[ _ nth ] ] keep map-as ; inline -GENERIC# vshuffle2-elements 1 ( u v perm -- w ) ; +GENERIC#: vshuffle2-elements 1 ( u v perm -- w ) ; M: object vshuffle2-elements [ append ] dip vshuffle-elements ; inline -GENERIC# vshuffle-bytes 1 ( v perm -- w ) ; +GENERIC#: vshuffle-bytes 1 ( v perm -- w ) ; GENERIC: vshuffle ( v perm -- w ) ; M: array vshuffle ( v perm -- w ) vshuffle-elements ; inline -GENERIC# vlshift 1 ( v n -- w ) ; +GENERIC#: vlshift 1 ( v n -- w ) ; M: object vlshift '[ _ shift ] map ; inline -GENERIC# vrshift 1 ( v n -- w ) ; +GENERIC#: vrshift 1 ( v n -- w ) ; M: object vrshift neg '[ _ shift ] map ; inline -GENERIC# hlshift 1 ( v n -- w ) ; -GENERIC# hrshift 1 ( v n -- w ) ; +GENERIC#: hlshift 1 ( v n -- w ) ; +GENERIC#: hrshift 1 ( v n -- w ) ; GENERIC: (vmerge-head) ( u v -- h ) ; M: object (vmerge-head) over length 2 /i '[ _ head-slice ] bi@ [ zip ] keep concat-as ; inline diff --git a/libs/random/random.factor b/libs/random/random.factor index bf41d373ea..246acdb80c 100644 --- a/libs/random/random.factor +++ b/libs/random/random.factor @@ -14,7 +14,7 @@ symbol: system-random-generator symbol: secure-random-generator symbol: random-generator -GENERIC# seed-random 1 ( obj seed -- obj ) ; +GENERIC#: seed-random 1 ( obj seed -- obj ) ; GENERIC: random-32* ( obj -- n ) ; GENERIC: random-bytes* ( n obj -- byte-array ) ; @@ -76,7 +76,7 @@ PRIVATE< [ 32 shift obj random-32* + ] [ 32 + ] [ 32 - ] tri* ] while drop [ m * ] [ neg shift ] bi* ; inline -GENERIC# (random-integer) 1 ( m obj -- n ) ; +GENERIC#: (random-integer) 1 ( m obj -- n ) ; M: fixnum (random-integer) ( m obj -- n ) random-integer-loop ; M: bignum (random-integer) ( m obj -- n ) random-integer-loop ; diff --git a/libs/regexp/classes/classes.factor b/libs/regexp/classes/classes.factor index b2c9cc0395..3421c505d0 100644 --- a/libs/regexp/classes/classes.factor +++ b/libs/regexp/classes/classes.factor @@ -274,7 +274,7 @@ M: primitive-class class-member? TUPLE: condition question yes no ; C: condition ; -GENERIC# answer 2 ( class from to -- new-class ) ; +GENERIC#: answer 2 ( class from to -- new-class ) ; M:: object answer ( class from to -- new-class ) class from = to class ? ; @@ -291,7 +291,7 @@ M: or-class answer M: not-class answer [ class>> ] 2dip answer ; -GENERIC# substitute 1 ( class from to -- new-class ) ; +GENERIC#: substitute 1 ( class from to -- new-class ) ; M: object substitute answer ; M: not-class substitute [ ] bi@ answer ; diff --git a/libs/zeromq/zeromq.factor b/libs/zeromq/zeromq.factor index 5d96174a63..0a60130231 100644 --- a/libs/zeromq/zeromq.factor +++ b/libs/zeromq/zeromq.factor @@ -18,8 +18,8 @@ TUPLE: zmq-error n string ; : zmq-version ( -- version ) { int int int } [ zmq_version ] with-out-parameters 3array ; -GENERIC# zmq-setopt 2 ( obj name value -- ) ; -GENERIC# zmq-getopt 1 ( obj name -- value ) ; +GENERIC#: zmq-setopt 2 ( obj name value -- ) ; +GENERIC#: zmq-getopt 1 ( obj name -- value ) ; TUPLE: zmq-message underlying ; diff --git a/tools/graphviz/notation/notation.factor b/tools/graphviz/notation/notation.factor index d0c76aa2ef..419f749c88 100644 --- a/tools/graphviz/notation/notation.factor +++ b/tools/graphviz/notation/notation.factor @@ -11,7 +11,7 @@ COMPILE< PRIVATE< -! GENERIC# =attr 1 ( graphviz-obj val -- graphviz-obj' ) +! GENERIC#: =attr 1 ( graphviz-obj val -- graphviz-obj' ) ! M: edge/node =attr ! present over attributes>> attr<< ; ! M: sub/graph =attr diff --git a/tools/listener/listener.factor b/tools/listener/listener.factor index 90fb908217..6e7edbad14 100644 --- a/tools/listener/listener.factor +++ b/tools/listener/listener.factor @@ -9,7 +9,7 @@ vocabs.parser ; in: listener GENERIC: stream-read-quot ( stream -- quot/f ) ; -GENERIC# prompt. 1 ( stream prompt -- ) ; +GENERIC#: prompt. 1 ( stream prompt -- ) ; : prompt ( -- str ) manifest get current-vocab>> [ name>> "in: " prepend ] [ "" ] if* diff --git a/tools/tools/annotations/annotations.factor b/tools/tools/annotations/annotations.factor index c99fce7dab..f0652055a4 100644 --- a/tools/tools/annotations/annotations.factor +++ b/tools/tools/annotations/annotations.factor @@ -42,7 +42,7 @@ PRIVATE< [ check-annotate-twice ] dip [ dup def>> 2dup "unannotated-def" set-word-prop ] dip ; -GENERIC# (annotate) 1 ( word quot -- ) ; +GENERIC#: (annotate) 1 ( word quot -- ) ; M: generic (annotate) '[ _ (annotate) ] annotate-generic ; @@ -51,7 +51,7 @@ M: word (annotate) prepare-annotate call( old -- new ) define ; -GENERIC# (deep-annotate) 1 ( word quot -- ) ; +GENERIC#: (deep-annotate) 1 ( word quot -- ) ; M: generic (deep-annotate) '[ _ (deep-annotate) ] annotate-generic ; diff --git a/tools/tools/crossref/crossref.factor b/tools/tools/crossref/crossref.factor index 35c49ff2db..0625817186 100644 --- a/tools/tools/crossref/crossref.factor +++ b/tools/tools/crossref/crossref.factor @@ -15,7 +15,7 @@ PRIVATE< symbol: visited -GENERIC# quot-uses 1 ( obj set -- ) ; +GENERIC#: quot-uses 1 ( obj set -- ) ; M: object quot-uses 2drop ; diff --git a/tools/tools/dns/dns.factor b/tools/tools/dns/dns.factor index 225bef125b..9e93b8a479 100644 --- a/tools/tools/dns/dns.factor +++ b/tools/tools/dns/dns.factor @@ -34,7 +34,7 @@ in: tools.dns [ dns-AAAA-query aaaa-message. ] [ dns-MX-query mx-message. ] tri ; -GENERIC# dns-host 1 ( servers domain -- ) ; +GENERIC#: dns-host 1 ( servers domain -- ) ; M: sequence dns-host ( servers domain -- ) '[ _ host ] with-dns-servers ; diff --git a/unmaintained/ui/gadgets/layout/layout.factor b/unmaintained/ui/gadgets/layout/layout.factor index cbb356ea83..bbfdbb5f85 100644 --- a/unmaintained/ui/gadgets/layout/layout.factor +++ b/unmaintained/ui/gadgets/layout/layout.factor @@ -66,11 +66,11 @@ GENERIC: >layout ( gadget -- layout ) M: gadget >layout f ; M: layout >layout ; -GENERIC# (add-gadget-at) 2 ( parent item n -- ) +GENERIC#: (add-gadget-at) 2 ( parent item n -- ) M: gadget (add-gadget-at) -rot [ add-gadget ] keep insert-gadget ; M: track (add-gadget-at) -rot >layout [ add-layout ] keep [ gadget>> insert-gadget ] [ size>> insert-size ] 3bi ; -GENERIC# add-gadget-at 1 ( item location -- ) +GENERIC#: add-gadget-at 1 ( item location -- ) M: object add-gadget-at insertion-point -rot (add-gadget-at) ; M: model add-gadget-at parent>> dup book:book? [ "No models in books" throw ] [ dup model>> dup collection? [ nip swap add-connection ] [ drop [ 1array ] dip model<< ] if ] if ;