switch case semantics

9 views
Skip to first unread message

Andy Maule

unread,
Feb 28, 2024, 2:19:30 AMFeb 28
to CEL Go Discussion Forum
Hi all,

We've been evaluating cel-go for some use cases. I've looked into using map lookups to provide switch/case statement style semantics with O(1) lookup. I was just wondering if there are there any other ways to support this, e.g. macros?

Thanks,

Andy

Tristan Swadell

unread,
Feb 28, 2024, 12:12:52 PMFeb 28
to Andy Maule, CEL Go Discussion Forum
Hi Andy,

Internally, we've been discussing switch-case / if-elseif-else style macros mostly to handle cases with deeply nested ternary expressions which become practically unreadable. I'm not sure if what we've been talking about lines up with your use case though. If you're able to share some example expressions that would help us figure out whether there's alignment.

Cheers,

-Tristan



--
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/3bf9241c-85d4-48ee-9856-4c425b2452e9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages