-
-
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
Generalized comprehension syntax #4470
Comments
A known as a 'generator' in python parlance. I swear this was discussed previously, but I can't find an issue, so perhaps it was only on the mailing list (see here: https://groups.google.com/forum/#!topic/julia-dev/iGVJ-61UmVk). |
I also remembered I saw the discussion somewhere. But I did not actually find an issue here, so I open one. This, IMHO, is worth our attention. |
Yes this would be a really good feature. |
+1 |
Yes, I've long wanted this. One nice feature is that although it in principle uses tasks which may require multiple stacks and therefore might be slow, there are probably many cases where one can determine that it isn't necessary to actually have two stacks so it can be optimized away to very efficient code. |
It's a |
Ah, ok. That will work as well. |
+1. Looking forward to having this. |
See my experiments on the mailing list with an implementation on my generators branch. (You have to manually (edit: thanks @rfourquet) |
without an "s" : |
As there's quite a bit of interest/work going on here, it'd be great if we could knock out a few other long-standing comprehension issues as well:
|
About #1457 and #550... Could the output be preallocated and finally resized to its final length?
Can be something like...
( |
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
This introduces the types `Generator`, which maps a function over an iterator, and `IteratorND`, which wraps an iterator with a shape tuple.
What about the following?
In this way, statistics can be easily implemented in an efficient way, for example
This is a one-liner, but it does not create any temporary arrays.
If the Cartesian iteration discussed in #1917 can be implemented, this would become even more powerful:
The text was updated successfully, but these errors were encountered: