Re: Beginner problem with repeat

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
Robert Funnell <[email protected]> writes:

> -- for some reason the solves don't get executed
> ip := 0;
> for ipp in 1..3 repeat
>    ip := ip + 1;
>    p == plist.ip;
>    output("p=",p);
>    solve(eq1,precision)

"Bill Page" <[email protected]> writes:

> Contrary to what I implied in my previous email, apparently Axiom's
> for loop is defined to return only a "Void" result. In contrast a
> sequence of statements does behave as you say so that for example the
> value of 'x' after the execution of:
> 
>   x:=(1;2;3)
> 
> is 3.

That's correct.  Furthermore, that's also the behaviour of aldor.

There is another thing:

    p == plist.ip;

defines p to be a (nullary) function.  You probably meant to say

    p := plist.ip;


Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.