-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
allow x[i,j;k] syntax to be parsed #7225
Comments
What should it mean? |
In JuMP we would use it to add conditionals when creating variables, e.g. @defVar(m, x[i=1:n, j=1:n; i < j]) So for our purposes we only want that it's valid syntax so we can parse it in a macro. |
It shouldn't mean anything in Julia, but it should be parsed as
This is analogous to
and
|
It makes sense to me that |
True, but we had discussed using the |
If it is used, it will need to be parseable anyway. The meaning of the syntax in Julia doesn't need to be decided here. |
@StefanKarpinski, when was that? What was the proposed meaning? Was that before we had keyword args? |
It was for "contravariant indexing" – the idea was that |
@StefanKarpinski, any objections to this? |
No, I'm ok with it, but it would be good to check with @JeffBezanson – surface syntax is his baby. |
Bump now that 0.4 is open. |
closed by #8250 |
In JuMP, it would be convenient if we could use the syntax
x[i,j;k]
within macros. We already take advantage ofx{i,j;k}
. Any reason not to allow this syntax and make it a compile-time error when used in code instead of a parser error? @IainNZ @joehuchetteThe text was updated successfully, but these errors were encountered: