[clean-list] Layout rule

Matthew mfn100@student.cs.york.ac.uk
Sun, 11 Jan 2004 16:09:14 +0000


Hello Cleaners,

I am hoping you can help me the the following problem.  Consider the
following program:

  module test

  import StdEnv

  Start = let f 0 = 0
              f x = y + 1
              where y = 1
          in f 1

This fails to compile and gives the following error messages:

  Parse error [test.icl,8;9,RHS expression]: <expression> expected instead
  of offside token (end group)

  Parse error [test.icl,8;12,want definitions]: End of file expected
  instead of f

If I refer to the layout rule in section 2.3.3 of the reference manual
and rewrite the above program in layout sensitive mode:

  module test;

  import StdEnv;

  Start = let {f 0 = 0; f x = y + 1; where {y = 1}}; in f 1

It compiles and works as expected.  Have I correctly understood the
layout rule?  Can anybody correctly rewrite the latter program with
layout sensitive mode off?

All the best.

-- 
Matthew