New

New(name {[,] name value}}

This function returns a new abstract value.

The first parameter must be the name of an abstract type variable and the remaining parameters (if any) are treated as attribute-value pairs which are used to initialize the data model for which the abstract value provides a unique identity. The abstract type variable is updated to include the value returned by the function.

For example, the following

  p := New(Person, Name `Ralph', Age 25)
is short for
  p := New(Entity)
  Person +:= {p}
  Name(p) := `Ralph'
  Age(p) := 25

New is not intended to be used directly for constructing new instances of data models. The preferred style is to define one or more constructor functions for each abstract type. For example:
  func new_Person(name : String, age : Integer) -> Person
    result := new(Person)
    Name(result) := name
    Age(result) := age
  endf
or, shorter:
  func new_Person(name : String, age : Integer) -> Person
    return new(Person, Name name, Age age)
  endf
Such constructor functions are more flexible and provide a better interface than New.
Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.