Tab "\t" character behaviour in (Win)hugs/ghc
Sigbjorn Finne
sof@galconn.com
Tue, 18 Sep 2001 13:29:41 -0700
Rijk-Jan van Haaftenrjchaaft@cs.uu.nl writes:
>
> Recently, Craig Delehanty discovered that there is
> a difference in behaviour of putStr "a\tb" between
> Hugs and WinHugs (see comp.lang.functional).
>
> Hugs interprets it as a alignment character:
> >putStr "a\tb"
> "a b"
> >
> (7 spaces)
> but in WinHugs, it is always the same as 8 spaces:
> >putStr "a\tb"
> "a b"
> >
> (8 spaces)
>
> What does the language definition say about this?
Nothing at all, I believe, but the convention is for tab characters
to be interpreted by an output device as moving the cursor to
the next tab stop/alignment column. In the absence of any custom
set of tab stops, the convention is to space them evenly every
8 characters.
So, WinHugs is being unnecessarily non-standard to interpret
"\t" as being a shorthand for 8 spaces. I've changed this to have
it fall into line with the conventional interpretation & checked
in the tweak. Thanks for reporting this.
--sigbjorn