1. routine_id and different files

I have a few include files, and wanted to use routine_id from an included function.
when I pass the function name, as an argument, it doesn't work.
it only works when both the inner function and the "immediate" one are in the same namespace, (or same file?)

Is that a bug, or expected behaviour?

include seqops.e 
 
function inc(integer num) 
    return num+1 
end function 
 
? map({1,2,3},"inc") -- works only when map is in the same file. map uses routine_id. 

Thanks, kobi

new topic     » topic index » view message » categorize

2. Re: routine_id and different files

kobi said...

I have a few include files, and wanted to use routine_id from an included function.
when I pass the function name, as an argument, it doesn't work.
it only works when both the inner function and the "immediate" one are in the same namespace, (or same file?)

Is that a bug, or expected behaviour?

This is expected.

As the inc() function does not have a scope qualifier, it can only been seen by code in the same file. Try using the public scope qualifier instead ...

include seqops.e 
 
public function inc(integer num) 
    return num+1 
end function 
 
? map({1,2,3},"inc") 
new topic     » goto parent     » topic index » view message » categorize

3. Re: routine_id and different files

OH ! ! access levels.
I was just being dense...

it all works perfectly then, sorry for the distraction

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu