[Xapian-discuss] Indexing & Querying multiple fields

Olly Betts olly at survex.com
Tue Feb 6 02:02:03 GMT 2007


On Mon, Jan 29, 2007 at 04:59:53PM +0000, James Aylett wrote:
> On Tue, Jan 16, 2007 at 10:14:37PM +0000, Olly Betts wrote:
> 
> > You put spaces in this line:
> > 
> >   $setmap{prefix, username, XU}
> > 
> > This should read:
> > 
> >   $setmap{prefix,username,XU}
> > 
> > Perhaps that's seems overly fussy, but it's at least consistent with
> > how OmegaScript works in general.
> 
> My feeling is that for parameter lists we should probably allow spaces
> where it makes sense

I think I'd prefer the rule to be consistent - either leading and
trailing spaces are always removed from a parameter or they aren't.
If we do it "where it makes sense" we have to decide what makes
sense for each command, I think the result will be that users are
more likely to be suprised (this is the first time I'm aware of anyone
hitting this issue after all).

If such spaces are removed (i.e. we change the current behaviour) and
you really want them, you can use an empty comment (${}) to preserve
such spaces by writing something like:

    $setmap{charnames, space, ${} ${}}

It wouldn't be too hard to change this in a compatible way - we could
add a command to specify the version of the language the template is
written in (e.g. $omegascriptversion{1.0}) and support older templates.

I've wondered before about changes we could make to improve readability
of OmegaScript code.  For HTML it's not too bad as extra whitespace is
generally not an issue so you can insert it in many places.  But if
you're producing a format where it matters it's more of a pain.

Perhaps I should try reformatting the current templates how they could
were we to make this change...

> Either that, or omegascript.txt should make it more explicit in the
> first sentence or so, where it mentions parameter lists :-)

I can't actually find any mention of "parameter lists", but we certainly
could be more explicit about this.  The introduction could be improved
in other ways too.  I'll work on it a bit.

Cheers,
    Olly



More information about the Xapian-discuss mailing list