Define custom Ruby operator

后端 未结 3 1212
滥情空心
滥情空心 2020-12-10 17:57

The question is: Can I define my own custom operator in Ruby, except for the ones found in \"Operator Expressions\"?

For example: 1 %! 2

3条回答
  •  一整个雨季
    2020-12-10 18:48

    You probably can't do this within Ruby, but only by modifying Ruby itself. I think modifying parse.y would be your best bet. parse.y famtour

提交回复
热议问题