[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] graphics, long function defs

From: Martin Rubey
Subject: Re: [Axiom-math] graphics, long function defs
Date: Fri, 17 Dec 2004 15:51:00 +0100

cf writes:
 > Dear Martin,
 > I implemented the script as a function as you showed below. When I type:
 > )read testkinemat1.input
 > testkinemat1
 > axiom simply displays the function definition without executing the
 > statements

which is the way it works:

testkinemat1 returns the function

testkinemat1() returns the result of the function.

Only, if the function takes *exactly* one argument, you can leave away the

 > Also, if I remove the semicolon in a statement in the function, then the
 > results are not displayed as expected. Not clear why.

The semicolons do have a meaning:


executes a, then b, then c and returns the result of executing c.

(a b;c) 

is nonsense.

In interpreted code, there mustn't be a line break *within* a
function. Therefore, a "line continuation character, namely "_" is provided, to
make it possible to have long function definitions. When the interpreter sees
"_", it "swallows" the following line break.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]