Dear chicken-users;
I have a simple program that does most of its heavy lifting at compile
time.
To demonstrate the issue, I've written two stubs (as simple as I could
make them but still show the issue I'm having).
File number one is called ticket-stub.scm:
-8
(use s (srfi 1))
On Mon, Mar 10, 2014 at 01:26:08PM +0100, Sandra Snan wrote:
Dear chicken-users;
I have a simple program that does most of its heavy lifting at compile
time.
To demonstrate the issue, I've written two stubs (as simple as I could
make them but still show the issue I'm having).
File number
On Mon, 10 Mar 2014 13:54:03 +0100, Peter Bex peter@xs4all.nl wrote:
On Mon, Mar 10, 2014 at 01:26:08PM +0100, Sandra Snan wrote:
Dear chicken-users;
I have a simple program that does most of its heavy lifting at compile
time.
To demonstrate the issue, I've written two stubs (as
Hello,
I found a Scheme implementation of the Caesar cipher on Rosetta Code. It
said This was written by a novice, please review... So I reviewed it, and
basically rewrote it.
I think my version is much better (clearer) but since I too am a novice, I
feel bad removing the novice warning. Could
I would use an auxiliary function char-plus to add or subtract an offset to
a character:
(define (caesar str n)
(define (char-plus c)
(let ((alpha ABCDEFGHIJKLMNOPQRSTUVWXYZ))
(if (not (char-alphabetic? c)) c
(let ((i (- (char-integer (char-upcase c)) 65)))
On Mon, Mar 10, 2014 at 10:26:56AM -0500, Phil Bewig wrote:
I would use an auxiliary function char-plus to add or subtract an offset to
a character:
(define (caesar str n)
(define (char-plus c)
(let ((alpha ABCDEFGHIJKLMNOPQRSTUVWXYZ))
(if (not (char-alphabetic? c)) c
Am 10.03.2014 15:51, schrieb Daniel Carrera:
Hello,
I found a Scheme implementation of the Caesar cipher on Rosetta Code.
It said This was written by a novice, please review... So I reviewed
it, and basically rewrote it.
I think my version is much better (clearer)
I tend to agree that
I used only the procedures provided by RnRS, instead of loading SRFI-13,
but you could use string-map if you want to. For those who prefer to roll
their own, here is a simple version of string-map! that mutates the string
in place:
(define (string-map! f str)
(do ((i 0 (+ i 1))) ((= i
Thanks. I think it's fair to use SRF-13. Now that I learned some character
functions from Phil, I think the following is nice and compact:
(define (caesar char)
(if (not (char-alphabetic? char)) char ; Return other chars verbatim.
(let ((i (- (char-integer (char-upcase char)) 65)))
Daniel Carrera scripsit:
(define (caesar char)
(if (not (char-alphabetic? char)) char ; Return other chars verbatim.
(let ((i (- (char-integer (char-upcase char)) 65)))
(integer-char (+ 65 (modulo (+ i key) 26))
(print (string-map caesar msg))
This isn't i18n-safe,
I couldn't quite get this to work:
ticket-stub.scm
8
(use s (srfi 1))
(begin-for-syntax
(import chicken)
(use s (srfi)))
(define-syntax create-tickets
(ir-macro-transformer
(lambda (f i c)
`(list
,@(filter-map
(lambda (x)
(if (s-contains? enemy-
On 10 March 2014 17:10, John Cowan co...@mercury.ccil.org wrote:
This isn't i18n-safe, because char-alphabetic? can return #t on
non-Latin letters. Convert to an integer first and make sure it's in
the safe range. Then add a comment to the effect that this assumes a
Scheme in which
On Mon, Mar 10, 2014 at 07:37:36PM +0100, Sandra Snan wrote:
I couldn't quite get this to work:
It still can't find s-contains.
If I move the entire (define-syntax create-tickets ...) sexp to the end
of begin-for-syntax, it can't find create-tickets when called later.
This is unfortunate: I
On 10 March 2014 20:04, Daniel Carrera dcarr...@gmail.com wrote:
I am trying to write an R7RS-compliant version. R7RS would give me
import, as well as char-integer and integer-char. The problem I'm
having is that my code does not work when I compile it, or when I use csi
-s, but it works
On Tue, Mar 11, 2014 at 6:16 AM, Daniel Carrera dcarr...@gmail.com wrote:
On 10 March 2014 20:04, Daniel Carrera dcarr...@gmail.com wrote:
I am trying to write an R7RS-compliant version. R7RS would give me
import, as well as char-integer and integer-char. The problem I'm
having is that my
On Sun, Mar 9, 2014 at 7:51 PM, Daniel Carrera dcarr...@gmail.com wrote:
Hello,
I hope nobody minds an R7RS question. This list seems to have people
knowledgeable of R7RS. It seems weird that R7RS would specify the functions:
There's also scheme-repo...@scheme-reports.org but
I doubt people
Alex Shinn scripsit:
current-jiffy could always return fixnums.
Alas, only if you are in the sweet spot of:
1) programs don't run for too long
2) fixnums are sufficiently large
3) jiffies aren't too precise
On a 32-bit system with microsecond resolution (which does not necessarily
mean
This is the fix:
commit f8230a466ce3a86f360178f115fb62ee124448b9
Author: Peter Bex peter@xs4all.nl
Date: Sun Jun 30 18:50:09 2013 +0200
Fix meta-evaluation to actually take place in the meta environment and add
tests
Signed-off-by: Christian Kellermann ck...@pestilenz.org
It
18 matches
Mail list logo