Top
Back: 4.1 def
Forward: 4.2 ideal
FastBack: 4. Data types
FastForward: 5. Functions and system variables
Up: 4.1 def
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

4.1.1 def declarations

Syntax:

def name = expression ;

Purpose:

defines an object of the same type as the right-hand side.

Default:

none

Note:

This is useful if the right-hand side may be of variable type as a consequence of a computation (e.g., ideal or module or matrix). It may also be used in procedures to give the basering a name which is local to the procedure.

Example:
 
  def i=2;
  typeof(i);
→ int

See typeof.


Top Back: 4.1 def Forward: 4.2 ideal FastBack: 4. Data types FastForward: 5. Functions and system variables Up: 4.1 def Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.