chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Review my Caesar Cipher?


From: Alex Shinn
Subject: Re: [Chicken-users] Review my Caesar Cipher?
Date: Thu, 13 Mar 2014 09:16:47 +0900

On Tue, Mar 11, 2014 at 9:20 PM, Daniel Carrera <address@hidden> wrote:

On 11 March 2014 12:41, Alex Shinn <address@hidden> wrote:
Chibi has string-map in (chibi string).

But actually, if you're aiming for R7RS support then
string-map is in (scheme base).  Just replace the
cond-expand with:

(import (scheme base))

Hmm... sadly, (import (scheme base)) fails with Chicken and Gauche. I am also having a hard time figuring out how to print with Chibi. I tried the manual, and I tried (print), (printf) and (display).

Then change your cond-expand to:

(cond-expand
 ((or chicken gauche)  ; compatibility
  (use srfi-13))
 (else                 ; R7RS
  (import (scheme base) (scheme write))))

R7RS puts display in (scheme write), because it typically
falls back to write for non-char/strings, and because write
is actually a fairly large and complicated procedure not
needed by most libraries.

However, write-char, write-string and newline are all in
(scheme base) so you could just use write-string here.

You can also (import (scheme r5rs)) to get all of the R5RS
bindings except transcript-on/off.

-- 
Alex


reply via email to

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