help-octave
[Top][All Lists]
Advanced

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

a=0; a([1,1])++ -> a == 2


From: Etienne Grossmann
Subject: a=0; a([1,1])++ -> a == 2
Date: Wed, 02 Aug 2000 18:44:11 +0100
User-agent: WEMI/1.13.7 (Shimada) FLIM/1.13.2 (Kasanui) Emacs/20.7 (i386-debian-linux-gnu) (with unibyte mode)

  Hello,

  sorry if the answer to my question is a clear-cut "no" or if it has
already been discussed.

  Wouldn't it make sense to have the code 

       a=0; b = a([1,1])++ ;

  be equivalent to either

       a=0; b=a([1,1]); b++; for i in [1,1], a(i)++ ; end

       yielding       a == 2, b == [1;1]
  or 
       a=0; b=zeros(size(a)); for i in [1,1], b(i) = a(i)++ ; end
    
       yielding       a == 2, b == [1;2]


  The current behavior yields :

      a == 1, b == [1;1]

  My motivation is that I would like not to do :

      for i = indices, a(i)++ ; end

  Cheers,

  Etienne



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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