Top
Back: 5.1.12 dbprint
Forward: 5.1.14 deg
FastBack: 5. Functions and system variables
FastForward: 6. Tricks and pitfalls
Up: 5.1 Functions
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

5.1.13 defined

Syntax:

defined ( name )

Type:

int

Purpose:

returns a value <>0 (TRUE) if there is a user-defined object with this name, and 0 (FALSE) otherwise.
A non-zero return value is the level where the object is defined (level 1 denotes the top level, level 2 the level of a first procedure, level 3 the level of a procedure called by a first procedure, etc.). For ring variables, -1 is returned.

Note:

A local object m may be identified by if (defined(m)==voice).

Example:
 
  ring r=(0,t),(x,y),dp;
  matrix m[5][6]=x,y,1,2,0,x+y;
  defined(mm);
→ 0
  defined(r) and defined(m);
→ 1
  defined(m)==voice;   // m is defined in the current level
→ 1
  defined(x);
→ -1
  defined(z);
→ 0
  defined(t);
→ -1
  defined(42);
→ -1

See rvar; voice.


Top Back: 5.1.12 dbprint Forward: 5.1.14 deg FastBack: 5. Functions and system variables FastForward: 6. Tricks and pitfalls Up: 5.1 Functions 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.