help-octave
[Top][All Lists]
Advanced

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

Re: lists and cell arrays ?


From: John W. Eaton
Subject: Re: lists and cell arrays ?
Date: Wed, 19 Nov 2003 13:38:39 -0600

On 19-Nov-2003, address@hidden <address@hidden> wrote:

| I think you're talking about two things here. Built-in types
| vs. user-defined data structures. Octave's data types, namely,
| strings, matrices, cell-arrays, (deprecated) lists, and
| associative-arrays (aka "structs"), should have high-level syntax for
| concatenation & other useful functions. I don't believe that it's
| possible for a programming language to have standard operators for
| user-defined abstract data structures, since a wily user can create
| all sorts of crazy data schemes. :-)

I don't think I understand your objection.  We allow user defined
types to take advantage of other syntax like +, -, *, /, etc. so I
see no reason that

  [a, b]

should not have the same treatment.  It could easily expand to

  horzcat (a, b)

for objects a and b.  If horzcat were limited to just two args, we
could have a table of operators and dispatch on both argument types,
same as for other binary operators.  If we allow horzcat to have any
number of arguments (required for compatibility, I think) then for
user-defined types in C++, we can have a virtual horzcat method and
dispatch on the type of the first argument. If we ever have
user-defined types in the scripting langauge, then we will look for a
horzcat method for the user-defined type and call that if it is
available.

jwe



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

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



reply via email to

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