-
Notifications
You must be signed in to change notification settings - Fork 65
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
Call-coalton-function bug/awkwardness #1042
Comments
Regarding your last sentence, yes please do make a separate issue. |
That is the expected behavior. Also you don't need |
Sounds good, thanks for looking this over. I'll weave some of these cases/behavior into the interop docs. One last case/question: When calling a top-level coalton function with a parameter in lisp, is the example below the ideal/preferred/expected syntax:
I figured the main advantage to |
You can just call it directly:
The point of |
I'm afraid that solution doesn't work on my machine, though maybe it's something in my implementation. Compiling
Returns the error
Fixing that warning by wrapping it in coalton:
Returns
Which is how I ended up at my example above, I'd like to reiterate, I'm not really poking into this because I need this personally, or even that I think it's broken. There are enough ways to get around this with little hacks, but I just want to clarify behavior so that it can be defined clearly in documentation. |
Oh yeah. If your function has type class constraints then you can't call it from lisp, you need to use the The "fix" is to define:
Then |
Awesome, thank you, that one works perfectly. I'm going to add a few of these cases to the docs in the next few days, thank you for the clarity! |
Note: This is probably less of a bug and more of an instance of awkward behavior that should be documented.
Calling a Coalton function with
call-coalton-function
only works if the called function is defined in a separatecoalton-toplevel
.call-coalton-function
is currently wholly omitted from coalton-lisp-interop.md. I'm happy to add documentation, especially if this is determined to be the working behavior of thecall-coalton-function
.Also, it's probably been discussed, but none of the Coalton-Lisp bridge functions are documented in the reference, and I feel like they're very much part of the Coalton workflow. I can make a separate issue if others agree.
The text was updated successfully, but these errors were encountered: