On Oct 7, 2014, at 7:41 PM, Aristedes Maniatis <[email protected]> wrote:

>>> 
>>> Can't we parse without any ambiguity:
>>> 
>>>   exp("artist.dateOfBirth < $date", c.getTime());
>> 
>> In case of a single parameter you are right. Good point! 
> 
> In the case of multiple parameters could we just as easily pass parameters in 
> order for a cleaner syntax?
> 
>    exp("artist.dateOfBirth < $date and artist.name = $name", c.getTime(), 
> "adam");
> 
> There are lots of APIs that follow this approach right back to the C printf 
> function.

Hmm, we need to somehow avoid confusing named parameters with positional 
parameters. EJBQL (JPA-inspired) has separate notation for named and positional 
(not that it is particularly smart .. to me their positional is really named , 
just that the name is a number .. am I wrong?). But I guess in this context we 
can treat named as positional, ignoring the name (so e.g. if the same var name 
repeats twice, we'd require 2 separate args for the binding). So you are right 
again :)

Andrus

Reply via email to