libera/#commonlisp - IRC Chatlog
Search
7:18:39
rainthree
mesaoptimizer: I am not sure he understands CLOS well. He quotes Paul Graham... https://borretti.me/article/inheritance-disjunctions
8:24:03
rainthree
dbotton: does CLOG have the feature of automatic updating the html in browser (through websockets) when a relevant lisp function that generates the html (or part of the html) is recompiled? So that one doesn't have to manually refresh the page after each change
8:29:52
rainthree
dbotton: question2: as the user clicks on a button (navigation button, let's say) in a site made with reblocks(weblocks), only the relevant part of the html will be updated, without the need to refresh the whole page. Does CLOG support that?
8:59:56
rainthree
"It would be interesting to know why a function as fundamental as fold was not included in the Common Lisp standard." https://www.n16f.net/blog/reduce-vs-fold-in-common-lisp/ "One of the worst things copied from Common Lisp to Clojure: non-Monoidal binary reduce" https://www.youtube.com/watch?v=VTI0RCaEpOY
9:03:10
beach
I think I know the reason why something "as fundamental as fold was not included...". Because if every function that some person thinks is fundamental were included, then the standard would be many times its current size, and the current size is already considered too big by some.
12:10:35
bike
this blog post seems a little incorrect. reduce never calls the function with one argument. and, if you provide an :initial-value, it never calls the function with zero arguments either, and it pretty much behaves like foldl or foldr depending on whether you put from-end.
12:22:48
yitzi
bike: yes, I made those points via email, including the fact that foldl/list is trivial with :initial-value and REDUCE makes FOLD kind of redundant.
12:23:26
bike
you could still argue that the 0-ary thing is pretty weird and initial-value should be a required argument instead of optional.
12:27:58
_death
bike: why would the nullary case be weird?.. also, the paragraph talking about (reduce #'+ floats) where floats is simply the empty list blames reduce for behavior of + and has unreasonable expectations (should've passed an empty list of unicorns!)
12:42:09
_death
also, it claims fold has no special case.. the empty list is a special case. reduce simply adds another special case when no initial value is supplied
12:56:45
_death
genius comment in clhs entry though, one to keep in mind for code obfuscation day.. (reduce #'- '(1 2 3 4) :from-end t) ;Alternating sum.
13:40:28
bike
_death: it's weird in that it's a very particular case that complicates e.g. the type signature. you can't require that the argument to reduce is a (function (t t)), that sorta thing.
13:46:21
_death
I agree that it's more complicated, and maybe initial-value should've been required to simplify matters