trip logs / gnuvola


Trip Log 2022-01-02 h07 -- Indices Style Upgrade Part 11

Oops, looks like Part 10 of the Indices Style Upgrade series contains a pair of errors.  My fault, I was so excited about working in an Alan Perlis quotation, I did not double-check my work.  This trip log entry describes the errors and gives the correct text. 

In programming, one of the hardest problems is naming things.  This is especially true when the things are anonymous functions (which have no name!).  The first error was calling the ‘lambda’ form on lines 41-42 a “thunk”, which is shorthand for saying “a procedure that takes no arguments”.  OF COURSE that procedure takes an argument, that's the list of items to be sorted!  What was I thinking?!? 

The second error was identifying the extra parens required for actually calling the ‘sorter’ procedure.  The parens identified are to call ‘most-impactful-first’.  The ones used for actually calling the ‘sorter’ procedure start in the patch (left-most paren on line 51), and end on line 63. 

Anyway, here's a reformulation of the paragraph prior to the call sequence, as well as the call sequence, using words other than “thunk”, and with the proper parens referenced: 

(begin reformulation)

Lastly, remember that ‘most-impactful-first’ returns a ‘lambda’ form (lines 41-42), and THAT is the procedure that needs to be called to actually do the sorting.  To avoid confusion, let's call that procedure ‘sorter’ (the one that calls ‘sort’).  Thus, we see the call to ‘sorter’ represented by the extra pair of parentheses surrounding the ‘most-impactful-first’ call (line 51 open, line 63 close).  So the call sequence is as follows:

(end reformulation)

Sorry about that lapse.  I'll try to work in Alan Perlis quotations more carefully going forward.  :-D 


Copyright (C) 2022 Thien-Thi Nguyen