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 via email to