chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] minor note for manual on (define-foreign-record)


From: Daniel B. Faken
Subject: [Chicken-users] minor note for manual on (define-foreign-record)
Date: Thu, 28 Jul 2005 12:27:43 -0400 (EDT)

Hi,

  The manual should probably note that recursive definitions don't work.
E.g. in this code:   (the structure is part of 'chromium')
--------------------------------------------------------------------
(define-foreign-record (SPU "struct _SPUSTRUCT")
  [(const c-string) name] [(const c-string) super_name]
  [(const int) id]
  [integer spu_flags]    ;; mutable, but take care!
;  [(const SPU) superSPU]
;  [(const (c-pointer (struct "_SPUSTRUCT"))) superSPU]
  [c-pointer privatePtr] ;; likewise
  )

(define SPU-superSPU
  (foreign-primitive SPU ([SPU spu]) "return(spu->superSPU);") )
--------------------------------------------------------
..neither of the commented-out versions of the field for 'superSPU' don't 
work (in the sense that I get garbage when I call SPU-superSPU -- unless I
use the foreign-primitive version).

cheers,
Daniel







reply via email to

[Prev in Thread] Current Thread [Next in Thread]