Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v1.17.0 #771

Unanswered
antonmedv asked this question in General
Mar 16, 2025 · 1 comment
Discussion options

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy,
safety, and speed.

program, err := expr.Compile(`let foo = bar(); baz(foo, foo)`)

In this release:

This release added the biggest change to the Expr language: if-else expressions and sequential expressions. #736 e750878

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:

Improvements:

Fixes:


This discussion was created from the release v1.17.0.
You must be logged in to vote

Replies: 1 comment

Comment options

@antonmedv, thanks to you and all the team taking care of Expr for your outstanding job !

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /