From: Joel VanderWerf Date: 2002-12-03T17:31:06+09:00 Subject: Re: [FAQ] [Revised again] What are the non-alphanumerical symbols in Ruby code? Gavin Sinclair wrote: > ----- Original Message ----- > From: "Tim Sutherland" ... >>It would be nice if you mentioned that in this case << is just a method >>which people can define on their own classes. > > > Done. > Just for kicks, I cranked out all(*) tokens that can be defined as methods: [] == >> & - <=> + << === ~ =~ []= * | ** / % ^ -@ < >= <= > +@ Gavin, if there's a place for it, maybe you could list these, too? Note that -@ and +@ are the method names for unary - and +. -- (*) or at least all that are defined in built-in ruby modules, as found by this snippet: mods = []; ObjectSpace.each_object(Module) {|m|mods << m} meths = mods.map {|m| m.instance_methods}.flatten non_alphanumeric_meths = meths.grep(/\A[^\w]+\z/).uniq puts non_alphanumeric_meths.join(" ")