[cvs-nhc98] Implemented labelled fields fully.

User olaf olaf@sparud.net
Wed, 6 Feb 2002 13:28:54 +0100 (CET)


olaf: Wed Feb  6 13:28:54 CET 2002

Update of /usr/src/master/nhc/src/compiler98
In directory hinken:/tmp/cvs-serv25435/src/compiler98

Modified Files:
	Extra.hs Syntax.hs SyntaxPos.hs TraceTrans.hs 
Log Message:
Implemented labelled fields fully.

Data type definition, use of labels as selectors, construction and update with fields are now handled by hat-trans.

Because there is no appropriate structure in the Hat trace file format, construction is encoded as normal construction of a data constructor and update is encoded as a "case". The latter can lead to weird expressions in hat-trail
(e.g. "f main |> case C True undefined undefined"; 
"f (case C True undefined) undefined" would be clearer).

Field labels only appear as selector functions in the trace.

Selection and update can cause runtime errors if a field label is not present. To allow a simpler transformation, these runtime errors are not caught. A general solution to runtime errors is needed anyway.