From: Chris Pine Date: 2003-04-09T07:45:28+09:00 Subject: Re: The "!" and "?" characters. ----- Original Message ----- From: "Daniel Carrera" This is cool. But it'd be cooler if I could write 'def !' and '5.!'. But 'def !' causes a parse error. Now my question: Does anyone know why 'def !' causes a parse error? ---------------------------- Because it's interpreting `!' as `not', I think. You can usually get around these problems by sending symbols, but `:!' gives a parse error. You can usually get around *those* problems by interning a string: irb(main):001:0> class Integer irb(main):002:1> define_method ('!'.intern) {self * (self-1).send('!'.intern)} irb(main):003:1> end => # irb(main):004:0> 5.send ('!'.intern) Segmentation fault Oops. Hmmm... Chris