[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] valgrind - more details

From: Peter Bex
Subject: Re: [Chicken-users] valgrind - more details
Date: Thu, 6 Oct 2011 12:57:35 +0200
User-agent: Mutt/

On Thu, Oct 06, 2011 at 12:47:25PM +0200, Jörg F. Wittenberger wrote:
> On Oct 5 2011, Christian Kellermann wrote:
> Today I re-read the R5RS, which left me wondering.  Would it be
> #bi101010.1 or whould it be #b#i101010.1 ?

The latter. See the Lexical Syntax section, it has these productions:

<prefix R> -> <radix R> <exactness> | <exactness> <radix R>

<exactness> -> <empty> | #e | #i

<radix 2> -> #b
<radix 8> -> #o
<radix 10> -> <empty> | #d
<radix 16> -> #x

> Furthermore: 
> Also I changed my mind: I'm afraid numbers in Scheme are complex
> enough to use a real parser to read them.

I agree.  There's pure Scheme code for parsing numbers syntax in trunk
of the numbers egg (and the latest release has it too).  It's not very
simple either, but it doesn't have any dependencies.

When I posted my patches to fix some of the more esoteric syntax details
in Chicken, I initially also tried my Scheme code, but it is about twice
as slow as this C code, that's why I decided against switching.

Also, this code needs to be callable from C because decode_literal()
relies on it. (but that could maybe be worked around)

> However let me reiterate: it does not fix valgrind's compaint.

I think the patch is a good improvement in readability of the core code,
so why not put it in? (of course after fixing the while/if mistake)

"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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]