Interesting conversation about ligatures on the google group. What I'm pondering is suppose we had two ligatures, one for ~< and one for <<. What would be the right way to represent ~<< ?
I'm no expert on font implementations however I'm guessing that the ~< ligature would be substituted for a symbol representing "not less than" but that wouldn't capture the true meaning of ~<< "not grade up"
@NerdRage agreed, very interesting. I haven’t seen a case where ligatures improve compehension or clarity - if anything, it’s disorientating to have characters occasionally span two or more monospace slots
@ngn maybe the context helps. I’m writing a function that takes a number and converts it into “spreadsheet column header” format, ie ‘26’ would go to “AA”. I’m doing that by breaking the input number into its base 26 representation, converting each one into its capital equivalent, and concatenating
Everything’s great except when it comes to outputting “A” for the first column
I can special case it but to me, it’s a really surprising result that base conversion doesn’t output ‘,0’ for 0
This one comes from a real life problem. We solved it, of course, but it keeps feeling like it could have be done better, that it's too lengthy and roundabout solution. However none of my colleagues can think of a more succinct way of writing it. Hence I present it as code-golf.
The goal is to c...
thanks @ngn and @dzaima for the resources. I confess I don’t understand the rationale for zero specifically yet - it goes completely against my intuition - but will read and have a think
Like, I get bijectivity, but don’t see why it’s not preserved in this case for zero
@chrispsn it's just that the regular bases are strange. e.g. for base 10 you would want, for each possible number, 10 numbers with digits 0-9 preceding it. But, below e.g. 1000 are only 900 3-digit numbers, so you'd have to repeat the 100 both with and without the leading 0. If excel columns used 0-9 instead of the alphabet, before (& including) 99 there would be 111 possible columns
Why do we represent zero as ‘0’ at all then? Should we be representing ‘zero’ (as in the point on the number line) as “empty sequence of digits” if we were being pure in traditional mathematical notation?
@dzaima I now realise why base-26 conversion isn’t the right tool and don’t know why I ever thought it worked
Still thinking about ‘zero’ as ‘empty list’ though - am trying to find an example where “zero -> enlisted zero” would be counterproductive. Clearly it’s the way humans chose to represent zero (point on the number line), but maybe it complicates implementation
it doesn't feel right to classify 0 as a 1-digit number. there are base^n - base^(n-1) n-digit numbers for n>0. better have it to break down at n=0 instead of at n=1