[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: clumsy patch for h = history (n)
From: |
Ben Abbott |
Subject: |
Re: clumsy patch for h = history (n) |
Date: |
Wed, 19 Dec 2012 20:31:38 -0500 |
On Dec 19, 2012, at 7:13 PM, John W. Eaton wrote:
> On 19-Dec-2012, Ben Abbott wrote:
>
> | Jordi has pushed a changesets that enable "history" to return a cell-string
> of the history.
> |
> | http://hg.savannah.gnu.org/hgweb/octave/rev/dbb7896f15c7
> | http://hg.savannah.gnu.org/hgweb/octave/rev/1eee8d8c59fd
> |
> | These were in response to the feature request below.
> |
> | https://savannah.gnu.org/bugs/index.php?37947
> |
> | At present to return the last N commands a string representation of N must
> be passed. For example,
> |
> | last_10_commands = history ("10");
> |
> | And passing a numeric value gives an error.
> |
> | last_10_commands = history (10)
> | error: history: expecting all arguments to be strings
> |
> | Fixing this "correctly" on the c++ side is a lot of work. A job I am not
> able to do, and one Jordi doesn't have time for.
>
> How about starting with the following changeset? It may need some
> additional changes to the doc strings.
>
> jwe
Perhaps the return cell-strings shouldn' t include the indices?
>> a = history (10)
a =
{
[1,1] = 1018 a = history (10)
[2,1] = 1019 history 10
[3,1] = 1020 history 10 -q
[4,1] = 1021 history (10)
[5,1] = 1022 a = history (10)
[6,1] = 1023 quit
[7,1] = 1024 # Octave 3.7.0+, Wed Dec 19 13:20:37 2012 EST <address@hidden>
[8,1] = 1025 history (1)
[9,1] = 1026 a = history (1)
[10,1] = 1027 a = history (10)
}
Ben