-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Keywords should be reserved in Stan #2712
Comments
For instance, lower and upper can be used as variable names.
I agree---these should've been excluded as possible variable names.
|
This is also true with |
The variable @stnorton --- can you provide a Stan program where the problem you mention comes up? I didn't understand the problem you're referring to. |
@bob-carpenter I created a gist. Naming one of the dimensions
Changing the declaration on line 4 to |
Thanks so much for the reproducible example. I verified it's a bug in 2.18. I'm guessing there's some internal use of the variable |
I verified this is fixed in 2.19 as a pleasant side effect of rebuilding the generator. |
Summary:
Currently, various keywords can be used as variable names in Stan. This seems like a bad idea from a PL perspective.
Description:
For instance,
lower
andupper
can be used as variable names.Reproducible Steps:
The following is a valid Stan program, currently:
Current Output:
No error.
Expected Output:
Syntax error on line 2.
Additional Information:
This is currently exploited in rstanarm.
Current Version:
v2.18.0
The text was updated successfully, but these errors were encountered: