Re: [Haskell-i18n] Unicode in source

At 2002-08-23 19:47, Glynn Clements wrote:
To determine the column number, assume a fixed-width font with this tab convention: tab stops are 8 characters apart, and a tab character causes the insertion of enough spaces to align the current position with the next tab stop.
If you want your code to compile properly, it will have to "look" right to a compiler which has tab stops every eight columns.
Oh I don't use layout, so this makes no difference to me. My blocks are explicitly and unambiguously marked with braces, and my declarations separated with semicolons. And my tabs are set to four, because the code looks nicer that way. And now with internationalisation, we're having all this trouble because the "column number" notion necessary for layout just doesn't work very well with such things as multiple scripts, special halfwidth forms, composed vs. decomposed characters, different-sized spaces etc. I think in this case some simple "90%" solution will be adequate, but my own preference is to avoid it altogether. -- Ashley Yakeley, Seattle WA

Oh I don't use layout, so this makes no difference to me. My blocks are explicitly and unambiguously marked with braces, and my declarations separated with semicolons. And my tabs are set to four, because the code looks nicer that way.
I don't think this discussion has any real bearing on internationalization and nothing at all to do with what level of indentation makes your code look nice. It is only about how you _encode_ sequences of spaces in files. Suppose we were talking about C programs where the indentation doesn't affect the compiler. I can cope with whatever level of indentation you choose and, if I modify the code I'll probably conform to your indentation style (as you say, it's your code). But what I can't cope with is if I view your code and the indentation is all screwed up because the encoding you use is different from mine. Removing the notion of layout from Haskell or requiring linebreaks at certain places in the code might solve some internationalization issues but it will not affect the fact that I can't make sense of code that assumes tabstops of 2 until I normalize your code to match the conventions used by my system so that I can take in the structure of your code at a glance. If people are to exchange Haskell code, they need to agree on the encoding. They can either choose an encoding which excludes tabstops or they can agree on how big tabstops are. A very poor third option is for everyone to choose their own size of tabstops. [Please note that I'm only talking about the encoding - how you much indentation you use is up to you.] -- Alastair Reid alastair@reid-consulting-uk.ltd.uk Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/
participants (2)
-
Alastair Reid
-
Ashley Yakeley