Open alashworth opened 5 years ago
Comment by bob-carpenter Thursday Nov 20, 2014 at 18:38 GMT
Thanks for creating the issue.
It's been on our to-do list from the get go, but never got transferred to an issue.
There are two related features, both of which also need issues:
real alpha <- 1;
beta <- 2;
real alpha; // local variable declaration
alpha <- 3;
On Nov 20, 2014, at 11:47 AM, tpapp notifications@github.com wrote:
Would it be possible to allow multiple declarations on one line, that avoid repeating the var_decl part of the grammar? Eg
real alpha, beta, gamma[5]; real
a, b[3, 4]; that would be equivalent to
real alpha; real beta; real gamma[5]; real
a; real b[3, 4]; and similarly for other types.
This would allow more compact code, could factor out common parts. As far as I understand, this would only change the surface syntax (parser) a bit, and would require no change to the internals.
— Reply to this email directly or view it on GitHub.
Issue by tpapp Thursday Nov 20, 2014 at 16:47 GMT Originally opened as https://github.com/stan-dev/stan/issues/1145
Would it be possible to allow multiple declarations on one line, that avoid repeating the
var_decl
part of the grammar? Egthat would be equivalent to
and similarly for other types.
This would allow more compact code, could factor out common parts. As far as I understand, this would only change the surface syntax (parser) a bit, and would require no change to the internals.