[Top][All Lists]

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

Re: [Chicken-users] Expanding ellipsis on lists of different length

From: Elf
Subject: Re: [Chicken-users] Expanding ellipsis on lists of different length
Date: Thu, 28 Aug 2008 07:55:32 -0700 (PDT)

On Thu, 28 Aug 2008, Tobia Conforto wrote:

I believe it's only a matter of using a version of map that checks this condition: that all its arguments become '() at the same time. Maybe it would be useful to modify map itself in this way?

;; correct, this is an error
(map list '(1 2 3) '(10 20))
=> Error: (map) lists are not of same length: (())

;; not so correct, this should be an error too
(map list '(1 2) '(10 20 30))
=> ((1 10) (2 20))

this is a problem, because this technically is correct behaviour, if we're
going to allow this (what i consider broken but understand from my betters is merely unspecified) behaviour. it is consuming all of the tokens from the list. yay ambiguity. i dont think that trying to solve the case in the general form by the extra checks would be a good idea because a) most forms will be correct in more than an unspecified sense, and b) the vast majority
of forms would get a fairly nasty slowdown in order to error for something
outside the spec.


reply via email to

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