Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[suggestion] Nicer caseof syntax #1

Open
DanweDE opened this issue Sep 6, 2016 · 1 comment
Open

[suggestion] Nicer caseof syntax #1

DanweDE opened this issue Sep 6, 2016 · 1 comment

Comments

@DanweDE
Copy link

DanweDE commented Sep 6, 2016

A thought: How about instead of:

caseof(value, [
  [C, C2, (c) => c],
  [D, (d) => null]
])

also (or exclusively) allowing a imho much nicer:

caseof(value,
  C, C2,
  (c) => c,
  D,
  (d) => null
)
@geigerzaehler
Copy link
Owner

I like the first version. Feel free to open a PR

The second one is probably hard to parse and also (in my subjective oppinion) harder to read. So we will not add it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants