[gambit-list] Type checking

Joel J. Adamson jadamson at partners.org
Fri Jan 11 09:58:05 EST 2008


Marc Feeley <feeley at iro.umontreal.ca> writes:

> Your message prompted me to do some extensions to the FFI's foreign
> type implementation I was meaning to do for a while.

Wow --- I think I'm hooked on Gambit ;)

> On 10-Jan-08, at 10:56 AM, Joel J. Adamson wrote:
>
>> Dear Gambit List,
>>
>> I have a set of datatypes defined with c-define-type based on the GNU
>> Scientific Library.  The Gambit-C manual says "For type checking
>> on the Scheme side..." to use the TAG function of the  type definition
>> as in
>>
>> (c-define-type gsl-matrix* (pointer gsl-matrix "gsl-matrix*"))
>
> Note that your code is incorrect.  It should read
>
>   (c-define-type gsl-matrix* (pointer gsl-matrix gsl-matrix*))

Yes, I was typing it from memory; it actually reads like this:

(c-define-type gsl-matrix
	       (type "gsl_matrix"
		     gsl-matrix))
(c-define-type gsl-matrix*
	       (pointer "gsl_matrix"
			gsl-matrix*))

The only difference being the double-quotation marks around the C type;
should I not use them?

>> What is the best way to use this to define a boolean test
>> (e.g. gsl-matrix*?) for this type?
>
> The new implementation of foreign types (now in the Gambit repository)

Looks like I'll be installing Mercurial ;)

Thanks a huge bunch for your suggestions (and needless to say for
updating the code --- open source strikes again).

Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.





More information about the Gambit-list mailing list