[CM] dopairs

Rick Taube taube@uiuc.edu
Tue, 1 Jul 2003 07:02:41 -0500


yes, thank you! ill make the change in cvs right away. btw dopairs 
should allow any number of forms in its body so your explicit (begin 
...) is not necessary.

(dopairs (x y '(a 1 b 2 c 3))
   (display x)
   (display y)
   ...)



> I think, the error of an uneven pair list should get caught and assume
> it's due to a typo in the fourth last line of the dopairs definition.
>
> To fix this, change that line:
>
> -   (if (null? ,a)
>
> into
>
> +   (if (null? (cdr ,a))
>
> After replacement:
>
>     (dopairs (x y '(1 2 3 4 5))
>              (begin
>               (display (list x y))
>               (newline)))
>
>     guile> (1 2)
>     (3 4)
>     <unnamed port>: In procedure error in expression (error str):
>     <unnamed port>: Uneven pair list: (1 2 3 4 5)
>     ABORT: (misc-error)
>     guile>
>
> --
> Orm
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist