[SVN ci] MMD 39 - builtin MMDs as methods

0 views
Skip to first unread message

Leopold Toetsch

unread,
May 2, 2005, 4:28:43 AM5/2/05
to Perl 6 Internals
This snippet:

.local pmc cl, l, r, d
cl = subclass "Integer", "AInt"
l = new "AInt"
r = new "AInt"
d = l."__add"(r) # d = n_add l, r

now works as expected.

These infix methods always return a new destination PMC so that the
function signature matches an HLLs signature for infix operations.

l."__add"(r, d) # wrong, d is ignored

The inplace variant is:

l."__i_add"(r) # l += r

leo

Reply all
Reply to author
Forward
0 new messages