help-octave
[Top][All Lists]
Advanced

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

Re: equivalent for C-style init: structname varname[] = {...} ?


From: Sergei Steshenko
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Tue, 13 Nov 2012 12:54:41 -0800 (PST)




----- Original Message -----
> From: Yury T. <address@hidden>
> To: address@hidden
> Cc: 
> Sent: Tuesday, November 13, 2012 8:58 AM
> Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
> 
> Sergei Steshenko-2 wrote
>>  The matter is not syntax, it's semantics.
>>  ...
> 
> And semantics (sense) is brought to us by a means of syntax (language),
> right? Your example is of course quite appropriate. More might be provided.
> :) As the language will hardly change to accomodate multitude of
> perceptions, more the reason to provide a better explanation of what is
> actually there, yes? :)
> 
> 
> 
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/equivalent-for-C-style-init-structname-varname-tp4646460p4646555.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

Here is more crap:

"
octave:1> foo{1} = 1
foo =
{
  [1,1] =  1
}
octave:2> foo(1)
ans =
{
  [1,1] =  1
}
octave:3> foo(1, 1)
ans =
{
  [1,1] =  1
}
octave:4>  
"

- what was initiated as a cell array - see the "{1}" can be accessed as regular 
vector - see see the "(1)". And, even worse, in this case accessing 'foo' as a 
2d object (matrix) also works.

So, there is nothing wrong with your not understanding of "{...}", "(...)" - 
the language does not facilitate the understanding.

Regards,
  Sergei.


reply via email to

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