Working with Array Literal

I'm trying to write a function that takes an array literal. (it's a small feature but I'm not sure people realize how awesome it is) and I've managed to figure out that I can call ArrayLiteral.coerce(myliteral).getValues() but how do I map from the long to literal string?

I know there's some mapper out there from writing a propertyFunction but can't remember what it was.

Am I doing this right? Is it MappingDictionary?

MappingDictionary is the right thing. This is definitely getting into internals. What are you trying to do? The coerce() method is used to create an array from a set of value IDs.

I'm writing a custom function that takes an array literal as an argument. I seem to remember being able to get a MappingDictionary from a PropertyFunction but I can't get one from a regular Function. Is there any other way access it?

The ValueSolution has a getDictionary method.

Is there a way to get that from a plain function rather than a property function?

if you inherit AbstractExpression instead of AbstractFunction, the argument will be a ValueSolution. you will be forgoing eval of the arguments so you will need to do this yourself. the argument will be a sequence of Expression instances which you can get ValueOrError from by doing Expression.evaluate(valueSolution).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.