Conversation
| has(account.user_id) || has(account.gaia_id) // true if either one is set | ||
| size(account.emails) > 0 // true if emails is non-empty | ||
| matches(account.phone_number, "[0-9-]+") // true if number matches regexp | ||
| account.emails.size() > 0 // true if emails is non-empty |
There was a problem hiding this comment.
Please add the 4 receiver-style size() declarations to the list of standard definitions.
There was a problem hiding this comment.
I've basically replaced the global existing definitions with the receiver-style ones. That's been the preference internally for quite some time, but I didn't realize this wasn't reflected publicly.
…as a receiver function
| </th> | ||
| <td> | ||
| (string) -> int | ||
| string.() -> int |
There was a problem hiding this comment.
Hmm, I'm okay marking the function-style version as "deprecated", but I don't think it's okay to just remove it. Anyone attempting to implement a compatible CEL implementation will need to provide the function-style versions for the foreseeable future, so it ought to be in the language spec.
There was a problem hiding this comment.
Ugh, now it's a confusing example because we're not listing the full set of overloads. Unfortunately, the other functions with multiple overloads are either:
- Operators, which introduce an unnecessary complication.
- Conversion functions, which we single out in their description as being different.
- The
get*()functions on timestamps and durations, but we're going to deprecate them on the durations. - Other oddballs like
dyn().
So consider whether there's a better example to use here, but I'm okay with just the receiver-style size functions if you don't think there's a better alternative.
|
PTAL |
| </th> | ||
| <td> | ||
| (string) -> int | ||
| string.() -> int |
There was a problem hiding this comment.
Ugh, now it's a confusing example because we're not listing the full set of overloads. Unfortunately, the other functions with multiple overloads are either:
- Operators, which introduce an unnecessary complication.
- Conversion functions, which we single out in their description as being different.
- The
get*()functions on timestamps and durations, but we're going to deprecate them on the durations. - Other oddballs like
dyn().
So consider whether there's a better example to use here, but I'm okay with just the receiver-style size functions if you don't think there's a better alternative.
| </tr> | ||
| <tr> | ||
| <td> | ||
| (string) -> int |
There was a problem hiding this comment.
Mark the function-style overload as "deprecated", here and below. (Boy, I wish we had adapted Uniform Function Call Syntax and we wouldn't have had to worry about any of this.)
|
Leave a ✅ |
Ensure the intro examples are consistent with the latest function signatures.