7 function env
= Env
(outer
, binds
, exprs
)
8 if exist('OCTAVE_VERSION', 'builtin') ~
= 0
11 env.data
= containers.Map
();
17 % Workaround Octave calling bug when the first
18 % argument is the same type as the class (the class is
19 % not properly initialized in that case)
26 k
= binds.
get(i
).name
;
28 env.data
(binds.
get(i
+1).name
) = exprs.
slice(i
);
31 env.data
(k
) = exprs.
get(i
);
37 function ret
= set(env
, k
, v
)
41 function ret
= find(env
, k
)
42 if env.data.isKey
(k.name
)
45 if ~islogical
(env.outer
)
46 ret
= env.outer.
find(k
);
52 function ret
= get(env
, k
)
55 ret
= fenv.data
(k.name
);
57 if exist('OCTAVE_VERSION', 'builtin') ~
= 0
58 error('ENV:notfound', ...
59 sprintf('''%s'' not found', k.name
));
61 throw
(MException
('ENV:notfound', ...
62 sprintf('''%s'' not found', k.name
)));