octave-maintainers
[Top][All Lists]
Advanced

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

Re: concatenation bug?


From: John W. Eaton
Subject: Re: concatenation bug?
Date: Fri, 13 Apr 2007 10:18:01 -0400

On 13-Apr-2007, David Bateman wrote:

| John W. Eaton wrote:
| > Is there some reason that the following must fail?
| >
| >   x = {1, 2};
| >   [x, @sin]          
| >   error: concatenation operator not implemented for `cell' by `function 
handle' operations
| >
| > It seems that Matlab barfs on this as well, but I don't see why.
| >   
| I see no reason for this to fail.. The operand should be promoted to a
| cell array before concatenation in this case, equivalent to "[x,
| address@hidden", which works both in octave and matlab if @sin is explicitly
| encapsulated in a cell array first. I'd suggest that all types should
| have a widening operation to allow this.

Hmm.  The more I think about it, the more I'm convinced that given

  x = {1, 2};
  y = @sin;

both [x, y] and [y, x] should fail.  I now see no reason that Y should
ever be converted to a cell array in this context.  So, never mind.
Sorry about the noise.

jwe


reply via email to

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