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
The . syntax introduces a "context" variable named $. Some built-in functions ($string, $number, $abs, etc) are meant to use the value of $ as the first parameter if no explicit arguments are provided. This is probably a discrepancy with our other functions as well.
/* in the Javascript reference implementation: */($x :="123";$number($x))/* evals to 123 */,($x :="123";$x.$number($))/* evals to 123 */,($x :="123";$x.$number())/* evals to 123 */,/* in jsonata-rs: */($x :="123";$number($x))/* evals to 123 */,($x :="123";$x.$number($))/* evals to 123 */,($x :="123";$x.$number())/* returns no match */,
Note that this behavior is (as far as I can tell) specific to each function. That is, it's not the case that every function invoked in this way gets the context parameter injected. Eg:
/* Javascript */($f :=function($arg){$arg};$x :="123";$x.$f())/* returns no match */,($f :=function($arg){$arg};$x :="123";$f($x))/* returns "123" */,
The text was updated successfully, but these errors were encountered:
The
.
syntax introduces a "context" variable named$
. Some built-in functions ($string
,$number
,$abs
, etc) are meant to use the value of$
as the first parameter if no explicit arguments are provided. This is probably a discrepancy with our other functions as well.Note that this behavior is (as far as I can tell) specific to each function. That is, it's not the case that every function invoked in this way gets the context parameter injected. Eg:
The text was updated successfully, but these errors were encountered: