Closed pierrelegall closed 9 years ago
=>
is used in Ruby for hash literal. In crystal we use :
for type restrictions, so we think :
is more consistent. We think =>
in exception syntax in Ruby is inconsistent.I understand the compiled program problematics. Crystal cannot handle the dynamical properties of a Ruby VM. Moreover, Crystal typing syntax is needed and Ruby interpreters yell on parsing. However, it is thinkable to have compatible parsers in both world. Rubies could update their parser to ignore typing syntax (Python 3.5 seems to behave like this).
We don't have the option to write Ruby-Crystal friendly code today (this is the case for exceptions handling). I just notice that some maybe justified but avoidable things don't follow the way to make it possible.
I'll close this because it's starting to look like a duplicate of https://github.com/manastech/crystal/issues/593
We have no plans of changing Crystal's syntax to make it Ruby compatible.
The Crystal rescue syntax is not Ruby compliant. With exception handling, Crystal failed to run Ruby code, and vice versa.
In Crystal, it looks like :
But in Ruby, we can see :
I think it is weird to choose not to follow the Ruby syntax on this kind of detail. Would someone kindly put me in the picture ?
Seriously, this is not about the best syntax, I just complain about this unexpected incompatibility.