tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,17 @@
/* Here is how to create a function and return a value at runtime. In the first example,
the function is made global, i.e. it still exists after the statement is run. In the second example, the function
is declared local. The evaluated string may read or write any variable defined before eval_string is run. */
kill(f)$
eval_string("block(f(x) := x^2 + 1, f(2))");
5
fundef(f);
/* f(x) := x^2 + 1 */
eval_string("block([f], local(f), f(x) := x^3 + 1, f(2))");
9
fundef(f);
/* f(x) := x^2 + 1 */