octave-maintainers
[Top][All Lists]
Advanced

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

Re: fix null assignment


From: John W. Eaton
Subject: Re: fix null assignment
Date: Mon, 22 Sep 2008 14:32:29 -0400

On 22-Sep-2008, Jaroslav Hajek wrote:

| Close enough for government work, I guess, but still looks a bit
| dirty. The special check in assign is not immediatelly obvious, and it
| does not catch the more obscure cases like `b{1} = []; a = ones(3);
| a(1:2,:) = b{1}'. The problem is that not all octave_value assignments
| happen through octave_value:assign.
| 
| The first attached patch (on top of your first one) hacks two more
| places to prevent a null matrix from being stored anywhere,
| encapsulating the hack in a member function.
| (empty
| 
| You may also consider the second patch. It avoids using the extra bool
| flag in Array.h by introducing a special static member for null
| matrices.
| 
| I can't say I like this solution. I like my idea with op_nul_asn_eq
| better. Still, this one is here and is working, it's a solution, while
| my idea is just an idea. I guess I can attend to it in the future.

I don't like it much either, but it was the way I saw for making
something work.  I'd be happy to have a better solution.

jwe


reply via email to

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