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: Mon, 12 Nov 2012 22:45:26 -0800 (PST)




----- Original Message -----
> From: Yury T. <address@hidden>
> To: address@hidden
> Cc: 
> Sent: Tuesday, November 13, 2012 8:23 AM
> Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
> 
> First of all, Sergei and Jordi, let me thank you profusely for your time and
> effort spent in helping me!
> 
> I tested both solutions and think I will go with Sergei's one, even if 
> it's
> abusing Octave somehow (in reality, such «paradigm wrappers», so to speak,
> often are a necessities, even, and not a frivolities). With this solution I
> at least feel I understand how it works. :)
> 
> @Sergei: I feel your condemnation of Octave/Matlab syntax is unnecessary
> strong. Perl syntax, or, as a matter of fact, C syntax might be familiar to
> one, but by no means is it an opposite of «crappy», by which I assume you
> meant something like «unintuitive» or «arbitrary». The «unexpected turns of
> evolution» (that is, unintuitive/arbitrary constructs) are, I feel, a common
> quality of all complex evolving systems of the kind (that is, programming
> languages) We had at least one language with an rationally constructed
> syntax (Pascal), and look at it now.
> 
> @Jorgi: If I only had time (which I won't have, for several months, at
> least), I would gladly participate in clarifying the documentation,
> especially in the topics discussed here. One (especially familiar with C and
> AWK, hehe) should be able to produce an equivalent of Sergei's solution «in
> 5 minutes», assuming the documentation is really helping. However, as it is,
> I'll be able only to produce short snips («explanations to self») which I
> should just mail to you, right?
> 
> Thanks again, guys.
> 
> 

The matter is not syntax, it's semantics.

Here is more Matlab/Octave language crap:

octave:1> foo = 1 # looks like a scalar, doesn't ?
foo =  1
octave:2> foo(1) # but I can access it as vector element - crap !
ans =  1
...
octave:5> bar(1, 1) = 1 # looks like I am filling a 2-d object - so far so good
bar =  1
octave:6> bar(1, 1, 1, 1, 1, 1) # but I can access it as 6-d object - 6 * crap 
!!!!!!
ans =  1
...

Octave (and probably Matlab) internally is 2d by default, and that is the root 
cause of crap. I.e. there is a strange default instead of number of dimensions 
imposed by user - like in C and Perl.

...

I am using Octave not because I like the language, but because of packages. 
Initially I was considering PDL (Perl Data Language), but it didn't have enough 
DSP functionality, so I chose first SciLab, and then Octave.

No love, just marriage by calculations.

Regards,
  Sergei.


reply via email to

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