<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>value(Pseudocode) -- execute pseudocode</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_value_lp__String_rp.html">next</a> | <a href="_value_lp__Indexed__Variable_rp.html">previous</a> | <a href="_value_lp__String_rp.html">forward</a> | <a href="_value_lp__Indexed__Variable_rp.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>value(Pseudocode) -- execute pseudocode</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>value p</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_value.html" title="evaluate">value</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>p</tt>, <span>an object of class <a href="___Pseudocode.html" title="the class of pseudocodes">Pseudocode</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span>the value returned by evaluation of <tt>p</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p>Here is an example of its use in the debugger, to see whether modifying the value of a local variable fixed the problem in the code, by executing just the offending line.</p> <table class="examples"><tr><td><pre>i1 : load "Macaulay2Doc/demo1.m2"</pre> </td></tr> <tr><td><pre>i2 : g 2 /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:12:(3):[2]: error: division by zero /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:12:(3):[2]: --entering debugger (type help to see debugger commands) /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:11-8:13: --source code: b := 1/x;</pre> </td></tr> <tr><td><pre>ii3 : value current /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/Macaulay2Doc/demo1.m2:8:12:(3):[0]: error: division by zero</pre> </td></tr> <tr><td><pre>ii4 : x = 11 oo4 = 11</pre> </td></tr> <tr><td><pre>ii5 : value current 1 oo5 = -- 11 oo5 : QQ</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_current.html" title="the pseudocode that produced an error">current</a> -- the pseudocode that produced an error</span></li> <li><span><a href="_pseudocode.html" title="produce the pseudocode for a function">pseudocode</a> -- produce the pseudocode for a function</span></li> </ul> </div> </div> </body> </html>