#!/usr/bin/env python
import coral

p=coral.lang.CoralEx10.BrowsablePackage()
o=coral.lang.CoralEx10.Operation()

o.name="doSomething"
o.body="def doSomething(self,a,b): print self,a,b; return a+b"

p.ownedElement.insert(o)

print "p.doSomething=",
print p.doSomething
print p.doSomething.__call__
print "calling it..."
print "method 1"
p.doSomething.__invoke__(1,2)
print "method 2"
p.doSomething(1,2)
assert(p.doSomething(1,2)==3)
