[Scilab-users] [a, ,c] = ... : skipping a recipient

Samuel Gougeon sgougeon at free.fr
Mon Apr 11 20:54:34 CEST 2016


Le 11/04/2016 15:10, Jan-Åge Langeland a écrit :
>
> On 11.04.2016 07:27, Samuel Gougeon wrote:
>> Hello,
>>
>> With Scilab 6, [a, ,c] = (%pi, %z, "Text") sets c = %z instead of  c 
>> = "Text".
>> Is it expected, or is it a bug?
>> Is there a way to skip a recipient with respect to its source?
>>
>> Samuel 
>
> Some surprises here:
>
> --> [a]=(1,2,3)
>  a  =
>    1.
Indeed. Surprisingly, assignments are done from right to left!, with 
Scilab 5.5.2 as well as with Scilab 6:
--> [a, b, a] = (%pi, %t, "test")
  a  =
  test
  b  =
   T
  a  =
     3.1415927

But when the list of recipients is shorter, only the left sources are 
considered:
--> [a, b] = (%pi, %t, "test")
  b  =
   T
  a  =
    3.1415927

Quite counter-intuitive.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160411/4d84d453/attachment.htm>


More information about the users mailing list