[Ecls-list] Re: Decimal Numbers
Marco Antoniotti
marcoxa at cs.nyu.edu
Fri Aug 19 12:44:35 UTC 2005
On Aug 19, 2005, at 3:09 PM, GP lisper wrote:
> On Fri, 19 Aug 2005 11:49:15 -0400, <marcoxa at cs.nyu.edu> wrote:
>> On Aug 19, 2005, at 3:16 AM, GP lisper wrote:
>>> On Thu, 18 Aug 2005 17:16:26 -0400, <marcoxa at cs.nyu.edu> wrote:
>>>>
>>>> It is not a question of "within your reach" or not. Floats are in
>>>> the
>>>> ANSI spec, you cannot remove them and still have a Common Lisp.
>>>
>>> Oh, hadn't considered that. But then I was listening to J. McCarthy
>>> when he was complaining that the creation of the ANSI spec destroyed
>>> the experimental side of lisp.
>>
>> I do not give that much credit to such arguments, even if they come
>> form McCarthy (whose namesake is well earned, on the side :) ).
>
> It was an interesting room reaction. The evidence supports him, since
> CL hasn't changed much, lots of libs to prop it up however.
I do not think the evidence supports that at all. The argument that
"Lisp has not evolved" is IMO a masked "the Lisp standard has not
evolved". There are plenty of extensions to Common Lisp in all the
necessary directions.
> At the
> time he spoke, I was on your side of the question, but now... The
> most experimental Lisp I know is LUSH, and anytime that is mentioned
> on c.l.l, you can expect a flood of posts saying "It's not Common
> Lisp!", killing the thread.
Of course. Lush is Greenspunning. There is nothing in Lush that could
not have been built on top of a specific Common Lisp implementation.
The evidence for this was the message a few days ago on C.L.L. from
Yuri at NYU (next door) saying that he had implemented C inlining for
SBCL/CMUCL "just like Lush has". Well, it turns out that the idea goes
back to KCL in 1985. Doesn't seem all that experimental to me.
> It seems clear to me that CL and
> near-common experimental lisp can co-exist, and bring growth to the
> community. The SBCL <-> CMUCL communities are somewhat like that now.
>
>
>> I apologize for sounding sanctimonius, but you can experiment with
>> Common Lisp as much as you want. TRW to do this is to create your own
>> package which defines the decimal arithmetic. Once you have it and
>> you
>> have the #D syntax in place and much accepted, then you (we) can start
>> a campaign to have the various implementors start treating them as #C
>> for complex. This is the kind of experimentation I like.
>
> No apology necessary, ever.
>
> TRW for you, not for me. It is too annoying to rewrite everything,
> and frankly not the Lisp approach I see constantly taught. To track
> down every computation and 'correct' it for some library package,
> versus reaching into the core add,subtract,etc. If I thought I could
> tackle the control code for using the integer or float routines, then
> I would use a different approach. But my simple mind says find the
> all float routines and change them appropriately.
What is wrong with
(in-package "DECIMAL")
(shadow '(cl:+ cl:- cl:* cl:/ cl:=))
(defmethod + ((n1 number) (n2 number)) (cl:+ n1 n2))
(defmethod + ((n1 decimal) (n2 number)) (cl:+ (as-number n1) n2))
(defmethod + ((n1 decimal) (n2 decimal))
(call-the-decimal-library-plus (internal-representation n1)
(internal-representation n2)))
...
etc etc?
Cheers
--
Marco Antoniotti http://bioinformatics.nyu.edu
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th FL fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.
More information about the ecl-devel
mailing list