Support case when then end expressions? #11
Replies: 5 comments 4 replies
-
Its on my list. But I don't have a nice idea for the API yet. And currently no time. |
Beta Was this translation helpful? Give feedback.
-
I was thinking about the API for this as well. I think the hard part of the API design is that
and
If we can agree on a nice API, I will see if my boss will give me time to make a Pull Request. Here are my initial thoughts:
For the first
Example:
For the second
Example:
The
Question: will we allow building these dynamically (e.g. |
Beta Was this translation helpful? Give feedback.
-
I thought about doing an I have not (yet) tested whether it works to put a named argument after a set of variadic arguments. If that works, it can still allow for a cleaner calling syntax, despite having to define the else parameter first. Do you know if this works? |
Beta Was this translation helpful? Give feedback.
-
I like the idea of just making the caller pass an array of one of the classes @kohenkatz suggested. We could do a runtime check to make sure the If we do these kind of checks we can make everything a varargs parameter, it it could also just be typed as an iterable with the generic type of So something like a if we have more than 1 |
Beta Was this translation helpful? Give feedback.
-
This feature has been released a few months ago. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys.
Could we consider adding support for case when then syntax?
The general idea being something like:
Would produce something like:
Beta Was this translation helpful? Give feedback.
All reactions