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

Support Ternary Operator #677

Open
st0012 opened this issue May 26, 2018 · 8 comments
Open

Support Ternary Operator #677

st0012 opened this issue May 26, 2018 · 8 comments

Comments

@st0012
Copy link
Member

st0012 commented May 26, 2018

For example: foo ? bar : baz

@hachi8833
Copy link
Member

I thought you wouldn't adopt ternary operators in Goby 😲

@st0012
Copy link
Member Author

st0012 commented May 26, 2018

Yep I didn’t want to support this, but this is kind of a basic component to programming language I think

@eliothedeman
Copy link
Contributor

Is this something people have complained about not having?

@st0012
Copy link
Member Author

st0012 commented May 28, 2018

Not yet, just I think it would be. But it might also because we don't really have much users for now.

@Alexius-Huang
Copy link
Member

Just a thought, do you want to do something like in Python style (although Goby is referenced to Ruby style syntax):

hello = 'world' if created? else 'nothing'

But this style is kind of like inline conditional which is addressed in #580

@st0012
Copy link
Member Author

st0012 commented Jun 5, 2018

@Maxwell-Alexius I prefer using Ruby style because python style might confuse users

@spavikevik
Copy link

Would you guys let me try to attack this in my free time? I love Ruby and Go, and have tried working with compilers/interpreters before, so I feel like it wouldn't be such an idea to attempt something like this.

@st0012
Copy link
Member Author

st0012 commented Jul 20, 2018

@spavikevik sure, feel free to work on it 😄

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

No branches or pull requests

5 participants