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

syntax: { } vector syntax is discontinued #94

Open
YudiXie opened this issue Jul 10, 2024 · 2 comments
Open

syntax: { } vector syntax is discontinued #94

YudiXie opened this issue Jul 10, 2024 · 2 comments

Comments

@YudiXie
Copy link

YudiXie commented Jul 10, 2024

Hi Gen team,

I am trying to run the tutorial here: https://www.gen.dev/tutorials/intro-to-modeling/tutorial#julia-gen-jupyter
In the first tutorial, just by running

my_variable = {:my_variable_address} ~ normal(0, 1)

will generate the following error

syntax: { } vector syntax is discontinued around ...

I am wondering if there is a fix around this, and perhaps I should be using an older julia version? I am using julia 1.10 now.

@alex-lew
Copy link
Contributor

Hi @YudiXie, thanks for trying out Gen!

That syntax is Gen syntax, not general Julia syntax, and can only be used inside of a Gen function:

@gen function my_function()
   my_variable = {:my_variable_address} ~ normal(0, 1)
end

We should perhaps emphasize this more clearly in the tutorial (e.g. by wrapping all such code blocks inside @gen function...end)

Hope that helps!

@YudiXie
Copy link
Author

YudiXie commented Jul 16, 2024

That definitely helps. It is working now. Thank you very much! @alex-lew

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

No branches or pull requests

2 participants