Prev: +++ NFL Jerseys On Sale at www.ajerseys.com
Next: ===Christian Louboutin - www.vipchristianlouboutin.com
From: Arzobispo Andante on 4 Aug 2010 10:59 Elena <egarrulo(a)gmail.com> wrote: > Can macros really add features or can they just add syntactic sugar? A > custom "case" statement is just syntactic sugar, tail call > optimization is a feature. I can see no reason why a macro could not transform tail-recursive code into iterative code. That would basically achieve the same observable effect of TCO, i.e. getting rid of stack growth. -- AA
From: Peter Keller on 4 Aug 2010 11:09 In comp.lang.lisp Elena <egarrulo(a)gmail.com> wrote: > On Aug 4, 10:27?am, p...(a)informatimago.com (Pascal J. Bourguignon) > wrote: >> This is the reason why there is no point asking whether there is a >> feature X in CL. ?You can always add any feature to the language, >> thanks to its macros or reader macros, and metalinguistic abilities in >> general. > > Can macros really add features or can they just add syntactic sugar? A > custom "case" statement is just syntactic sugar, tail call > optimization is a feature. This book: http://letoverlambda.com/index.cl/toc Specifically: http://letoverlambda.com/index.cl/guest/chap5.html#sec_4 Would show you how to write a macro such that it adds Scheme's tail call optimized "named let" into Common Lisp. This goes beyond the concept of syntactic sugar and enters the domain of pure code transformation. So yes, you can add features. However, I don't know if you can add "any" feature to CL. :) For example, could I add the ability for a function to introspect into its own display and see an annotated mapping of the machine registers in context? Or could I ask a piece of memory how many times it has been moved in a generational garbage collector and where was its last physical location? Of course, I could add these things, but not with CL as it exists today since there is no means to get that information outside of implementation specific APIs which extend the meaning and domain of CL. Later, -pete
From: Peter Keller on 4 Aug 2010 11:35 In comp.lang.lisp Peter Keller <psilord(a)cs.wisc.edu> wrote: > For example, could I add the ability for a function to introspect > into its own display and see an annotated mapping of the machine > registers in context? Let me make a correction to this one. I *may* be able to add this because CL comes with disassemble. But it all comes down to how much information is provided to me by the implementation and how it is presented to me. -pete
From: Elena on 4 Aug 2010 12:20 On Aug 4, 4:45 am, Fren Zeee <frenz...(a)gmail.com> wrote: > If there is a wrapper do nothing type function in elisp/clisp/scheme > which can have the same effect as commenting out. In Emacs Lisp, if you are looking for a way to comment out blocks of text, you are out of luck. I've read Pythonistas use multi-line strings as multi-line comments (strings are always multi-line in Emacs). If you are looking for a way to comment out blocks of code, you can do that with a macro. I remember having seen a "comment" macro inside Emacs Lisp packages kindly published by Pascal J. Bourguignon here: http://www.informatimago.com/develop/emacs/index.html
From: Elena on 4 Aug 2010 12:23
On Aug 4, 4:45 am, Fren Zeee <frenz...(a)gmail.com> wrote: > If there is a wrapper do nothing type function in elisp/clisp/scheme > which can have the same effect as commenting out. Scheme multi-line comments are here: http://srfi.schemers.org/srfi-30/srfi-30.html Which also is first hit when searching the Net for "scheme multi line comments". |