Paste: Specializers with effect syntax in multi-methods

Author: dharmatech
Mode: factor
Date: Mon, 24 Nov 2008 16:28:27
Plain Text |
USING: parser ;

IN: multi-methods

: scan-specializer ( -- specializer )

  scan drop ! eat opening parenthesis

  ")" parse-effect in>> [ search ] map ;

: CREATE-METHOD ( -- method )
  scan-word scan-specializer swap create-method-in ;

Allows for specializers with traditional effect syntax:

METHOD: add ( a b -- c ) ... ;

New Annotation

Summary:
Author:
Mode:
Body: