octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more import tests


From: Nicholas Jankowski
Subject: Re: more import tests
Date: Tue, 15 Aug 2017 10:55:37 -0400



On Tue, Aug 15, 2017 at 2:27 AM, Rik <address@hidden> wrote:
On 08/10/2017 01:29 PM, John W. Eaton wrote:
 
 
It would be useful to test

function tstfunc ()
  import containers.Map
  x = Map ();
  L = import ()
end

-----------------
>> tstfunc

L =

  cell

    'containers.Map'
-----------------

 
> Also, I need to test what happens when eval is used to give a symbol a
> value when that symbol also exists as a function.  For example:
>
>   import pkg.sin;
>   eval ('sin = pi');
>   sin (1)

pkg.sin doesn't exist, but maybe this with answers your question with Map?

-------------------------
>> import containers.Map
>> eval ('Map = pi')

Map =

    3.1416

>> Map (1)

ans =

    3.1416

--------------------------

 
>
> Is pkg.sin called, or does sin (1) index the variable sin?  Does the
> result change if sin is "declared" to be a variable?
>
>   sin = [];
>   import pkg.sin;
>   eval ('sin = pi')
>   sin (1)

Again with Map:

-----------------
>> Map = []

Map =

     []

>> import containers.Map
>> eval ('Map = pi')

Map =

    3.1416

>> Map (1)

ans =

    3.1416

>>
-----------------
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]