From: Arzobispo Andante on
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
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
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
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
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".