-
Notifications
You must be signed in to change notification settings - Fork 15
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
Multiple arguments vs Tupled Functions #22
Comments
Why do you need this? |
I'm trying to find an example in the JS-Scala library but the section I could find is CPS, for example Cell's get method:
If this were a Cell of type (A, B) the lambda that would eventually be passed to get would be compiled as a function with 2 arguments instead of a function with 1 tuple argument wouldn't it? If that's not true then my argument is invalid and all is well ^^. Something like this can come up more often when wrapping existing polymorphic Javascript libraries, anytime a tuple is used the lambda would be compiled into the wrong format. |
I think you are right. Please raise an issue on the LMS repository. |
Will do, as soon as I have an contained example of the issue. |
I'm running into some kind of a problem here.
LMS defines the TupledFunctions as a way to work with lambda's with multiple arguments. So the lambda conversion is done by packing the arguments into a tuple at language level and then unpacking them in the corresponding generators..
This removes the ability to reason about lambdas with multiple arguments and lambdas with 1 tuple argument separately which might be okay for small DSLs but I'm not sure if this would be intended behavior for a DSL that aims to provide most of Javascript's functionality.
So, is this a bug or intended behavior? If so how do we fix it (I'm perfectly willing to look for a solution with you), if not, what is the intended work-around? Seeing as Javascript doesn't have tuples maybe removing the tuple functionality and strictly working with Structs or Adts is sufficient?
Thanks!
The text was updated successfully, but these errors were encountered: