Top
Back: 5.1.80 mult
Forward: 5.1.82 names
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.81 nameof

Syntax:

nameof ( expression )

Type:

string

Purpose:

returns the name of an expression as string.

Example:
 
  int i=9;
  string s=nameof(i);
  s;
→ i
  nameof(s);
→ s
  nameof(i+1); //returns the empty string:
→ 
  nameof(basering);
→ basering
  basering;
→    ? `basering` is undefined
→    ? error occurred in line 7: `  basering;`
  ring r;
  nameof(basering);
→ r

See names; reservedName; typeof.


Top Back: 5.1.80 mult Forward: 5.1.82 names 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.