Yo, dawgs! Lissen up... sorry, too much American Idol.
Here's the deal. One of my bindings was not working because the parameter was float and I was passing a fixnum. Coerced to a float and all was groovy. Two things:
1. Minor question: I coulda swore the first time I fixed this I dug around and discovered :ensure-float and used that in my DEFCFUN. The second time I ran into it I went looking for :ensure-float and could not find it. Found :ensure-XXX for a couple other things in the UFFI-compat bit. Maybe it was one of the XXXs. No big.
2. Am I missing something? Is there some reason we cannot have an ensure-float? Is it one of those deals where for some obscure reason unbeknownst to me there is no reliable way to guess what is needed and programmers need to Just Provide the Right Type?
thx, kenny
On 2006-maj-17, at 20:24, Ken Tilton wrote:
- Minor question: I coulda swore the first time I fixed this I dug
around and discovered :ensure-float and used that in my DEFCFUN. The second time I ran into it I went looking for :ensure-float and could not find it. Found :ensure-XXX for a couple other things in the UFFI-compat bit. Maybe it was one of the XXXs. No big.
Hmm, I don't remember.
- Am I missing something? Is there some reason we cannot have an
ensure-float? Is it one of those deals where for some obscure reason unbeknownst to me there is no reliable way to guess what is needed and programmers need to Just Provide the Right Type?
We define ensure-float and ensure-double in cl-opengl, seems to work pretty well. I think a :coerce type would be interesting:
(:coerce <type>)
I haven't thought about which (primitive) types this would make sense for or how hard this type should try to convert things.