[Top][All Lists]

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

Re: Bug in and-map and or-map? What am I doing wrong?

From: Neil Jerram
Subject: Re: Bug in and-map and or-map? What am I doing wrong?
Date: 11 May 2001 13:14:58 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Alejo" == Alejandro Forero Cuervo <address@hidden> writes:

    Alejo> I am now proposing two better versions that do detect this
    Alejo> problem and I still think work faster than the versions you
    Alejo> proposed: [...]

    Alejo> I am sorry for all this noise, I know the speed diferences
    Alejo> between your versions and these are insignificant... :(

Thanks for these!  However, on balance I think my versions are
(potentially) better for two reasons:

- the code is simpler and so more maintainable

- in my version, it is clearly defined that, if the lists have
  different lengths, then no applications of the function f have
  happened, and consequently there are no side effects of f to worry

I think that these outweigh the slight performance loss, if there is
any.  Also note that your internal usages of and-map are not in a
tail-recursive position, so your implementations would grow the stack
if given a large number of lists.

On the other hand, my implementation is buggy because it relies on
non-R5RS behaviour of `equal?' :-(


reply via email to

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