lilypond-devel
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 3182 in lilypond: Patch: Defuse the obfuscated


From: David Kastrup
Subject: Re: [Lilypond-auto] Issue 3182 in lilypond: Patch: Defuse the obfuscated Scheme programming contest
Date: Sun, 17 Feb 2013 11:12:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Marc Hohl <address@hidden> writes:

> If this erroneous use of reduce cannot be resolved quickly, it would
> be best to raise an issue for this.

I can't even judge if it is erroneous (namely leading to wrong results),
and that's what makes it a problem.

> Well, a do loop in scheme felt kinda weird, but map didn't work here
> (I rewrote a bunch of other do loops this way, but here it failed).  I
> didn't manage to iterate over the list (or two lists in this case),
> building up a list of results where a specific element is inserted
> only when certain conditions are fulfilled.

Sounds like a case for "fold" (of which reduce is a variation), and fold
can work over several lists at once.

> Grepping through the code, I found out that reduce would work here,

And that's the worst problem with our incomprehensible code base:
incomprehensible code begets incomprehensible code.  Somewhat
misapplied: De Düwel schitt immer opp den grötsten Hupen.

-- 
David Kastrup




reply via email to

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