-
-
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
Fully document array-like literal initializers #7292
Comments
I cringe when I see the documentation for the special concatenation syntax (which was already there). I understand its usefulness in linear algebra... and I've been trying to justify it (unsuccessfully) to a new Julia user who wasn't doing linear algebra and couldn't figure out why he couldn't create hierarchical array structures (ala JSON). |
I agree it's a bad situation for general programming. I'm in favor of using |
I really regret imitating that other language's block matrix syntax. The primary syntax should be for constructing arrays from elements, and supporting full N-d so that all arrays have a standard notation. There might be some way to combine dict and set literals (e.g. write a dict as a set of tuples?), but I suspect we'll just have to forgo set literals. We might be able to keep using spaces and semicolons to concatenate ( Another option is to leave |
This is a slightly ridiculous proposal, but what about repetition of commas to indicate dimension?
|
Nice thought, but it breaks down when you use this for 2D (which we do). With that proposal and multiline, you end up with:
You have to mentally transpose the layout. I like that it can extend to higher dimensions though. |
The documentation on the Punctuation page isn't really useful if you're trying to specify a particular array structure, unless you already know MATLAB (and even then there are important differences). The literal syntaxes using
[]
,{}
, and(,)
should be separated out into their own thing. Not sure what part of the manual is best. Examples should be included as well.The text was updated successfully, but these errors were encountered: