On 07/26/2011 09:51 AM, Malcolm Herring wrote:
> On 25/07/2011 19:41, Paul Hartmann wrote:
>>
>> I'd call it a missing feature. There is no != or =~ operator for eval
>> expressions [1]. You can work around the first limitation like this:
>>
> I was not using it within an eval expression, but with the result:
> 
> eval(prop(someproperty))=somevalue works as expected.
> eval(prop(someproperty))!=somevalue causes a parsing error.

'eval' is a function that does nothing, so
[eval(prop(someproperty)=somevalue)],
[eval(prop(someproperty))=somevalue] and [prop(someproperty)=somevalue)]
is pretty much the same in JOSM. However, a simple
[{key}{operator}{value}] conditions is treated special (mostly for
efficiency reasons).

> Of course, if 'set' were implemented, I would not be using eval in
> selectors in the first place. As Komяpa pointed out, this is not kosher
> MapCSS.
> 
> So should I submit a bug ticket for something that should not be there,
> or a feature request ticket for implementation of 'set'?

An != operator for eval expressions should definitely be there. Whether
you use it within selectors is your own choice.

Anyway, would be good to have 'set' implemented, as well. I still don't
know what it does exactly, though. E.g. can you write something like this?

*[religion][religion!=christian][religion!=jewish] {
  set religion="INT-generic";
}

way[landuse=cemetery][religion="INT-generic"] {...}

This would be similar to how Mapnik manipulates the tags in a data base
query.

Paul

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to