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

Add alternative syntax for methods #72

Open
rpgoldman opened this issue Jun 17, 2021 · 3 comments
Open

Add alternative syntax for methods #72

rpgoldman opened this issue Jun 17, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@rpgoldman
Copy link
Contributor

(Based on discussion with @gefjon)

The current syntax for methods is quite hard to read, especially when there are multiple if-then-else branches.

Suggest we create an alternative syntax that's easy to read for the simple case and introduce :if :elsif and :else keywords for processing the more complex branching structure.

@rpgoldman rpgoldman added the enhancement New feature or request label Jun 17, 2021
@gefjon
Copy link

gefjon commented Jun 17, 2021

I would use :elif rather than :elsif. The extra letter is no more clear (since it's still not complete like :elseif or :else-if), and Python's use of elif has cemented the 4-letter version as standard.

@ko56
Copy link

ko56 commented Jul 25, 2021

Enhancing the method syntax would definitely be an improvement. But I would vote for :elseif, which is what Julia uses.

@ko56
Copy link

ko56 commented Apr 17, 2022

A proposal: if the work to implement a/the new syntax is not too much, how about implementing something so that people can play with it, with the understanding that it is subject to change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants