From: Nicolas Neuss
Subject: READ-DEFAULT-FLOAT-FORMAT and reader macros
Date: 
Message-ID: <87zmzv252d.fsf@ortler.iwr.uni-heidelberg.de>
Hello,

for numerical purposes, SINGLE-FLOAT precision will usually be too bad.
Because I got tired with typing numbers as 1.0d0 many times I have switched
*READ-DEFAULT-FLOAT-FORMAT* to DOUBLE-FLOAT when starting up Lisp.  This
more or less works for me, but I wonder if it is the right thing to do,
because I have experienced trouble at least one time when loading another
application which was expecting SINGLE-FLOAT to be the default reader
format.

Maybe the best thing would be that no application should depend on
*READ-DEFAULT-FLOAT-FORMAT*, but works reasonably with any type of numbers.
Then the user would choose the default format when loading the application.
On the other hand, this could introduce undesired effects when the format
is changed between loading the application and actually using it (for
example, I generate classes and methods special to certain float formats).

Another question related to this is what to do with reader macros which are
defined for an application.  E.g. in my application Femlisp, I have defined
#M(...) for reading matrices, but have seen later that it is also used in
the SERIES package for other purposes.  Should applications generally use a
separate readtable when defining reader macros?  Then, of course it would
be nice if IDEs (e.g. SLIME) would switch readtables as needed.

I remember a recent discussion about related issues (case sensitivity?)
which more or less concluded that the situation could not be handled
perfectly within ANSI CL (in contrast to Genera).  But what are people
really doing in such cases?

Thank you and happy new year,

Nicolas.

From: Pascal Bourguignon
Subject: Re: READ-DEFAULT-FLOAT-FORMAT and reader macros
Date: 
Message-ID: <877jmz38zi.fsf@thalassa.informatimago.com>
Nicolas Neuss <·······@iwr.uni-heidelberg.de> writes:
> I remember a recent discussion about related issues (case sensitivity?)
> which more or less concluded that the situation could not be handled
> perfectly within ANSI CL (in contrast to Genera).  But what are people
> really doing in such cases?

Well, I guess it should not be too hard do write in Common-Lisp a
function that does the same as emacs, ie. read the beginning and the
end of the file, scan for -*- ... -*- or  Local Variables/End and
temporarily bind the dynamic variables found there before LOADing the file.

Yes, it looks like Common Lisp is more a system implementation
language than an application language :-) Let's rewrite Genera in
Common Lisp!

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Until real software engineering is developed, the next best practice
is to develop with a dynamic system that has extreme late binding in
all aspects. The first system to really do this in an important way
is Lisp. -- Alan Kay
From: Steven M. Haflich
Subject: Re: READ-DEFAULT-FLOAT-FORMAT and reader macros
Date: 
Message-ID: <wEjBd.5257$yV1.2372@newssvr14.news.prodigy.com>
Pascal Bourguignon wrote:

> Well, I guess it should not be too hard do write in Common-Lisp a
> function that does the same as emacs, ie. read the beginning and the
> end of the file, scan for -*- ... -*- or  Local Variables/End and
> temporarily bind the dynamic variables found there before LOADing the file.

Named readtables are supported by Allegro and it Emacs interface.  See

http://www.franz.com/support/documentation/7.0/doc/eli.htm#packages-and-readtables-2

If anyone wants to implement something similar for other implementations
and development environments, it would be nice to make it compatible unless
there is a really good reason to do otherwise.