On Tue, Mar 11, 2003 at 05:35:34PM -0800, Dave Whipp wrote:
: 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.

To answer your actual question, you either need to have some keyword out
front to start the alternate parsing, or you need to treat ".select"
as an infix macro that has an ordinary expression on the left ($db) and
a specially parsed argument on the right (* FROM Foo WHERE Foo.bar LIKE a%b)

Larry

Reply via email to