Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.Re: MAP (and variants) vs LOOP - Popular opinion observation?

7 views
Skip to first unread message

Robert L.

unread,
Mar 23, 2022, 7:04:03 PM3/23/22
to
Pascal Costanza wrote:

> different kinds of values. Recently, I needed the following costruct
> quite often:
>
> (loop for x in some-list
> for i from 0
> collect `(,x ,i))
>
> This enumerates all elements in a list. You would have to express this
> completely manually without LOOP because none of the mapxyz functions
> help you here.

Obviously wrong.

Gauche Scheme (using lazy iota):

(map list '(b c d) (liota))

===>
((b 0) (c 1) (d 2))

0 new messages