[plt-scheme] symbols redefined in SRFIs
On Mon, 2006-10-23 at 22:12 -0400, Eli Barzilay wrote:
> On Oct 24, Dan Muresan wrote:
> > > * the ability to catch bugs in code that wants to use lists of equal
> > > length
> >
> > (you mean unequal length)
>
> No -- code that wants equal-length lists, but got unequal lengths
> instead. Before your change it raised an error and got a happy
> programmer. After your change you get a bug that propagates further
> and becomes harder to find.
Doesn't that work both ways? If maps want lists of equal length then I
may have to write a function that trims longer lists to the length of
the shortest to condition the arguments to the maps. On the other hand,
if maps accept lists of unequal length and (for independent reasons) I
care that several lists are the same length then I still have to write
the trimmer. Either way there are cases where additional work has to be
done.
I'm used to Common Lisp, where maps take lists of unequal length; they
also work fine with no-more-than-N-1 circular lists among N arguments.
Since I'm used to CL, Scheme's behavior violated Least Surprise. I
suppose though that born-and-bred Schemers would feel the same way about
CL.
I have a weakly justifiable preference for the CL behavior on the
grounds that a) maps over unequal length lists have a sensible
specification and b) robust design favors weakening the input
constraint.
-- Bill Wood