Skip to content
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

Ternary-like construct for creating variables #157

Closed
tobie opened this issue Oct 1, 2017 · 1 comment
Closed

Ternary-like construct for creating variables #157

tobie opened this issue Oct 1, 2017 · 1 comment

Comments

@tobie
Copy link
Collaborator

tobie commented Oct 1, 2017

I find it very common to need a ternary operator-like construct when creating variables, for example:

1.  Let |foo| be |x| if |condition| and |y| otherwise.

The infra standard suggests this needs to be defined like so:

1.  Let |foo| be null.
1.  If |condition|, then set |foo| to |x|.
1.  Otherwise, then set |foo| to |y|.

This seems unnecessarily verbose. Could we allow the shorthand version somehow?

@annevk
Copy link
Member

annevk commented Oct 1, 2017

I think we should, I use that shorthand a lot, with parentheses around the conditional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants