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

Idea for some syntactic sugar #19

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

walski
Copy link

@walski walski commented Apr 10, 2015

Hey, this is more or less a very hacky spike of making the type definition a little more "natural".

I hope this inspires some more clever people than me to come up with an idea for syntax that makes the extra call to typesig after a method definition less painful.

My solution currently looks like this:

require 'rubype/syntactic_sugar'
[Numeric, Numeric, String] > def sum(x, y)
  (x + y).to_s
end

and out of pure laziness it only supports classes, not your symbol-method-name notation.

What do you folks think? Was fun to hack on this :) Keep up the good work!

@walski
Copy link
Author

walski commented Apr 10, 2015

Hm seems to break on Ruby 2.0 :(

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

Successfully merging this pull request may close these issues.

1 participant