> The sugar I'm using here is to go from
>
>$db.do_sql("select * from Foo");
> to
>$db.select * from Foo;
Since we're fishing, call it a circumfix operator, something like
sql...execute.
Like this:
$db.sql select * from Foo;
execute;
_
Brent Dax wrote:
Dave Whipp:
# But you're right, there are situations where the (base) type
# might not
# be knowable: and these could result in syntax errors.
Except they wouldn't, at least not always.
[snip]
The only part of that I'm not sure about is infix:LIKE, since such an
operator hasn't
Dave Whipp:
# But you're right, there are situations where the (base) type
# might not
# be knowable: and these could result in syntax errors.
Except they wouldn't, at least not always.
$db.select * FROM Foo WHERE Foo.bar LIKE a%b;
$db.select() *
FROM(
Luke Palmer wrote:
I'm not quite sure I follow you (I'm not familiar with that pattern).
But the macromethod I imagine is the non-polymorphic one, and the one
it expands to is the polymorphic one, if I'm guessing correctly. And
you certianly could do that.
yes: http://patterndigest.com/patterns/Te
On Wed, Mar 12, 2003 at 03:35:58PM -0800, Dave Whipp wrote:
: Larry Wall replied:
: >: my Database $db = MySqlDatabase.connect(...);
: >: $db.select * FROM Foo WHERE Foo.bar LIKE a%b;
:
: >To answer your actual question, you either need to have some keyword out
: >front to start the alternate
> Luke Palmer wrote:
>
> > Well, if you did that, it surely couldn't be polymorphic, which kind
> > of defeats most of the purpose of making it a method.
>
> I disagree. Consider the "template method" patten. This uses a
> non-polymorphic method in a base class to invoke a set of polymorphic
>
Luke Palmer wrote:
Well, if you did that, it surely couldn't be polymorphic, which kind
of defeats most of the purpose of making it a method.
I disagree. Consider the "template method" patten. This uses a
non-polymorphic method in a base class to invoke a set of polymorphic
methods in a standar
Dave Whipp wrote:
> (OK, thats not a good example, but you get the gist). If sure it would
> be possible to write the macro in such a way that it looks at its LHS
> arg -- and ignores itself if its not a Database object ... but that
> places an overly large burden on the macro writer. To avoid
Larry Wall replied:
: my Database $db = MySqlDatabase.connect(...);
: $db.select * FROM Foo WHERE Foo.bar LIKE a%b;
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 ordina
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 m
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 m
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 *
12 matches
Mail list logo