Michele La Monaca scripsit:

> This nonsense seems to be valid syntax:
> 
> #;1> (and-let* ((foobar 1 2 3)) foobar)

I grabbed the Chibi definition and translated it into Chicken.  Unfortunately,
(use and-let) does not override the core definition for some reason.
Here it is with and-let* changed to and-let (no star):

(module and-let (and-let)
  (import scheme)
  (define-syntax and-let
    (syntax-rules ()
      ((and-let () . body)
       (begin #t . body))
      ((and-let ((var expr)))
       expr)
      ((and-let ((expr)))
       expr)
      ((and-let (expr))  ; Extension: in SRFI-2 this can only be a var ref
       expr)
      ((and-let ((var expr) . rest) . body)
       (let ((var expr))
         (and var (and-let rest . body))))
      ((and-let ((expr) . rest) . body)
       (and expr (and-let rest . body)))
      ((and-let (expr . rest) . body)   ; Same extension as above
       (let ((tmp expr))
         (and tmp (and-let rest . body)))))))

It rejects the above example with an undefined-variable error.

-- 
John Cowan <[email protected]>             http://www.ccil.org/~cowan
Sir, I quite agree with you, but what are we two against so many?
    --George Bernard Shaw,
         to a man booing at the opening of _Arms and the Man_

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

Reply via email to