Skip to content

Keywords should be reserved in Stan #2712

Closed
@VMatthijs

Description

@VMatthijs

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 and upper can be used as variable names.

Reproducible Steps:

The following is a valid Stan program, currently:

transformed parameters {
  real lower;
  real<lower=lower> upper;
  real<lower=upper, upper=lower> imconfusednow;
  print(imconfusednow);
}

Current Output:

No error.

Expected Output:

Syntax error on line 2.

Additional Information:

This is currently exploited in rstanarm.

Current Version:

v2.18.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions