chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Problems with srfi-4-comprehensions


From: Ivan Raikov
Subject: [Chicken-users] Problems with srfi-4-comprehensions
Date: Thu, 15 Mar 2007 23:19:37 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Has anybody used the srfi-4-comprehensions egg recently? I get this:

  csi> (require-extension syntax-case srfi-4 srfi-4-comprehensions srfi-42)
     
  csi> (vector-ec (nested (:range i 1 4) (:range j 1 4)) 
           (cond ((fx< i j) 0.0) ((fx= i j) 1.0) (else 2.0)))

  #(1.0 0.0 0.0 2.0 1.0 0.0 2.0 2.0 1.0)

  csi> (f64vector-ec (nested (:range i 1 4) (:range j 1 4)) 
           (cond ((fx< i j) 0.0) ((fx= i j) 1.0) (else 2.0)))

  Error: invalid syntax: (:do i (let ((b 4)) (if (not (##core#check (and
  (integer? b) (exact? b)))) (error "arguments of :range are not exact
  integer " "(use :real-range?)" 0 b 1))) ((1 0)) (< 1 b) (let ()) #t
  ((+ 1 1)))

Looking at the source, it would seem that the definition of the v-ec
macro is not quite correct:
   
        (define-syntax v-ec
          (syntax-rules ()
            ((v-ec etc1 etc (... ...))
              (list->v (list-ec etc1 etc (... ...))) )))
  
Shouldn't it in fact be:

        (define-syntax v-ec
          (syntax-rules ()
            ((v-ec etc1 etc ...)
              (list->v (list-ec etc1 etc ...)) )))
       
Could someone who actually understands Scheme macros and
comprehensions take a look at this? Thanks a bunch,


    -Ivan


-- 
"My dog! It's full of rats!" -2001, A Dyslexic Odyssey




reply via email to

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