You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Bend NSExpression syntax to accomodate Studio expression syntax #11053
The NSExpression-based property value implementation in #10726 relies in large part on an existing NSExpression format string syntax. Studio is planning to use its own abstraction atop the style specification’s expression language, powered by expression-jamsession. Both syntaxes are more or less inspired by spreadsheet formula syntax, but there are some subtle differences. We should explore having -[NSExpression(MGLAdditions) mgl_jsonExpressionObject] interpret the format string more loosely to accommodate differences that may easily lead to confusion. For example:
min() and max() take a single array literal argument in NSExpression but a series of arguments in expression-jamsession.
Accessing a feature’s attribute entails a key path expression in NSExpression but a call to get() in expression-jamsession.
Concatenating strings currently requires a call to stringByAppendingString: (but soon mgl_join()) in NSExpression but the & operator in expression-jamsession. Per Reimplement MGLStyleValue atop NSExpression #8074 (comment), we can overload the bitwiseAnd:with: function for this purpose.
Also, for forwards compatibility, we can add a freeform custom function that takes a style specification–flavored expression array, to be used whenever we encounter an operator that doesn’t readily translate to NSExpression syntax.
We ended up shipping v4.0.0 without these compatibility shims. We won’t be able to add them for v4.0.1, but we remain open to adding them in the future based on developer feedback.
Also, for forwards compatibility, we can add a freeform custom function that takes a style specification–flavored expression array, to be used whenever we encounter an operator that doesn’t readily translate to NSExpression syntax.
#11472 added an MGL_FUNCTION() function (from the department of redundancy department) that can represent any style specification–flavored array.
Activity
1ec5 commentedon Jan 25, 2018
Placing this issue on the v4.0.0 milestone to investigate, without necessarily committing to implementing this feature.
1ec5 commentedon Jan 26, 2018
Also, for forwards compatibility, we can add a freeform custom function that takes a style specification–flavored expression array, to be used whenever we encounter an operator that doesn’t readily translate to NSExpression syntax.
1ec5 commentedon May 8, 2018
We ended up shipping v4.0.0 without these compatibility shims. We won’t be able to add them for v4.0.1, but we remain open to adding them in the future based on developer feedback.
#11472 added an
MGL_FUNCTION()function (from the department of redundancy department) that can represent any style specification–flavored array.1ec5 commentedon Jun 21, 2018
We aren’t adding these compatibility shims in the near future, but we’re open to reconsidering in the future based on developer feedback.