thomasmorle...@gmail.com writes:

> On 2019/03/18 22:26:15, dak wrote:
>
>> The silence of the lambdas (almost):
>
>> #(define (divide-true-cdr ls)
>>    "Split @var{ls} into those elements which don't and do have a tail of
>>    value @code{#f}"
>>    (call-with-values (lambda () (partition cdr ls)) list))
>
>> #(display (divide-true-cdr '((1 . #f) (2 . #t) (3 . #f))))
>> => (((2 . #t)) ((1 . #f) (3 . #f)))
>
>> --
>> David Kastrup
>
>
> Aargh, replacing `(lambda (a b) (list a b))´ with `list´ is ofcourse far
> better.
> I considered to use simple `cdr´ instead of `(lambda (x) (eq? #t (cdr
> x)))´, though one would need to ensure the `cdr´ is always a boolean,
> otherwise our procedures would return differently sometimes.  Saul said
> so, though I thought better be paranoid than sorry ...

I have problems understanding how comparing with #t rather than #f is in
any sense better for a value presumed to be boolean.  Why do you think
it is a good idea to consider 3.14 (say) equivalent to #f rather than #t
?  I mean, nothing wrong with paranoia but to me this looks like bolting
the lampshade rather than some window.

> https://codereview.appspot.com/576540043/

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to