[cffi-devel] Re: Need foreign string method for translate-into-foreign-memory?

Liam Healy lnp at healy.washington.dc.us
Thu Oct 17 02:49:52 UTC 2013


On Wed, Oct 16, 2013 at 12:47 PM, Luís Oliveira
<loliveira at common-lisp.net> wrote:
> On Wed, Oct 16, 2013 at 4:03 PM, Liam Healy <lnp at healy.washington.dc.us> wrote:
>> Indeed, I first approached it this way. But the length needs to be
>> calculated somewhere, and making it here has the benefit of preserving
>> the arglist of translate-into-foreign-memory which is parallel to
>> translate-to-foreign by design. If you think this works, I will commit
>> it.
>
> Looking at the actual problem we're trying to solve, I think we want
> to specialise expand-to-foreign-dyn-indirect rather than
> translate-into-foreign-memory. Does that make sense?
>
> --
> Luís Oliveira
> http://kerno.org/~luis/

Yes. How does this look?

(defmethod expand-to-foreign-dyn-indirect
          (value var body (type foreign-string-type))
        (expand-to-foreign-dyn value var body type))

Liam



More information about the cffi-devel mailing list