Re: Re: Problems with FFI

Chris Double <[email protected]> Tue, 8 Apr 2003 00:30:06 +1200
Newsgroups gmane.lisp.corman
Organization none
Message-ID <[email protected]>
On Tue, 08 Apr 2003 00:16, goobamarino wrote:
> I guess what thouroughly confuses me is the occasions when a
> declaration does look like (malloc (Sizeof 'somepointer)). 

It confused me too. Mainly because in C I'm so used to just doing:

  void* blah;
  call_some_func(&blah);

or

  void* blah = &some_other_blah;
  call_some_func(blah);

It took me awhile to understand that I have to actually allocate that pointer 
value so there is somewhere to store the result.

> Is this merely so that when the resulting (cref somepointer ptr 0) is
> called the lisp knows what to do?

No, it's just a form of documentation I guess. All foreign pointers are 
basically untyped and are really (:void *). It's cref that effectively casts 
it and works out offsets, etc.

Chris.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/VygGAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/