diff --git a/extra/multi-method-syntax/multi-method-syntax.factor b/extra/multi-method-syntax/multi-method-syntax.factor new file mode 100644 index 0000000000..9f05525f23 --- /dev/null +++ b/extra/multi-method-syntax/multi-method-syntax.factor @@ -0,0 +1,23 @@ + +USING: accessors effects.parser kernel lexer multi-methods + parser sequences words ; + +IN: multi-method-syntax + +! A nicer specializer syntax to hold us over till multi-methods go in +! officially. +! +! Use both 'multi-methods' and 'multi-method-syntax' in that order. + +: scan-specializer ( -- specializer ) + + scan drop ! eat opening parenthesis + + ")" parse-effect in>> [ search ] map ; + +: CREATE-METHOD ( -- method ) + scan-word scan-specializer swap create-method-in ; + +: (METHOD:) ( -- method def ) CREATE-METHOD parse-definition ; + +: METHOD: (METHOD:) define ; parsing \ No newline at end of file