[Top][All Lists]

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

Re: [Chicken-users] file-read and let-values

From: Jim Ursetto
Subject: Re: [Chicken-users] file-read and let-values
Date: Mon, 19 Sep 2011 10:59:10 -0500

On Sep 19, 2011, at 9:59 AM, Sascha Ziemann wrote:

> Is this the prefered way to use the return values of file-read?
> (let-values (((data bytes)) (apply values (file-read fileno size)))

No, just destructure the returned list:

(let* ((rc (file-read fileno size))
       (data (car rc))
       (bytes (cadr rc)))

More conveniently, use matchable like:

(use matchable)
(match-let (((data bytes) (file-read fileno size)))

reply via email to

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