Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_server() -> @run_server with eval scoping #7

Closed
wants to merge 1 commit into from
Closed

run_server() -> @run_server with eval scoping #7

wants to merge 1 commit into from

Conversation

rened
Copy link
Contributor

@rened rened commented Feb 12, 2013

With ZMQ now being a module, the eval statement does not see outside code, which was defined outside the module before the call to run_server()

The change has 2 parts: it uses a custom evaluation function "evaluator", which gets passed from the scope where run_server is called - i.e. statements that get executed see definitions outside of the ZMQ module.

The @run_server macro helps by transparently generating this "evaluator" pass-through function.

E.g.:

myfunc(x) = x+1
require("ZMQ/src/RPCJuliaSer")
using RPCJuliaSer
@run_server  # matlab can now call myfunc

With ZMQ now being a module, the eval statement does not see outside code, which was defined outside the module before the call to run_server()

The change has 2 parts: it uses a custom evaluation function "evaluator", which gets passed from the scope where run_server is called - i.e. statements that get executed see definitions outside of the ZMQ module.

The @run_server macro helps by transparently generating this "evaluator" pass-through function.
@aviks aviks mentioned this pull request Feb 15, 2013
@aviks aviks closed this in 648675a Feb 15, 2013
@rened
Copy link
Contributor Author

rened commented Feb 16, 2013

thanks tim, aviks! your solution is much cleaner!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants