Search code examples
rubyaliaskeywordreserved-words

Can reserved keywords be aliased in Ruby?


Ruby comes with an alias reserved keyword. However it seems that unlike the shell equivalent, you can't use it to alias reserved keyword, like if.

Is there any mechanism to do perform such an alias of reserved keywords?


Solution

  • No, you can't. The alias keyword is for aliasing methods, not keywords.