[cffi-devel] :ensure-float? Was I dreaming?

Luís Oliveira luismbo at gmail.com
Wed May 17 21:11:33 UTC 2006


On 2006-maj-17, at 20:24, Ken Tilton wrote:
> 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.

Hmm, I don't remember.


> 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?

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.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/





More information about the cffi-devel mailing list