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 has been archived by the owner on Aug 8, 2023. It is now read-only.
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.
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()
andmax()
take a single array literal argument in NSExpression but a series of arguments in expression-jamsession.get()
in expression-jamsession.stringByAppendingString:
(but soonmgl_join()
) in NSExpression but the&
operator in expression-jamsession. Per Reimplement MGLStyleValue atop NSExpression #8074 (comment), we can overload thebitwiseAnd:with:
function for this purpose./cc @davidtheclark @anandthakker @jmkiley
The text was updated successfully, but these errors were encountered: