diff --git a/basis/compiler/cfg/builder/builder-tests.factor b/basis/compiler/cfg/builder/builder-tests.factor index 93cbabe0d4..74aef68a70 100644 --- a/basis/compiler/cfg/builder/builder-tests.factor +++ b/basis/compiler/cfg/builder/builder-tests.factor @@ -227,7 +227,7 @@ IN: compiler.cfg.builder.tests ] when ! Regression. Make sure everything is inlined correctly -{ f } [ M\ hashtable set-at [ { [ ##call? ] [ word>> \ set-slot eq? ] } 1&& ] contains-insn? ] unit-test +{ f } [ m: { hashtable set-at } [ { [ ##call? ] [ word>> \ set-slot eq? ] } 1&& ] contains-insn? ] unit-test ! Regression. Make sure branch splitting works. { 2 } [ [ 1 2 ? ] [ ##return? ] count-insns ] unit-test diff --git a/basis/compiler/tests/optimizer.factor b/basis/compiler/tests/optimizer.factor index b8f38110bf..c379cf834a 100644 --- a/basis/compiler/tests/optimizer.factor +++ b/basis/compiler/tests/optimizer.factor @@ -12,7 +12,7 @@ IN: compiler.tests.optimizer GENERIC: xyz ( obj -- obj ) M: array xyz xyz ; -[ t ] [ M\ array xyz word-optimized? ] unit-test +[ t ] [ m: { array xyz } word-optimized? ] unit-test ! Test predicate inlining : pred-test-1 ( a -- b c ) diff --git a/basis/compiler/tests/redefine14.factor b/basis/compiler/tests/redefine14.factor index a72db4833c..ce99d8327e 100644 --- a/basis/compiler/tests/redefine14.factor +++ b/basis/compiler/tests/redefine14.factor @@ -5,4 +5,4 @@ TUPLE: bad ; M: bad length 1 2 3 ; -[ ] [ [ M\ bad length forget ] with-compilation-unit ] unit-test +[ ] [ [ m: { bad length } forget ] with-compilation-unit ] unit-test diff --git a/basis/compiler/tests/simple.factor b/basis/compiler/tests/simple.factor index 1847c1a33d..20104b0fe3 100644 --- a/basis/compiler/tests/simple.factor +++ b/basis/compiler/tests/simple.factor @@ -252,7 +252,7 @@ M: quotation bad-effect-test call ; inline [ bad-effect-test* ] [ not-compiled? ] must-fail-with ! Don't want compiler error to stick around -[ ] [ [ M\ quotation bad-effect-test forget ] with-compilation-unit ] unit-test +[ ] [ [ m: { quotation bad-effect-test } forget ] with-compilation-unit ] unit-test ! Make sure time bombs literalize [ [ \ + call ] compile-call ] [ no-method? ] must-fail-with diff --git a/basis/compiler/tree/propagation/transforms/transforms.factor b/basis/compiler/tree/propagation/transforms/transforms.factor index 75f9de07e3..eaea72ebec 100644 --- a/basis/compiler/tree/propagation/transforms/transforms.factor +++ b/basis/compiler/tree/propagation/transforms/transforms.factor @@ -302,17 +302,17 @@ CONSTANT: lookup-table-at-max 256 : diff-quot ( seq -- quot: ( seq' -- seq'' ) ) [ tester ] keep '[ members [ @ ] reject _ set-like ] ; -M\ sets:set diff [ diff-quot ] 1 define-partial-eval +m: { sets:set diff } [ diff-quot ] 1 define-partial-eval : intersect-quot ( seq -- quot: ( seq' -- seq'' ) ) [ tester ] keep '[ members _ filter _ set-like ] ; -M\ sets:set intersect [ intersect-quot ] 1 define-partial-eval +m: { sets:set intersect } [ intersect-quot ] 1 define-partial-eval : intersects?-quot ( seq -- quot: ( seq' -- seq'' ) ) tester '[ members _ any? ] ; -M\ sets:set intersects? [ intersects?-quot ] 1 define-partial-eval +m: { sets:set intersects? } [ intersects?-quot ] 1 define-partial-eval : bit-quot ( #call -- quot/f ) in-d>> second value-info interval>> 0 fixnum-bits [a,b] interval-subset? diff --git a/basis/hints/hints-tests.factor b/basis/hints/hints-tests.factor index 940edf6f0a..067bab3296 100644 --- a/basis/hints/hints-tests.factor +++ b/basis/hints/hints-tests.factor @@ -7,6 +7,6 @@ GENERIC: blahblah ( a b c -- ) M: hashtable blahblah 2nip [ 1 + ] change-count drop ; -HINTS: M\ hashtable blahblah { object fixnum object } { object word object } ; +HINTS: m: { hashtable blahblah } { object fixnum object } { object word object } ; -{ t } [ M\ hashtable blahblah { count>> count<< } inlined? ] unit-test +{ t } [ m: { hashtable blahblah } { count>> count<< } inlined? ] unit-test diff --git a/basis/hints/hints.factor b/basis/hints/hints.factor index ea6a432756..063157e019 100644 --- a/basis/hints/hints.factor +++ b/basis/hints/hints.factor @@ -135,10 +135,10 @@ set-specializer \ base> { string fixnum } set-specializer -M\ hashtable at* +m: { hashtable at* } { { fixnum object } { word object } } set-specializer -M\ hashtable set-at +m: { hashtable set-at } { { object fixnum object } { object word object } } set-specializer diff --git a/basis/locals/locals-tests.factor b/basis/locals/locals-tests.factor index 355b7fa054..0d217e6f00 100644 --- a/basis/locals/locals-tests.factor +++ b/basis/locals/locals-tests.factor @@ -383,7 +383,7 @@ GENERIC: lambda-method-forget-test ( a -- b ) M:: integer lambda-method-forget-test ( a -- b ) a ; -{ } [ [ M\ integer lambda-method-forget-test forget ] with-compilation-unit ] unit-test +{ } [ [ m: { integer lambda-method-forget-test } forget ] with-compilation-unit ] unit-test { 10 } [ 10 |[ A | { [ A ] } ] call first call ] unit-test diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index c5d498bb97..29fec32de5 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -61,8 +61,10 @@ M: word pprint* M: method pprint* ; : pprint-prefixed-number ( n quot: ( n -- n' ) pre -- ) diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 9887171a50..168632d548 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -287,7 +287,7 @@ GENERIC: generic-see-test-with-f ( obj -- obj ) M: f generic-see-test-with-f ; { "USING: prettyprint.tests ;\nM: f generic-see-test-with-f ;\n" } [ - [ M\ f generic-see-test-with-f see ] with-string-writer + [ m: { f generic-see-test-with-f } see ] with-string-writer ] unit-test PREDICATE: predicate-see-test < integer even? ; @@ -314,7 +314,7 @@ GENERIC: ended-up-ballin' ( a -- b ) M: started-out-hustlin' ended-up-ballin' ; inline { "USING: prettyprint.tests ;\nM: started-out-hustlin' ended-up-ballin' ; inline\n" } [ - [ M\ started-out-hustlin' ended-up-ballin' see ] with-string-writer + [ m: { started-out-hustlin' ended-up-ballin' } see ] with-string-writer ] unit-test TUPLE: tuple-with-declared-slot { x integer } ; @@ -400,13 +400,13 @@ TUPLE: bob a b ; TUPLE: har a ; GENERIC: harhar ( obj -- obj ) M: maybe{ har } harhar ; -M: integer harhar M\ integer harhar drop ; +M: integer harhar m: { integer harhar } drop ; { "USING: prettyprint.tests ; M: maybe{ har } harhar ; USING: kernel math prettyprint.tests ; -M: integer harhar M\\ integer harhar drop ;\n" +M: integer harhar m: { integer harhar } drop ;\n" } [ [ \ harhar see-methods ] with-string-writer ] unit-test diff --git a/basis/random/unix/unix.factor b/basis/random/unix/unix.factor index ffddde9f5b..3390ae2ed0 100644 --- a/basis/random/unix/unix.factor +++ b/basis/random/unix/unix.factor @@ -14,7 +14,7 @@ M: unix-random dispose reader>> dispose ; M: unix-random random-bytes* ( n tuple -- byte-array ) reader>> stream-read ; -HINTS: M\ unix-random random-bytes* { fixnum unix-random } ; +HINTS: m: { unix-random random-bytes* } { fixnum unix-random } ; [ "/dev/random" &dispose secure-random-generator set-global diff --git a/basis/tools/annotations/annotations-tests.factor b/basis/tools/annotations/annotations-tests.factor index 77fa6bf989..ff476b28ee 100644 --- a/basis/tools/annotations/annotations-tests.factor +++ b/basis/tools/annotations/annotations-tests.factor @@ -47,7 +47,7 @@ GENERIC: blah-generic ( a -- b ) M: string blah-generic ; -{ } [ M\ string blah-generic watch ] unit-test +{ } [ m: { string blah-generic } watch ] unit-test { "hi" } [ "hi" blah-generic ] unit-test diff --git a/basis/tools/crossref/crossref-tests.factor b/basis/tools/crossref/crossref-tests.factor index 7b445f1642..8a295bd149 100644 --- a/basis/tools/crossref/crossref-tests.factor +++ b/basis/tools/crossref/crossref-tests.factor @@ -51,7 +51,7 @@ M: sequence generic-forget-test-2 = ; ] unit-test { } [ - [ M\ sequence generic-forget-test-2 forget ] with-compilation-unit + [ m: { sequence generic-forget-test-2 } forget ] with-compilation-unit ] unit-test { f } [ diff --git a/basis/ui/traverse/traverse-tests.factor b/basis/ui/traverse/traverse-tests.factor index b1ff99c08b..33dd92622c 100644 --- a/basis/ui/traverse/traverse-tests.factor +++ b/basis/ui/traverse/traverse-tests.factor @@ -62,4 +62,4 @@ M: object (flatten-tree) , ; { 0 1 } { 2 0 1 } { { "a" "b" "c" "d" } { "e" "f" "g" } { { "h" "i" } "j" } } gadgets-in-range ] unit-test -[ M\ array children>> forget ] with-compilation-unit +[ m: { array children>> } forget ] with-compilation-unit diff --git a/core/classes/intersection/intersection-tests.factor b/core/classes/intersection/intersection-tests.factor index a9bdb71c30..464c11c180 100644 --- a/core/classes/intersection/intersection-tests.factor +++ b/core/classes/intersection/intersection-tests.factor @@ -18,7 +18,7 @@ M: a x drop a ; { a } [ T{ a2 } x ] unit-test { t } [ T{ a3 } c? ] unit-test -{ t } [ T{ a3 } \ x effective-method M\ c x eq? nip ] unit-test +{ t } [ T{ a3 } \ x effective-method m: { c x } eq? nip ] unit-test { c } [ T{ a3 } x ] unit-test ! More complex case diff --git a/core/classes/tuple/tuple-tests.factor b/core/classes/tuple/tuple-tests.factor index 5c9338a6d7..2f6735c472 100644 --- a/core/classes/tuple/tuple-tests.factor +++ b/core/classes/tuple/tuple-tests.factor @@ -133,9 +133,9 @@ M: forget-robustness forget-robustness-generic ; M: integer forget-robustness-generic ; [ - [ ] [ \ forget-robustness-generic forget ] unit-test - [ ] [ \ forget-robustness forget ] unit-test - [ ] [ M\ forget-robustness forget-robustness-generic forget ] unit-test + [ ] [ m: { forget-robustness-generic } forget ] unit-test + [ ] [ m: { forget-robustness } forget ] unit-test + [ ] [ m: { forget-robustness forget-robustness-generic } forget ] unit-test ] with-compilation-unit ! rapido found this one diff --git a/core/generic/generic-docs.factor b/core/generic/generic-docs.factor index 69ac46d1d6..a18f41440b 100644 --- a/core/generic/generic-docs.factor +++ b/core/generic/generic-docs.factor @@ -49,7 +49,7 @@ $nl "Low-level method constructor:" { $subsections } "Methods may be pushed on the stack with a literal syntax:" -{ $subsections postpone: \M\ } +{ $subsections postpone: \m: } { $see-also "see" } ; ARTICLE: "method-combination" "Custom method combination" @@ -126,10 +126,10 @@ HELP: define-generic { $description "Defines a generic word. A method combination is an object which responds to the " { $link perform-combination } " generic word." } { $contract "The method combination quotation is called each time the generic word has to be updated (for example, when a method is added), and thus must be side-effect free." } ; -HELP: M\ -{ $syntax "M\\ class generic" } +HELP: \m: +{ $syntax "m: { class generic }" } { $description "Pushes a method on the stack." } -{ $examples { $code "M\\ fixnum + see" } { $code "USING: ui.gadgets.editors ui.render ;" "M\\ editor draw-gadget* edit" } } ; +{ $examples { $code "m: { fixnum + } see" } { $code "USING: ui.gadgets.editors ui.render ;" "m: { editor draw-gadget* } edit" } } ; HELP: method { $class-description "The class of method bodies, which are words with special word properties set." } ; @@ -177,7 +177,7 @@ HELP: (call-next-method) "The " { $link postpone: call-next-method } " word parses into this word. The following are equivalent:" { $code "M: class generic call-next-method ;" - "M: class generic M\\ class generic (call-next-method) ;" + "M: class generic m: { class generic } (call-next-method) ;" } } ; diff --git a/core/generic/hook/hook-tests.factor b/core/generic/hook/hook-tests.factor index cd28006384..fd9902ec89 100644 --- a/core/generic/hook/hook-tests.factor +++ b/core/generic/hook/hook-tests.factor @@ -27,7 +27,7 @@ M: growable call-next-hooker call-next-method "growable " prepend ; ] unit-test { t } [ - { } \ nth effective-method nip M\ sequence nth eq? + { } \ nth effective-method nip m: { sequence nth } eq? ] unit-test { t } [ diff --git a/core/generic/standard/standard-tests.factor b/core/generic/standard/standard-tests.factor index bc48c2f2bd..1a8d313a86 100644 --- a/core/generic/standard/standard-tests.factor +++ b/core/generic/standard/standard-tests.factor @@ -398,7 +398,7 @@ GENERIC: forget-test ( a -- b ) M: integer forget-test 3 + ; -{ } [ "IN: generic.standard.tests USE: math FORGET: M\\ integer forget-test" eval( -- ) ] unit-test +{ } [ "IN: generic.standard.tests USE: math FORGET: m: { integer forget-test }" eval( -- ) ] unit-test { { } } [ \ + all-dependencies-of keys [ method? ] filter @@ -412,13 +412,13 @@ GENERIC: flushable-generic ( a -- b ) flushable M: integer flushable-generic ; { t } [ \ flushable-generic flushable? ] unit-test -{ t } [ M\ integer flushable-generic flushable? ] unit-test +{ t } [ m: { integer flushable-generic } flushable? ] unit-test GENERIC: non-flushable-generic ( a -- b ) M: integer non-flushable-generic ; flushable { f } [ \ non-flushable-generic flushable? ] unit-test -{ t } [ M\ integer non-flushable-generic flushable? ] unit-test +{ t } [ m: { integer non-flushable-generic } flushable? ] unit-test ! method-for-object, method-for-class, effective-method GENERIC: foozul ( a -- b ) @@ -426,7 +426,7 @@ M: reversed foozul ; M: integer foozul ; M: slice foozul ; -{ } [ reversed \ foozul method-for-class M\ reversed foozul assert= ] unit-test +{ } [ reversed \ foozul method-for-class m: { reversed foozul } assert= ] unit-test { } [ { 1 2 3 } \ foozul method-for-object M\ reversed foozul assert= ] unit-test { } [ { 1 2 3 } \ foozul effective-method M\ reversed foozul assert= drop ] unit-test diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 5adb7ed5fb..3f0a87059d 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -116,6 +116,7 @@ IN: bootstrap.syntax "postpone:" [ scan-syntax-word suffix! ] define-core-syntax "\\" [ scan-word suffix! ] define-core-syntax "M\\" [ scan-word scan-word lookup-method suffix! ] define-core-syntax + "m:" [ scan-object first2 lookup-method suffix! ] define-core-syntax "inline" [ last-word make-inline ] define-core-syntax "recursive" [ last-word make-recursive ] define-core-syntax "foldable" [ last-word make-foldable ] define-core-syntax diff --git a/extra/benchmark/raytracer/raytracer.factor b/extra/benchmark/raytracer/raytracer.factor index d035e92827..7c65f22ac9 100644 --- a/extra/benchmark/raytracer/raytracer.factor +++ b/extra/benchmark/raytracer/raytracer.factor @@ -79,7 +79,7 @@ C: sphere M: sphere intersect-scene ( hit ray sphere -- hit ) [ [ sphere-n normalize ] keep nip ] if-ray-sphere ; -HINTS: M\ sphere intersect-scene { hit ray sphere } ; +HINTS: m: { sphere intersect-scene } { hit ray sphere } ; TUPLE: group < sphere { objs array read-only } ; @@ -92,7 +92,7 @@ TUPLE: group < sphere { objs array read-only } ; M: group intersect-scene ( hit ray group -- hit ) [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ; -HINTS: M\ group intersect-scene { hit ray group } ; +HINTS: m: { group intersect-scene } { hit ray group } ; CONSTANT: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. }