help-octave
[Top][All Lists]
Advanced

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

Re: Linking Octave to Cantera - concatenation error


From: John W. Eaton
Subject: Re: Linking Octave to Cantera - concatenation error
Date: Sat, 5 Dec 2009 17:12:42 -0500

On  5-Dec-2009, Judd Storrs wrote:

| I think this is a bug in octave. I can reproduce it by creating
| 
| @foo/foo.m:
| function obj = foo()
|    obj.name = "foo" ;
|    obj = class(obj, "foo") ;
| 
| Then, using octave compiled from somewhat recent development sources
| 9840:c0b54271904b, I see:
| 
| octave:1> a = foo() ;
| octave:2> b = foo() ;
| octave:3> [ a b ]
| error: concatenation operator not implemented for `struct' by `class' 
operations

We've had discussions about multidimensional objects before.  See the
following thread for example:

  http://old.nabble.com/method-indexing-bug-to26180168.html#a26282533

As I recall, we really couldn't decide whether these were actually
useful and thought it would be best to just use cell arrays of objects
if you need to put them in a container of some kind.

Could someone please explain why this feature is needed and how it is
useful or better than using cell arrays of class objects?

| octave:3> { a b }
| ans =
| {
| }

Here, the result is a cell array containing both class objects.
Nothing is printed for each element because there is no display method
for the class FOO.  Maybe Octave should print some default message in
that case, but it currently does not.  That part at least should be
relatively easy to fix.

jwe


reply via email to

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