[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Tweaking the numbers egg to support syntax in comp
Re: [Chicken-hackers] Tweaking the numbers egg to support syntax in compiled code
Tue, 20 Mar 2012 20:25:30 +0100
On Mon, Mar 19, 2012 at 09:15:20AM +0100, Peter Bex wrote:
> On Sun, Mar 18, 2012 at 10:06:20PM +0100, Peter Bex wrote:
> > The TODO is hopefully the last remaining hurdle; on 64-bit machines, code
> > is generated to call C_decode_literal() with the string representation of
> > fixnums that are larger than the maximum fixnum for 32-bit numbers, to
> > ensure portable C code is generated in all cases. In fact, this change
> > already works perfectly when you compile and run on the same machine.
> Never mind! It just occurred to me that bignum representation is also
> highly machine-dependent so this is not going to work anyway.
> I think I can make it work with a user pass in the compiler, instead.
Turns out the user pass has no way to replace quoted constants with
procedure calls. I had hoped to rewrite all (potential) non-core numbers
to (string->number <#(number->string value)#>) calls, but obviously
that's impossible when the constant occurs within some quoted list.
The proper way really would be to have a way to extend the literal
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth