[ prog / sol / mona ]

prog


The Forced Indentation Of Code

58 2022-03-20 11:35

switched the lambda counter >>22 to property extractors, added language prompt

>> console.log (((id2code, extractors, formatters, thread, magic) => magic.split (" ").map (id => [id, id2code (thread, id)]).filter (p => p [1] !== null).map (([id, code]) => (text => id.padStart (3, " ") + " " + extractors.map (ex => formatters [ex ["format"]] (ex ["fun"] (text), ex ["fmthow"])).join (" ")) (code.innerText)).join ("\n")) ((thread, id) => document.getElementById ("t" + thread + "p" + id).parentNode.nextElementSibling.querySelector ("code"), [{"fun": s => [...s.matchAll (/\blambda | => /g)].length, "format": "right", "fmthow": {"length": 3, "pad": " "}}, {"fun": s => (m => m ? m [0] : "?") (s.match (/^(>>> |>> |scheme@\(guile-user\)> )/m)), "format": "id", "fmthow": null}], {"id": (x, how) => x, "right": (x, how) => x.toString ().padStart (how ["length"], how ["pad"])}, 22, "9 10 11 13 14 17 21 24 25 28 30 34 35 37 39 42 43 46 49 53 55"))
  9  12 >>> 
 10   7 scheme@(guile-user)> 
 11  13 >> 
 13  15 >> 
 14  13 >> 
 17  14 >>> 
 21  18 >>> 
 24  15 scheme@(guile-user)> 
 25  13 scheme@(guile-user)> 
 28  25 >>> 
 30  10 >> 
 34  13 >> 
 35  19 scheme@(guile-user)> 
 37  15 >> 
 39  21 >> 
 42  10 >> 
 43  10 >> 
 46  18 >>> 
 49  23 >>> 
 53  21 >>> 
 55  14 scheme@(guile-user)> 
<- undefined
>> 
267


VIP:

do not edit these