[Scilab-users] How to replicate what "load" does (aka creating variable in the current workspace from inside a function)

amonmayr at laas.fr amonmayr at laas.fr
Wed Feb 24 08:56:55 CET 2016


Le 02/23/2016 10:25 AM, antoine.elias at scilab-enterprises.com a écrit :
> Hi users,
>
> Just to explain, why "who" change.
> Previous implementation of "who" was stack dependant, so when you ask 
> local variables names,
> Scilab 5 reads the stack from bottom to top ( or the opposite ), and 
> returns list of variables it found.
>
> Now in Scilab 6, we have remove this stack ( i'm sure you already know 
> that ^^ ).
> And we use map to store local variables names.
> maps are pretty fast but do not ensure order of elements.
> "who" returns a list of local variables names, that's all.
>
> The alphabetical order is a side effect of implementation like 
> creation order was in Scilab 5.
> If we use another system to store local variables names, we can get 
> another output.
>
> So please, do not use "alphabetical" order without "sorted" argument. 
> It may change in future.

OK, thanks for the in-depth explanations.
Any chance to get some sort of time-stamp or order info with 'who' or 
any other function?
Because that was a neat feature to know right away what were the last 
variables created.

>
>
> Antoine
> ps: I'm pretty sure that "who"'s help page does not say "'who' returns 
> variables names in creation order."
Indeed, it does not.
But now we have an option to sort them whereas they are already sorted. 
Kind of weird and confusing.
>
> Le 2016-02-22 12:51, Antoine Monmayrant a écrit :
>>> Not sure if it is related to `who` or to the special use of `resume`.
>>
>> I can confirm that it comes from the bug in who for scilab 6.0.
>> See also my solution that uses 'resume' and not 'who' and work in both
>> 5.5 and 6.0
>>
>> Cheers,
>>
>> Antoine
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>


-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Antoine Monmayrant LAAS - CNRS
  7 avenue du Colonel Roche
  BP 54200
  31031 TOULOUSE Cedex 4
  FRANCE

  Tel:+33 5 61 33 64 59
  
  email : antoine.monmayrant at laas.fr
  permanent email : antoine.monmayrant at polytechnique.org

+++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the users mailing list