User Tools

Site Tools


at:tutorial:reflection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:reflection [2007/10/25 19:09] – slot tvcutsemat:tutorial:reflection [2008/08/01 14:42] – * tvcutsem
Line 23: Line 23:
 >def inspectable := object: {  >def inspectable := object: { 
  def map(arg1, @restArgs) { restArgs.map(arg1); } };  def map(arg1, @restArgs) { restArgs.map(arg1); } };
->><object:4927258>+>><obj:{super,super:=,map}>
 >def mirrorOnInspectable := reflect: inspectable; >def mirrorOnInspectable := reflect: inspectable;
->><mirror on:<object:4927258>>+>><mirror on:<obj:{super,super:=,map}>>
 >mirrorOnInspectable.listFields() >mirrorOnInspectable.listFields()
 >>[<field:super>] >>[<field:super>]
Line 52: Line 52:
 >def runTest(obj) { >def runTest(obj) {
    retainTestMethods(obj).each: { | meth |     retainTestMethods(obj).each: { | meth | 
-     (reflect: obj).invoke(obj, meth.name, []) } };+     (reflect: obj).invoke(obj, `(.#(meth.name)())) } };
 >><closure:runTest> >><closure:runTest>
 >runTest(object: {def testOne() { system.println(`ok) } }); >runTest(object: {def testOne() { system.println(`ok) } });
at/tutorial/reflection.txt · Last modified: 2010/11/16 16:32 by tvcutsem