[Scilab-Dev] SEP #40: Cell Arrays

Samuel Gougeon sgougeon at free.fr
Fri Feb 19 11:26:31 CET 2016


Le 18/02/2016 18:45, Samuel Gougeon a écrit :
> *.../...
> The SEP does not present **_insertion and extraction of multiple 
> components_ in a once*.
>
>   * After still *c = { %pi %i %t ; %z "abc" list(1,%s)}, *the current
>     implementation is the following:
>
>       o *multiple insertion*: *a) of corresponding multiple components*:
>           + c(:,1) = { %e "zz" }
>             assigns %e to c(1,1) and "zz" to c(2,1) /in a distributive
>             way/!
>              1. .../...
>
>           + c(:,1) = list(%e, "zz")
>             should do the same. But it does not:
>             --> c(:,1) = list(%e, "zz")
>             Wrong insertion: A Cell expected: use {...} instead of (...).
>             This feature might be implemented later. This is not so
>             urgent as removing the {} addressing.
>
By the way, a workaround already exists to do that:
L = list(%e, "zz")  // any list to be used as the source of data to be 
inserted
c(:,1) = makecell([1 size(L)], L(:))  // does it.

>          +
>
>
>             If this feature is implemented, how will it be possible to
>             insert a list in a single component?
>               # c(3) = list(list(%t)) // will do it. Or if the size of
>                 the list is not 1, even
>
c(3) = { list(%t) } // would even be simpler
>
>               # c(3) = list(%t, %z)    // mismatch could be handled
>                 softly in a comprehensive way
>
Humm, better to avoid such an exception. => should yield an error instead.

SG

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20160219/b0fa1889/attachment.htm>


More information about the dev mailing list