New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch / if-elseif-elseif-else term #3199
Comments
Thank you, One thing i want to add. I think it would be important for that after the default value you can submit another aarray or object that allows u to control if its a if else or if its a switch. Or a r.break term will need to be added so it will stop letting things fall though. |
I think that we should simply allow |
i think thise is ur guys call on how you want to do this..... |
As far as bike shedding goes, multi-branch if statements mean "cond" to my brain. I could live with switch. Branch is a bit weird, but I could probably get used to it in time. |
I don't really like the name |
Another vote for making |
Let's finalize this during the 1.17 ReQL discussion period, not now... |
The only reason that i would recommend r.switch over r.branch is as a user first looking at rethinkdb and trying to find a way to do condations r.branch does not sound like its going to be for what i amlooking for i think it was @AtnNn that showed me that command. But as a devloper seeing a command called switch sounds like a switch statment.i would ad r.switch and deperatcate r.branch. |
👍 for extending |
extending |
I think r.branch sounds more like its forking something but fair enough for extending it as long as i dont have to use 10 of them. |
Extending |
I'd like to keep the renaming discussion separate and for later. |
Marking as settled for making |
👍 fantastic idea to make |
Done in |
@encryptio -- is there a docs issue? |
@mlucy Writing an issue out now. |
Currently the
r.branch()
term isn't that great to use if you have more complex case distinctions.Proposed by @wojons: Add a variadic term taking 2N+1 arguments
Its semantics are those of the following code block in C:
We could also make
r.branch()
variadic, instead of introducing a new term.The text was updated successfully, but these errors were encountered: