[HN Gopher] Reduce vs. Fold in Common Lisp ___________________________________________________________________ Reduce vs. Fold in Common Lisp Author : billiob Score : 23 points Date : 2023-06-03 18:03 UTC (1 days ago) (HTM) web link (www.n16f.net) (TXT) w3m dump (www.n16f.net) | tangus wrote: | >Fold is also simpler than REDUCE since it does not have any | special case, making it easier to reason about its behaviour. | | If returning the initial value when the list is empty is | considered a special case (or "surprising aspect") of REDUCE, | then it's the same for FOLD, no? | varjag wrote: | _...REDUCE functions can be called with zero, one or two list | values._ | | No, it's either two or zero arguments. | galdor wrote: | Author here. I double checked the Hyperspec [1] and you're | quite right. I'll fix the article tomorrow, thank you for | noticing! | | [1] | http://www.lispworks.com/documentation/lw60/CLHS/Body/f_redu... ___________________________________________________________________ (page generated 2023-06-04 23:00 UTC)