Top
Back: eliminate
Forward: ERROR
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.25 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);
==> [1023:1]1(12)s2(11)s3(10)--s(7)s(6)-----7-
==> product criterion:4 chain criterion:0
==> _[1]=z
==> _[2]=x2
==> _[3]=xy2
==> _[4]=y3
  close(l);
See MPfile links; quote; write.

Top Back: eliminate Forward: ERROR FastBack: Functions and system variables FastForward: Control structures Up: Functions Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-2, Oct 2010, generated by texi2html.