lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


But these ‘alphabetic numeral’ strings that (obviously) denoted nu
To help you understand my point better, think of a very simple and common application.  If you want to center a number within some fixed length (say a terminal screen of fixed width), you need the length of the number (in whatever representation that number is to be shown) so you can subtract it from the total available length, and add half that number of spaces to the front of the string to center it.  Simple?
 
Id rather have a print function that understands output ought to be "right aligned". As the length depends on output function and how it wants to represent the number. 

We can argue that in computers there isnt a true abstract notion of a number. It always has to be represented in some form. In that case the length in any modern computer is always 64bit.
 
But isn’t the same true for language words?  Any word’s length is based on its representation in a given language, or even in the same language with multiple valid spellings.  In English, for example, some say potatoe, some say potato (regardless of which form you consider correct, that’s irrelevant.)  Same length?

Yes, but there is no automatic coercion when a "potatoe" is put in an elevator versus a lift.

BTW: Unless there was some deeper meaning. Potatoe is an unlucky example, as no where in the world it is considered to be a correct english word. https://www.google.at/webhp?#q=potatoe&nfpr=1
 
In simple terms, the length of a number is how that number would be represented if you were to print it out. 

Which is affected by the system locale.