This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "unsupported #!rest" compile-time error


Dean Ferreyra wrote:

I've reproduced this problem:

  (define-simple-class <A> ()
    ((get-op name)
     (lambda (arg1 . rest)
       (display (format "arg1: ~A, rest: ~A~%" arg1 rest))
       (display (format "comp: ~A~%" (cons name rest))))))

The compiler does not seem to like the cons of the method argument onto the "rest" list.

It has nothing to do with the cons per se - it's the reference to name, which means that we need to create a closure for the lambda. The same happens with:

(define-simple-class <A> ()
  ((get-op name)
   (lambda (arg1 . rest)
     name)))
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]