On 2013-12-04 12:33, Sebastian wrote:
Hi,

I'm highly interested in ruta, and its potential applications in industrial
applications. Right know I'm trying to create a simple toy condition
extension that is simply a case insensitive INLIST condition. It is
completely based on the InListCondition class, I also declared an
implementation of the IRutaConditionExtension interface.

With primitve types everything seems to work great, except when the
condition is used with a variable :

STRINGLIST MonthsList = {"january", ...};
DECLARE Month;
ANY{INSENSITIVEINLIST(MonthsList) -> MARK(Month)};

I get a class cast exception when the condition is being created, because
MonthsList is a SimpleTypeExpression and I'm expecting a StringListExpression.

Am I doing something wrong ? I suppose there is a way to resolve the
variable to the actual list, but I missed it somehow.
It may not help you to get your toy extension working, but for small lists I like to use regular expressions where case insensitiveness is free:

W{REGEXP("(?i)january|february|march|...|december") -> MARK(Month)}

Regards,

Alexandre

--
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com

Reply via email to