octave-maintainers
[Top][All Lists]
Advanced

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

Re: Undocumented Function List


From: John W. Eaton
Subject: Re: Undocumented Function List
Date: Fri, 17 Dec 2010 23:02:35 -0500

On 17-Dec-2010, Judd Storrs wrote:

| One other thing I was wondering while looking at this is do the prefix
| and postfix increment and decrement operators (++, --) also have
| corresponding functions?

How would you write a fuction for the postfix ++ operator in Octave?

  function r = postincrement (x)
    r = x;
    ## now what?
  endfunction

You have to return the current value of X and then somehow also
increment its value by 1.  You also have to require that this function
is only applied to variables, not constants or other kinds of
expressions that generate temporary values.  I don't see a way to
express this idea in Octave except via the special form of the ++
operator.

I think there are similar problems for the OP= assignment operators.

jwe


reply via email to

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