We'd love that too! We're chatting with the Ruby folks to see if anything like that is feasible. We experimented with lots of other syntaxes (comments, yarddoc, .rbi files, monkey-patching stdlib classes to be callable) and the `sig` syntax seems to be the easiest for folks to use inside Stripe.
After writing sigs for the past few months, I don't dislike it as much as I thought I would. You get the syntax highlighting and autocomplete of your editor, while `sig` and `T` are short enough to not feel like too much boilerplate.
We're very open to other suggestions if you have any for other syntax suggestions. Just email us at [email protected].
def foo(foobar:Integer)
end
is already valid, and I think the lexer might struggle with the ambiguity; but I'm not 100% certain.Edit: I seemingly missed the last line of your comment where you state something similar.
For those not in the know Pascal units had to declare the function (procedure) prototypes before implementing them.
``` class Foo extend T::Helpers
end ```I'd love it if we could write this as :
``` class Foo
end```
Not sure the best way to handle default values... e.g. widget:String:nil is kind of awkward... but still i'd be better this way then the additional method call 'sig'