bug-guile
[Top][All Lists]
Advanced

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

(ice-9 optargs) #:rest args polluted?


From: Thien-Thi Nguyen
Subject: (ice-9 optargs) #:rest args polluted?
Date: Fri, 9 Nov 2001 14:45:55 -0800

the code following produces this output (w/ "guile -s bug.scm")
on guile-1.5.4:

  (#<procedure good x> ())
  (#<procedure good x> (1))
  (#<procedure good x> ((1 2 3)))
  (#<procedure blah x> JAY KAY (#:j JAY #:k KAY))
  (#<procedure blah x> JAY KAY (#:j JAY #:k KAY 1))
  (#<procedure blah x> JAY KAY (#:j JAY #:k KAY (1 2 3)))

it seems to me `x' should be the same for both `good' and `blah'.

thi

_______________________________________________________
(use-modules (ice-9 optargs) (ice-9 rdelim))

(define* (good #:rest x)
  (write-line (list good x)))

(good)
(good 1)
(good '(1 2 3))

(define* (blah #:key (j 'j) (k 'k) #:rest x)
  (write-line (list blah j k x)))

(blah #:j 'JAY #:k 'KAY)
(blah #:j 'JAY #:k 'KAY 1)
(blah #:j 'JAY #:k 'KAY '(1 2 3))



reply via email to

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