[CVS ci] MMD 8 - dispatch on argument count

0 views
Skip to first unread message

Leopold Toetsch

unread,
Mar 30, 2005, 6:12:54 AM3/30/05
to Perl 6 Internals
In the following snippet (from t/pmc/mmd.t) the two function calls
dispatch to the correct subroutine:

.namespace ["main"]
.sub main @MAIN
p("ok 1\n")
p("-twice", "ok 2\n")
.end

.namespace [""]
.sub p @MULTI(string)
...
.sub p @MULTI(string, string)

* the two multi subs "p" in the same namespace cause the creation of a
MultiSub PMC with the name "p"
* the two multi subs get a mangled (long name) entry in the globals:
"p_@STRING" and "p_@STRING_@STRING"

Have fun,
leo

Reply all
Reply to author
Forward
0 new messages