[Haskell-cafe] "Haskell is a scripting language inspired by
ok at cs.otago.ac.nz
Thu Nov 4 17:48:03 EDT 2010
On 4/11/2010, at 9:08 PM, Stephen Tetley wrote:
> Did Haskell get significant whitespace from Python - doubtful as
> Python possibly wasn't visible enough at the time, but you never know.
Python did not originate indentation-based syntax.
Occam has it too.
I first came across the idea in a rather old book
which I *think* was by Reynolds.
> Doesn't COBOL have significant layout anyway as an inspiration to
Yes and no. What it actually has relates strongly to punched cards
and is more like assemblers of the day.
Columns 1 to 6 were for the sequence number.
You don't know what a sequence number is?
It's a decimal number punched in a fixed group of columns so that
when you drop a box of 2000 cards you can run them through a
reader/sorter and put them back in the right order.
Column 7 is called the indicator area.
" " a normal line begins here
"-" this is a continuation of the previous line
"*" this is a comment line
Some other characters are allowed here but this gives you the idea.
Columns 8 to 11 are "Area A". Certain structure keywords
and labels must go in that area.
Columns 12 to 72 are "Area B". Normal statements go in that
area. Indentation *within* area B has no significance whatever.
Columns 73 to 80 have a name (the Identification Field) but
no use. Put anything you like there. (This is where Fortran
used to put sequence numbers.)
None of the classic IBM languages (BAL, Fortran, COBOL, PL/I, APL)
used indentation-aware syntax.
More information about the Haskell-Cafe