Better HN
topnewbestaskshowjobs
Log inSign up

alfnoodles

3 karma · joined Oct 3, 2017 (9y ago) · 3 submissions

Submissions

comment 5y ago · link · parent

Ah. The biggest difference between ?/: and if/else is that ?/: is an expression (returns a value) and if/else are statements (a step/command/declaration/etc). You can build statements on top of CEL (lots do), but the core Common Expression Language (CEL) doesn't actually have them.

Note that python uses if/else for the ternary expression form as well: `a = b if c else d`

Though personally, I like to have the condition in the front, instead of in the middle.

comment 5y ago · link · parent

The link given if for the spec, this is probably a better "intro" page: https://opensource.google/projects/cel

comment 5y ago · link · parent

Go on... :-). Why don't you like them?