chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] UNLIST a list of lists!?


From: Bahman Movaqar
Subject: Re: [Chicken-users] UNLIST a list of lists!?
Date: Mon, 05 Jan 2015 21:43:19 +0330
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 01/05/2015 09:37 PM, Patrick Li wrote:
Hi Bahman.

"apply" is the standard way of doing what you're looking for.


Thank you!


On Mon, Jan 5, 2015 at 10:25 AM, Bahman Movaqar <address@hidden> wrote:
Happy 2015 CHICKEN'ers!

I have a procedure which accepts a variable number of lists as the
arguments:

  (define (foobar . lists) ...)

Now, in some part of my code I need to zip 2 lists and pass the result
to "foobar".

  (define lis1 (list 1 2))
  (define lis2 (list 10 20))

The result of "zip" is, correctly, a list of lists.

  (zip lis1 lis2) -> ((1 10) (2 20))

However I need to pass the result of "zip" as 2 separate lists to
"foobar"; I need to *un-list* it.

  (foobar (1 10) (2 20))

Is there any standard way to do that? TIA,


-- 
Bahman Movaqar

http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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