From: Daniel Carrera Date: 2003-04-09T07:18:39+09:00 Subject: The "!" and "?" characters. One of the things I like about Ruby is that it can use ! and ? in method names. However, it seems that there are still limits to what can be done. I need a 'factorial' method, and I thought it'd be cute if the syntax was "n.!" because it's so close to "n!". But Ruby doesn't let me do that. # This one works: >> class Fixnum >> def f # Factorial >> self < 0 and return -1 # Error code. >> self ==0 and return 1 >> self * (self-1).f >> end >> end >> 5.f => 120 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? Thanks. -- Daniel Carrera Graduate Teaching Assistant. Math Dept. University of Maryland. (301) 405-5137 -- quintessence: quintessence (kwin-TES-ens) noun 1. The pure, concentrated essence.