From: Ryan Pavlik Date: 2003-04-12T09:11:34+09:00 Subject: Re: The "!" and "?" characters. On Sat, 12 Apr 2003 04:46:05 +0900 KONTRA Gergely wrote: > By the way why not allow to define new operators, like in prolog and > sml? I've talked about this from time to time on #ruby-lang. It's not going to happen, unfortunately, but it would be nice. In Lisp, you can define macros (note: not _anything_ like #define macros; same word, different meaning), and even modify the reader (lisp's equivalent of a parser), so you can add new literals and basically anything else. For instance, while Common Lisp defines no regexp literal (like /^foo$/), you could easily add one. Ruby uses a yacc parser though, and this sort of parser is not mutable. For a syntax as complex as Ruby's, this is nice, since it's easier to write, maintain, and probably runs faster. But it means you can't define a new operator, since both the tokens and parser were defined at compile time. At least, this is what I've gathered, if I'm wrong, someone please correct my mistake. -- Ryan Pavlik "That's the first pratical line of thinking to come out of your word hole since we first met." - 8BT