On Thu, Jun 12, 2008 at 7:40 PM, Bob Rogers <[EMAIL PROTECTED]> wrote: > From: "Ben Tilly" <[EMAIL PROTECTED]> > Date: Thu, 12 Jun 2008 18:33:36 -0700 > > On Thu, Jun 12, 2008 at 4:01 PM, Bob Rogers wrote: > > . . . You can even run code at read time, when the program is being > > parsed by the compiler (or interpreter). > > Um, you can do that in Perl as well. See Lingua::Romana::Perligata > for an amusing demonstration of exactly what you can choose to do to > code at read time. > > That's source filtering, which is much cruder; it's a single hook that > happens before lexing/parsing, rather than during. Lisp has a simple > way to say "evaluate this and insert it into the parse at this point," > and a much more elaborate mechanism for hacking the lexer in order to > introduce new syntax. New syntax can also be introduced via macros.
I did not know what you meant by "at read time". And yes, I am fully aware of the power of Lisp macros. However it is rare in Lisp to introduce new syntax. Other than the ubiquitous '(foo) for (QUOTE foo), the Lisp I've seen doesn't use much syntactic sugar. Other kinds of sugar, sure, but still it is "toenail clippings in oatmeal" to borrow a phrase from Larry Wall. > But don't worry; IIUC, Perl 6 will be able to do most if not all of > this. ;-} Well, sort of. Kind of. Yes, but sort of in an opposite way. Perl 6 will have all sorts of things letting you more reliably and flexibly redefine syntax. You'll be able to hook directly into the parsing process, redefine the grammar, and do things like define your own operators. However I don't know of anything that will match Lisp's macro system. Ben _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

