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
This release added the biggest change to the Expr language: if-else expressions and sequential expressions. #736e750878
if foo >42{
assert(foo);
calc(foo, foo /2)}else {
calc(0,0)}
A sequence of expression may be separated by ; char. The last semicolon must be omitted. Expr returns the value of the
last expression in the sequence.
If-else is also expressions. Each if must have an else part. Result of if-else can be used as an expression:
let foo =if bar >0{
process(bar)}else {
fallback()};
foo +42
Added:
Added ast.Find helper for easy AST searching. 579de74
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy,
safety, and speed.
In this release:
This release added the biggest change to the Expr language: if-else expressions and sequential expressions. #736 e750878
A sequence of expression may be separated by
;
char. The last semicolon must be omitted. Expr returns the value of thelast expression in the sequence.
If-else is also expressions. Each
if
must have anelse
part. Result of if-else can be used as an expression:Added:
ast.Find
helper for easy AST searching. 579de74uniq()
builtin (Add uniq() function #705)flatten()
builtin (add flatten function #684)Improvements:
len()
return runes count for string e8bd7f8Fixes:
filter() | map()
if#index
is used 35bdb68This discussion was created from the release v1.17.0.
Beta Was this translation helpful? Give feedback.
All reactions