[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lilypond-auto] Issue 3182 in lilypond: Patch: Defuse the obfuscated
From: |
Thomas Morley |
Subject: |
Re: [Lilypond-auto] Issue 3182 in lilypond: Patch: Defuse the obfuscated Scheme programming contest |
Date: |
Fri, 15 Feb 2013 22:18:42 +0100 |
2013/2/15 Marc Hohl <address@hidden>:
> Am 15.02.2013 14:02, schrieb address@hidden:
>
>> Status: Started
>> Owner: address@hidden
>> Labels: Type-Enhancement Patch-new
>>
>> New issue 3182 by address@hidden: Patch: Defuse the obfuscated Scheme
>> programming contest
>> http://code.google.com/p/lilypond/issues/detail?id=3182
>>
>> Defuse the obfuscated Scheme programming contest
>>
>> This merely grepped for occurences of "reduce" and replaced most
>> of
>> them (and possibly the close surroundings) with something saner. The
>> winner definitely has been in bar-line.scm.
>
> ;-)
>
> I had a (do ...) construct here before replacing it with reduce.
>
> Just curious: how is (any ...) defined?
> If I search for 'scheme any' in google, I do not get any useable search
> results within
> the first result pages ...
>
> Marc
>
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
Quoting from the guile2-manual:
file:///home/hermann/guile2.html#SRFI_002d1-Searching
%%%%%%%%%%%%%%%%%%%%%%%%%
— Scheme Procedure: any pred lst1 lst2 ...
Test whether any set of elements from lst1 lst2 ... satisfies
pred. If so, the return value is the return value from the successful
pred call, or if not, the return value is #f.
If there are n list arguments, then pred must be a predicate
taking n arguments. Each pred call is (pred elem1 elem2 ... ) taking
an element from each lst. The calls are made successively for the
first, second, etc. elements of the lists, stopping when pred returns
non-#f, or when the end of the shortest list is reached.
The pred call on the last set of elements (i.e., when the end of
the shortest list has been reached), if that point is reached, is a
tail call.
%%%%%%%%%%%%%%%% end quote
In the manual for Guile 1.8.8. you'll find it in chapter: 6.4.3.7 Searching
-Harm