Repository navigation
[WIP] passing top-level ReQL functions as arguments - #5673
marshall007 wants to merge 4 commits into
Conversation
|
Note that in order to implement this, I had to modify the signature of r.expr(val, nestingDepth) // before
r.expr(val, { nestingDepth, arity }) // afterI felt like this was better than adding another positional argument (ad infinitum), but it would be a breaking change. We could make it backwards-compatible by assuming a numeric argument refers to
|
|
Thanks @marshall007 . It looks really cool, but I think we should have an API discussion about this. Let me ping a few people for their opinions: @mlucy @VeXocide @deontologician @coffeemug . |
|
I'd really like to see @mlucy's opinion on this. |
|
I think it's obviously good to support queries of the form
I think maybe what we should do instead is make the server responsible for this. We can add a new optarg |
|
@mlucy very much in favor of your proposal. As I was working on this in the JS driver, it certainly occurred to me that doing this on the server would make a lot of sense. As an aside, I think we should consider generating more driver code from JSON ASTs the way @deontologician recently did for the Java driver. That way tackling and maintaining cross-cutting concerns (that can't or shouldn't be handled on the server) can still be done at a higher level. This might come into play again for something like #1190. |
|
The ruby driver already does something similar to the auto-code generation, only it dynamically generates classes and methods in memory instead of dumping them to a file and compiling them |
|
Pointing this at But actually, I'm going to close this and make an issue in the https://github.com/rethinkdb/rethinkdb-javascript repo. |
This PR lays the groundwork necessary for allowing top-level ReQL terms to be passed as arguments to other terms (see #1320). Thus far I've only updated and tested it on
r.reduce, but the following now work in the JS driver: