The effect of a macro is lexical; but "the name may be installed in either a package or a lexical scope". If the name is installed in a class, can it be invoked via a variable of that class?

Example (SQL query integrated via macro):

  my Database $db = MySqlDatabase.connect(...);
  $db.select * FROM Foo WHERE Foo.bar LIKE a%b;

Could I implement this with the select function being a macro on the Database base class: but invoked via the $db invocant? I am aware that the macro would be a compile-time operation: but it could resolve into a run-time mechanism that uses the invocant.


Dave. -- http://dave.whipp.name



Reply via email to