SagelyGuru
Joined 15 years ago
Joined 15 years ago
Finds all items partially equal (not necessarily literally equal) to val. In a generic slice in ascending or descending order. Returns the Range of the matching items. When the range is empty (n..n), then n is the sort order of where the missing val could be inserted.
Assigns a comparator closure `pcomp` just once, depending on whether the order is ascending or descending.
Jan Hus was later burned at the stake for his 'heresies', which probably slowed down the uptake of his eminently useful invention in the rest of the world.
It is my opinion that even English more than 600 years later could benefit from it, as in: 'caš ček' instead of 'cash cheque', thus also finally attaining much simpler, logical and phonetic spelling.
It is especially common in certain "sciences" which typically involve a lot of data collection. Followed by attempts to crunch it up into some kind of popular and far reaching conclusions, intended to fool the examiners into awarding a PhD.
It was more likely inspired by the pythagorian numerical model of the universe. Who is to say that Pythagoras was wrong? For example, all of modern chemistry is explainable in those terms.
Sounds like rather expensive 30 lines of code.