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
Add a ReQL command to interate over an array. #2574
Comments
I agree. However, I think the name I think, also, an However, if we wanted an infinitely-generating Also, Also, note that parallel-map only makes sense on arrays and other ordered sequences, but not on unordered result sets like an |
Ruby has an |
I think it might be bad. Unknown unknowns. Instead of a two-argument map, we might just want a plain parallel-merge function that takes two sequences and merges them into a sequence of objects |
Too bad we already use |
I'm putting this in subsequent since @coffeemug is out of town and I don't want to forget about it. |
Actually, moving this into 1.14. We might not get to it, but I'd like to talk about it this proposal-cycle because it's a major thing people can't do right now (I just saw another example of this today). |
Moving to 1.14-polish. This isn't as important as major features, and I'd like to agree on those first. We can tackle this later. |
What is the chance that we will find it in 1.14? For now list manipulation is really awkward. |
This work around is quite verbose, but I can't think of something better:
|
Here is what I think a full proper solution to this would be:
Of course we don't have to wait for the early steps to do the last step. I'll see if we can get this into the next release. |
Will be great. I think people more and more relay on a database code (to go around consistency limits). In our project we are sometimes making a temporary solutions and waiting for more sophisticated ways to manipulate documents to keep some level of consistency. |
Other useful use case might be a Map
|
@robert-zaremba -- to map over the keys, you can for now do
|
+1 |
👍 |
When we can expect this feature? |
@robert-zaremba: my buest guess is "either in the next release or the one after". |
Grabbing this one, thus with a little luck it should make it into 1.16. |
Alright, an update: since |
We're currently implementing Since we can't trivially check the arity of a JS function the only option was to always pass the extra index stream, and JS will happily ignore it when it's superfluous. This would mean that every Additionally, adding this functionality at a later date won't break backwards compatibility thus we're holding off on it for the moment. |
In JavaSript, you can check the number of arguments with
In CoffeeScript, you can use |
The arity problem shows up in Lua as well. I am using the number of arguments to |
@neumino The problem here is actually determining the number of arguments from a string passed into |
@danielmewes -- Angular calls (used to?) |
In CR 2200 by @gchpaco. |
I'll create a new issue for the implicit index, this clearly needs to be given some more thought. |
@neumino @danielmewes in JavaScript, a function's (function (x, c) { return "How many arguments does this function have?"; }).length // => 2 |
Maybe the option will be, as discussed above, to add other function with explicit argument ( |
Merged into |
The use case is to map values of an array knowing both index of an element and element itself.
Let's say we want to merge two arrays by summing appropriate elements, something we could do in Python:
Some idea might be:
The text was updated successfully, but these errors were encountered: