Denis Koroskin wrote:
On Wed, 25 Nov 2009 11:42:53 +0300, Don <nos...@nospam.com> wrote:
Don wrote:
aarti_pl wrote:
Don pisze:
Additionally in my framework you can pass around parts of SQL e.g. :
WhereExpression exp = Where(More(visitcards.id, 100));
You basically *CAN NOT* do it when just using strings.
Of course you can define a where clause using strings.
Even today, it's easy to take a CTFE/string mixin front-end and create
a wrapper over your framework! So it's trivially easy to prove it can
be done. You can literally do anything. Functionality is not the
problem -- the challenge is to make it nice. The CTFE/mixin combo is
not nice, but it definitely has the power.
I'm thinking something like:
auto result = SQL{ SELECT * FROM :localvar WHERE name LIKE 'abc*' AND
price > 300 ORDER BY date DESC }
where SQL is a DSL macro, and the {} are delimiters indicating that
it's a DSL, not normal D code. That's a syntax which is currently
available.
Interesting! Then q{ Foo } syntax would be just a simple macro that
returns a string, not a built-in language construct.
Yup.
I'm just brainstorming, though.