Jim Ursetto scripsit:

> The `sx` egg does something similar -- transforming a list of strings
> into a null-terminated array of C strings.  I derived a quick example
> from it and attached the code.

BTW, there is a bug in this code: if it's passed an improper list, it
goes off into hyperspace.  It's never a good idea to test for () as
a list terminator in either C or Scheme: you should use something like
this:

(define (end? x)
  (cond
    ((pair? x) #f)
    ((eq? x '()) #t)
    (else (error "A proper list should not end with" x))))

(This is based on the Common Lisp predicate ENDP.)

-- 
But you, Wormtongue, you have done what you could for your true master.  Some
reward you have earned at least.  Yet Saruman is apt to overlook his bargains.
I should advise you to go quickly and remind him, lest he forget your faithful
service.  --Gandalf             John Cowan <[email protected]>


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to