cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Crafter <>
Subject Re: [C2 & patch] Re: Matchers and Selectors (was Re: Better and Betterand RT)
Date Mon, 13 Nov 2000 20:55:22 GMT
On Sun, 12 Nov 2000, Giacomo Pati wrote:

> Marcus Crafter wrote:
> > 
> > On Thu, 9 Nov 2000, Giacomo Pati wrote:
> Maybe it's better to get rid of trying to derive names from the pattern
> and generate pure names with generate-id().

	Might be better solution. With generate-id(.) we're guaranteed of
	getting unique variables anyway.

> >         I also though about implementing 'greater than' and 'less than'
> >         operators too. Over time I would like to expand the set of operators
> >         to include many varied tests. ie:
> Why not. But keep in mind your operators are used by admin people not by
> programmers (and with admin people i don't meant sys admins :). So
> please keep it as simple and understandable as possible.
> You can use an "is" instead of "=" (good old COBOL is comming back :])

	I understand, although as a developer I tend to like 'eq' instead of
	'is' like Raphael suggested. What do you think ?

	I see a lot of power in creating a boolean logic evaluation engine
	which could be used from a parameter selector, a session selector, a
	context selector, etc, in fact any kind of selector that can provide
	a context to operate in (ie. lookup between variable names and values)
	and a string to evaluate. It would provide for a lot of flexibility in
	the sitemap.

	I'm itching to write such a thing, even if it is a little overkill! :-)

	We could please both developers and admins with the operator names ?

	I thought about the following operator set:

	Programmer style      Quasi-English style
	==                    eq
	!=                    ne
	<                     lt
	>                     gt
	<=                    le
	>=                    ge
	&&                    and
	||                    or
	!                     not

	and even for the perl dudes:

	=~                    matches (?)

	with the ability to nest expressions using parentheses ().

	Any others that I'm missing ?

	Implementation wise, my intention was to base the logic evaluator on
	the Interpreter and Composite patterns, perhaps in combination with
	the Visitor and Flyweight patterns where appropriate.

	I thought about also using jlex/cups to build up the logics AST easily.

	Any suggestions, I'd be interested in peoples comments ?


     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email :
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:           After Hours    : +49 69 49086750

View raw message