chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] are values 1st-class?


From: Zbigniew
Subject: Re: [Chicken-users] are values 1st-class?
Date: Wed, 9 Aug 2006 19:51:14 -0500

No, this is not legal.  See R5RS 6.4:

"Except for continuations created by the call-with-values procedure,
all continuations take exactly one value. The effect of passing no
value or more than one value to continuations that were not created by
call-with-values is unspecified."

The existing macro RECEIVE will do what you want, though:

(receive (values 1 2))  ; => '(1 2)

On 8/9/06, Dan <address@hidden> wrote:
(define (values->list v)
  (call-with-values
    (lambda () v)
    (lambda x x)))

(values->list (values 1 2))

Returns (1 2) in SISC and Guile, (1) in Chicken. Are
values supposed to be 1st-class objects? If not, I'll
have to rewrite values->list as a macro -- right?




reply via email to

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