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: Jordi Gutiérrez Hermoso
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Mon, 12 Nov 2012 14:10:20 -0500

On 12 November 2012 13:23, Yury T. <address@hidden> wrote:
> So, no solution is forthcoming, eh? Pity.

No solution to what? Have you looked at the dataframe package in OF?
It's more like what you would find in R.

Also, struct arrays, cell arrays, and plain arrays are the basic types
in Octave. Plain arrays are of homogenous type, cell arrays are of
heterogenous type, where each cell can contain any Octave type,
including another cell, and a struct array is a cell array where one
dimension is indexed by strings instead of positive integers. These
are your basic building blocks, and perhaps they are enough for
solving your problem at hand. The cell() and struct() functions can be
used to build cell and struct arrays and ordinary arrays can be built
with [] notation. In addition, you can use {} to build cell arrays.

> What might be done with documentation primarily, I feel, is restructuring.
> Now, if I want to find something untrivial, I have to hunt all over the
> tree. Superficially, there is structure, but it is formed on somewhat
> unclear premises. Take the arrays (of which matrixes are a subset). Array is
> a complex data structure primarily characterised by many modes of addressing
> (indexing) its elements. Some modes are ubiquitous, from Basic to, as it is,
> Octave, some are not. Now, I feel, there is a traditional way to lay out the
> info on  language data types in documentation. You start with the general
> description, then turn to simple cases of vars definitions and constants,
> then to complex cases. Then to the typical use cases and to the special
> cases and exceptions. Only then you proceed with the operators and
> functions. And you never scatter the basic information across the manual.
> I've reread the Section 4, 5.2, and 6 just now, you know. :) Variables in
> Sec. 7? I have a feeling that the documentation was structured according to
> how the Octave was growing and being implemented... :)

Thanks, I will take this into consideration.

- Jordi G. H.


reply via email to

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