Top
Back: 5.1.22 eliminate
Forward: 5.1.24 ERROR
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.23 eval

Syntax:

eval ( expression )

Type:

none

Purpose:

evaluates (quoted) expressions. Within a quoted expression, the quote can be "undone" by an eval (i.e., each eval "undoes" the effect of exactly one quote). Used only when receiving a quoted expression from an MPfile link, with quote and write to prevent local evaluations when writing to an MPtcp link.

Example:
 
  link l="MPfile:w example.mp";
  ring r=0,(x,y,z),ds;
  ideal i=maxideal(3);
  ideal j=x7,x2,z;
  // compute i+j before writing, but not std
  // this writes 'std(ideal(x3,...,z))'
  write (l, quote(std(eval(i+j))));
  option(prot);
  close(l);
  // now read it in again and evaluate
  // read(l) forces to compute 'std(ideal(x3,...,z))'
  read(l);
  close(l);

See MPfile links; quote; write.


Top Back: 5.1.22 eliminate Forward: 5.1.24 ERROR 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.