-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can't @gg user-defined functions #24
Comments
Hi Chad, the problem has been detected. The use of |
I'll make a PR to refine the use of |
It seems to be really difficult now to support the expected feature without using Once the generalized functions get defined, its global scope is decided as well, thus, according to Soss/rand.jl, the module to look up global variables is specified to be However, the best way IMHO to achieve the expected behaviour is,
|
Fixed in #28 |
Hi @thautwarm, I had mentioned this issue is the Soss issues, but I think I wasn't very specific about it.
Everything works great for models like this:
Calling
rand
in this case passes the following to@gg
:I think it will be reasonably common for users to want to define their own distributions, and I'd hate for this always to require a PR to
Distributions
orSoss
. So maybe they have a simple case like this:So far so good. But when they try to use it in a model, ...
I think this is because the source code is like this:
The generated function docs say users should not attempt...
So my guess is this might be the root of the problem.
Some possibilities I can imagine (which might not all help or be feasible):
$
interpolation. I think this could work, but it does leave the Soss-provided distributions feeling kind of magic, so anything a user builds is second-class.N
beforeusing Soss
. This doesn't help, but could there be some variant of this that will work?@gg
(or some variant of it) to allow anything in scope at call-time to be referenced.Any ideas?
The text was updated successfully, but these errors were encountered: