bug or feature

classic Classic list List threaded Threaded
4 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

bug or feature

Hello all,

Do you think that the following behavior is a bug or a feature:

--> x=1
  x  =

    1.


--> x([])=[1,2,3]
  x  =

    1.

?

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Antoine Monmayrant Antoine Monmayrant
Reply | Threaded
Open this post in threaded view
|

Re: bug or feature

Le 22/03/2019 à 11:10, Stéphane Mottelet a écrit :

> Hello all,
>
> Do you think that the following behavior is a bug or a feature:
>
> --> x=1
>  x  =
>
>    1.
>
>
> --> x([])=[1,2,3]
>  x  =
>
>    1.
>
> ?
>

Hello everyone,

For me, it kind of makes sense not to change anything to X when
assigning a value to X(range) with range an empty matrix (the assignment
concerns an empty subset of X).
But I don't know whether this is coherent with other features (or bugs!)
of Scilab.
For comparison, I tried this under octave and julia and they both raise
an error.
More specifically, octave complains about the size mismatch between the
lhs  (0x1) and rhs (1x3).


Antoine



_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: bug or feature

Le 22/03/2019 à 14:12, antoine monmayrant a écrit :

> Le 22/03/2019 à 11:10, Stéphane Mottelet a écrit :
>
>> Hello all,
>>
>> Do you think that the following behavior is a bug or a feature:
>>
>> --> x=1
>>  x  =
>>
>>    1.
>>
>>
>> --> x([])=[1,2,3]
>>  x  =
>>
>>    1.
>>
>> ?
>>
>
> Hello everyone,
>
> For me, it kind of makes sense not to change anything to X when
> assigning a value to X(range) with range an empty matrix (the
> assignment concerns an empty subset of X).
> But I don't know whether this is coherent with other features (or
> bugs!) of Scilab.
> For comparison, I tried this under octave and julia and they both
> raise an error.
> More specifically, octave complains about the size mismatch between
> the lhs  (0x1) and rhs (1x3).

Yes, same in Matlab.

S.

>
>
> Antoine
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/dev 
>


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: bug or feature

In reply to this post by Antoine Monmayrant
Le 22/03/2019 à 14:12, antoine monmayrant a écrit :

> Le 22/03/2019 à 11:10, Stéphane Mottelet a écrit :
>
>> Hello all,
>>
>> Do you think that the following behavior is a bug or a feature:
>>
>> --> x=1
>>  x  =
>>
>>    1.
>>
>>
>> --> x([])=[1,2,3]
>>  x  =
>>
>>    1.
>>
>> ?
>>
>
> Hello everyone,
>
> For me, it kind of makes sense not to change anything to X when
> assigning a value to X(range) with range an empty matrix (the
> assignment concerns an empty subset of X).
> But I don't know whether this is coherent with other features (or
> bugs!) of Scilab.
> For comparison, I tried this under octave and julia and they both
> raise an error.
> More specifically, octave complains about the size mismatch between
> the lhs  (0x1) and rhs (1x3).

To me, such a complain looks rather relevant.

Samuel

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev