[Scilab-Dev] SEP #40: Cell Arrays

Samuel Gougeon sgougeon at free.fr
Thu Feb 18 19:21:38 CET 2016


Le 18/02/2016 18:45, Samuel Gougeon a écrit :
>
>       o Then, Scilab 6: c(5) = {"abcd"}  will insert a true elementary
>         cell as the c(1,3) c's component, not the string "abcd". This
>         is a straightforward and very clear syntax. What is in RHS
>         parameter is just values that are inserted in the array, *as is*.
>
>         .../...
>
>           + c([1 4]) = {"abc"} inserts the same "abc" string at the
>             1st and 4th positions in c. This is great! The only thing
>             is that the syntax should become simply
>             c([1 4]) = "abc"
>             In the final implementation that we suggest and hope, c([1
>             4]) = {"abc"} will be as well possible but will insert the
>             cell {"abc"} instead of the string "abc" at the desired
>             positions.
>

If we do not want to make exceptions about the meaning of = { .. }, i.e. 
if we want to use it always and only as a container feeding recipients 
and from which components to be inserted must be picked up, even if 
there is only one component in the container, then, inserting an 
elementary cell in one or several recipients might be done simply with
c(5) = {{"abcd"}}
c([1 4]) = {{"abcd"}}
while
c(5) = {"abcd"}
will be exactly equivalent to
c(5) = "abcd"

In c([1 4]) = {{"abcd"}}, external {} are the container, and internal {} 
belong to the value to be inserted, as it will be in c([1 4]) = 
{{"abcd"} %z }

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


More information about the dev mailing list