Top
Back: User defined types
Forward: Declaration of objects of a user defined type
FastBack: vector
FastForward: cone
Up: User defined types
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

4.22.1 Definition of a user defined type

Syntax:
newstruct( name , string_expression );
newstruct( name , name , string_expression );

Purpose:
defines a new type with elemnts given by the last argmuent (string_expression). The name of the new type is the first argument (of type string) and must be longer than one character.
The second name (of type string) is an already defined type which should be extended by the new type.
The last argument (of type string) must be an comma separated list of a type followed by a name. If there are duplicate member names, the last one wins.

Operations:
the only operations of user defined types are:
assignment (between objects of the same or extended type)
typeof
string and printing
operator . to access the elements

Example:
 


Top Back: User defined types Forward: Declaration of objects of a user defined type FastBack: vector FastForward: cone Up: User defined types Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-6, Dec 2012, generated by texi2html.