just as it is black magic for me now :D

At least I get the general feeling. I am new to parsing too, so far I have only played with regex parsing. Not the most smalltalkish way but it works well so far.

On Tue, Sep 23, 2014 at 9:39 AM, Udo Schneider <udo.schneider@homeaddress.de> wrote:
Hi Estaban,

I think the first time I saw this pattern was in ReStore on Dolphin Smalltalk. I didn't understand it's implementation back then. I assume that it's similar to what I described though. But having a Smalltalk block automagically creating the equivalent SQL SELECT expression was like black magic at that time :-)

CU,

Udo




On 23.09.14 04:15, Esteban A. Maringolo wrote:
Excellent article.

I think GLORP uses a similar technique to setup its expressions, and
also have issues with #and:/#or: selectors due to inlining, so it uses
AND:/#OR: instead.

Regards!

Esteban A. Maringolo

pd: Your blog and it's choosen topic made me remember
http://use-the-index-luke.com/

2014-09-22 20:48 GMT-03:00 Udo Schneider <udo.schneider@homeaddress.de>:

All,

I just finished a blog entry. It shows how to use Smalltalk blocks as parsers/translators. E.g. translating a Block

�� �� �� �� ��[:customer | (customer joinDate year is: Date today year)]

into an SQL-like String

�� �� �� �� ��(YEAR(customers.joinDate) = 2014)

The SQL stuff is just an example - you can create nearly any output.

Check out http://readthesourceluke.blogspot.de/2014/09/block-translators-parsing-magic.html

Maybe that's old stuff for some of you - but I hope it's interesting for some at least :-)

Comments and feedback appreciated.

CU,

Udo