[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Behavior of octave and ans
From: |
François Poulain |
Subject: |
Re: Behavior of octave and ans |
Date: |
Mon, 7 Jul 2014 16:33:15 +0200 |
Hi,
Le Mon, 7 Jul 2014 10:07:51 -0400,
Mike Miller <address@hidden> a écrit :
> Yes, this is the correct behavior. The special ans variable is only
> updated when there is no lvalue being assigned to in the outermost
> expression.
Ok.
> Since you are using eval, you could rewrite the user-input expression
> to assign it to a particular named variable of your own choosing, and
> get the result from its value. So for example
>
> texmacs_result = a=1
> texmacs_result = b=a=1
> texmacs_result = a+1
>
> all update the variable texmacs_result. This should be equivalent to
> what you were expecting the ans variable to be.
>
> Does that do what you need?
Yes, but it may change the evaluation behaviour. As an example,
texmacs_result = plot(1) behave differently from plot(1), and
polyfit (1, 1, 1) behave differently from texmacs_result=
polyfit (1, 1, 1).
So, it is uneasy to guess when we should and when we should not add an
assignation.
François
--
François Poulain <address@hidden>
- Behavior of octave and ans, François Poulain, 2014/07/07
- Re: Behavior of octave and ans, Mike Miller, 2014/07/07
- Re: Behavior of octave and ans,
François Poulain <=
- Re: Behavior of octave and ans, Mike Miller, 2014/07/07
- Re: Behavior of octave and ans, François Poulain, 2014/07/10
- Message not available
- Re: Behavior of octave and ans, François Poulain, 2014/07/11
- Re: Behavior of octave and ans, c., 2014/07/11
- Re: Behavior of octave and ans, François Poulain, 2014/07/16
- Re: Behavior of octave and ans, c., 2014/07/16