[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Slib-discuss] integer->list and negative integers
From: |
Shiro Kawai |
Subject: |
Re: [Slib-discuss] integer->list and negative integers |
Date: |
Sat, 28 May 2011 09:14:21 -1000 (HST) |
From: Aubrey Jaffer <address@hidden>
Subject: Re: [Slib-discuss] integer->list and negative integers
Date: Sat, 28 May 2011 14:33:38 -0400 (EDT)
> SRFI-60 and SLIB follow the RnRS convention that a "k" prototype
> signifies a non-negative integer:
I see. That makes sense.
> Integer->list could be extended to handle negative numbers:
>
> (integer->list -10)
> ===
> (integer->list -10 (integer-length -10)) ==> (#f #t #t #f)
That's what I did for Gauche, but as you pointed out, it loses
information, e.g. 0 and -1 both maps to (). Making list->integer
take optional sign argument may be an option, but at the moment
I'll stick to nonnegative arguments. Thanks.