Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ example, given an instance of the `Account` type assigned to the variable

```proto
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the 4 receiver-style size() declarations to the list of standard definitions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

account.phone_number.matches("[0-9-]+") // true if number matches regexp
```

CEL expressions support most operators and functions one would expect when
Expand Down Expand Up @@ -60,7 +60,7 @@ doesn't have a matching protocol buffer type. Within CEL, these objects support
the same accesses and functions as protocol buffer types:

```proto
has(account.properties.id) && size(account.properties.id) > 0
has(account.properties.id) && account.properties.id.size() > 0
```

When the expression `account.properties` is evaluated, CEL will automatically
Expand All @@ -85,7 +85,7 @@ citizens of CEL:
```proto
has(account.properties.id)
&& (type(account.properties.id) == string
|| type(account.properties.id) == list(string))
|| type(account.properties.id) == list)
```

CEL's default type checker deals with a mixture of dynamic and static typing;
Expand Down