(index ("multi-methods" 0) ("define-multi-method" 190) ("multi-method-insert!" 388) ("multi-method?" 2088) ("multi-method-empty?" 2175) ("multi-method-variadic?" 2288) ("multi-method-arity" 2408) ("multi-method-keys" 2539) ("multi-method-tree" 2761) ("nlambda" 2992) ("tag" 3144) ("get-tag" 3276) ("tagged-procedure?" 3375))
(def (sig (procedure "(multi-methods [sym])" (id multi-methods))) (p "documentation procedure. Prints the list of exported symbols if called without an argument, or the signature of sym."))
(def (sig (syntax "(define-multi-method (name . vars))" (id define-multi-method))) (p "constructor. Creates an empty multi-method, whose variadicity is determined by the signature (name . vars)."))
(def (sig (syntax "(multi-method-insert! multi procs key ...)" (id multi-method-insert!))) (p "updates multi's proc-tree at the appropriate argument level. For example, if no key (or a non-existent key) is given, procs is iserted at the very end. If one key is given, procs is inserted before that very key, provided, that key doesn't match multi's and procs' first predicate name. In that latter case, one recurs with appropriate subtrees. Keys are the tags of (possibly compound) type predicates, which are generated automatically from procs by means of internal macros pass and pass*.") (p "procs must be of one of the following forms") (highlight scheme ";; variadic, not unary\n(proc-name ((a a? a1? ...)\n            (b b? b1? ...)\n            ... : (cs cs? cs1? ...))\n           xpr . xprs)\n\n;; variadic unary\n(proc-name (as as? as1? ...) xpr . xprs)\n\n;; not variadic\n(proc-name ((a a? a1? ...) (b b? b1? ...) ...)\n           xpr . xprs)") (p "Note the colon to mark the variadic argument.") (p "Note also, that a variadic argument mustn't be empty, otherwise, there is nothing to dispatch on.") (p "These expressions generate procedures proc-name") (highlight scheme "(lambda (a b ... . cs) xpr . xprs)\n\n(lambda as xpr . xprs)\n\n(lambda (a b ...) xpr . xprs)") (p "respectively, check their arguments, for example a fixed argument") (pre "a by (conjoin a? a1?  ...) named 'a?a1?...") (p "and a variadic argument") (pre "cs by (conjoin (list-of? cs?) (list-of? cs1?) ...)") (p "named 'list-of-cs?list-of-cs1? ...") (p "Instead of variables, the predicates can also be nlambda expressions. In any case, the tagging of the compound predicates is done completely behind the scene."))
(def (sig (procedure "(multi-method? xpr)" (id multi-method?))) (p "type predicate."))
(def (sig (procedure "(multi-method-empty? xpr)" (id multi-method-empty?))) (p "is xpr an empty multi-method?"))
(def (sig (procedure "(multi-method-variadic? xpr)" (id multi-method-variadic?))) (p "is xpr a varidic multi-method?"))
(def (sig (procedure "(multi-method-arity multi)" (id multi-method-arity))) (p "returns the arity ot its multi-method argument."))
(def (sig (procedure "(multi-method-keys multi key ...)" (id multi-method-keys))) (p "Inspect multi's tree vertically.") (p "Returns the list of predicate tags for checking nth argument, fullfilling key0 ... key(- n 1)"))
(def (sig (procedure "(multi-method-tree multi key ...)" (id multi-method-tree))) (p "Inspect multi's tree horizontally.") (p "With no key returns the whole tree of tags, with one key the subtree corresponding to key and so on."))
(def (sig (syntax "(nlambda name args xpr . xprs)" (id nlambda))) (p "named lambda which can refer to name in its body and which is tagged by 'name."))
(def (sig (syntax "(tag proc [sym])" (id tag))) (p "tags a procedure variable with its own name or a lambda expression with sym."))
(def (sig (procedure "(get-tag proc)" (id get-tag))) (p "returns the tag of a tagged procedure."))
(def (sig (procedure "(tagged-procedure? xpr)" (id tagged-procedure?))) (p "is xpr a tagged procedure?"))
