Name: Anonymous 2017-12-06 17:34
(fold kons knil list1 list2...)
Nothing wrong with that, right? Yeah, except that for some insane reason kons has the form
(kons e1 e2… accumulator)
. That's right, if you want to write fold-like functions with support for arbitrarily many lists, you have to do idiotic things like(define (fold-my-anus rating list1 . lists)
(cdr (apply fold (λ FUCK
(let* ((acc (last FUCK))
(elems (drop-right FUCK 1))
(r (apply rating elems)))
(if acc
(if (> r (car acc))
(cons r elems)
acc)
(cons r elems))))
list1 lists)))
Instead of the infinitely more sensible
(define (fold-my-anus rating list1 . lists)
(car (apply fold (λ (acc . elems)
(let ((r (apply rating elems)))
(if acc
(if (> r (car acc))
(cons r elems)
acc)
(cons r elems))))
list1 lists)))
Who makes a variadic function and puts the optional parameters at the beginning, for fuck's sake? Half the examples on the SRFI-1 page implicitly work around this retardation and the other half are Perl-tier ``clever'' hacks, which makes me suspect that these were the reason they chose it that way. Code golfers belong into a lime pit, not a language design team.
This isn't the only issue of this kind either. Scheme's parameter order is ridiculously stupid and inconsistent to boot. Is the object you operate on first? Last? Somewhere in between? Fuck, I don't know because there is no system at all behind it. The dead dog got at least that right: Because of currying, parameters are ordered such that the parameters less likely to vary come first and the object to be operated on comes last. This is formulated nowhere as far as I know and yet even third party libraries adhere to it because it is sane, intuitive and makes higher-order functions a breeze.