OEP

175

Title

Default values for record fields

Summary

Allow initial values to be specified for record fields

Owner

Adam Sampson <ats@offog.org>

Status

Proposed

Date-Proposed

2009-03-24

Keywords

records

Teodor Ghetiu suggested that we should be able to specify default values for record fields, so that when you declare (or allocate, for mobiles) a record, it's initialised with the specified values. This'd be quite useful for some of the CoSMoS simulations.

The syntax could just echo variable declaration syntax:

DATA TYPE PARAMS
  RECORD
    INT x:  -- not initialised
    INITIAL INT y IS 0:  -- initialised
:

I suppose that you could also have VAL fields in a record, but I'm not convinced that'd be very useful...

OEP/175 (last edited 2009-03-24 18:18:58 by ats)