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: Patrick Li
Subject: Re: [Chicken-users] UNLIST a list of lists!?
Date: Mon, 5 Jan 2015 11:07:53 -0700

Hi Bahman.

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

Cheers.
  -Patrick

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)



_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users



reply via email to

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