manpagez: man pages & more
info cln
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 Symbols

Symbols are uniquified strings: all symbols with the same name are shared. This means that comparison of two symbols is fast (effectively just a pointer comparison), whereas comparison of two strings must in the worst case walk both strings until their end. Symbols are used, for example, as tags for properties, as names of variables in polynomial rings, etc.

Symbols are constructed through the following constructor:

cl_symbol (const cl_string& s)

Looks up or creates a new symbol with a given name.

The following operations are available on symbols:

cl_string (const cl_symbol& sym)

Conversion to cl_string: Returns the string which names the symbol sym.

bool equal (const cl_symbol& sym1, const cl_symbol& sym2)

Compares two symbols for equality. This is very fast.

This document was generated on August 27, 2013 using texi2html 5.0.

© 2000-2018
Individual documents may contain additional copyright information.