-
Notifications
You must be signed in to change notification settings - Fork 3
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
ctype= Returns nil with Keyword Parameters #18
Comments
You have the rest type as bottom, which is probably not correct. Since the function takes keywords, any type of argument can be validly provided in the rest list (if only through |
I thought rest type should be bottom to indicate that there is not rest parameter (no &rest in lambda-list). Are you saying that it should not be the bottom since &key comes after &rest? These functions I'm talking about don't have &allow-other-keys. |
a rest type of bottom indicates that that the function is not passed arguments other than required and optional. so if the rest type is bottom, keyword arguments, which are not required or optional, cannot be accepted. if the function accepts keywords the rest type should be top. function types are not strictly related to the lambda list of the function: they just describe what calls are valid. It is also permissible to declare local function types that describe calls without bothering with what the function actually accepts. For example you could have I was referring to |
That is all really interesting and makes perfect sense now. Except when I inspect
It looks to me like the rest is |
It's quite possible keyword parameter types are in fact broken. I have not used this library as thoroughly as I had hoped. I might be able to take a look tomorrow. |
okay, yeah, somewhat more fundamental problem is that I did not implement function type subtypep in the presence of keyword types: https://github.com/s-expressionists/ctype/blob/main/cfunction.lisp#L42-L44 |
That looks a bit funky to me. Similar experiments work for required, optional, and rest style parameters. Is there something I'm missing when it comes to the keyword parameters?
The text was updated successfully, but these errors were encountered: