Hello!
l...@gnu.org (Ludovic Courtès) writes:
(define-syntax define-wrapped-pointer-type
(lambda (stx)
(syntax-case stx ()
((_ pred wrap unwrap print) ;; hygiene
(with-syntax ((type-name (datum-syntax #'pred (gensym)))
(%wrap (datum-syntax #'wrap
On Thu 11 Nov 2010 17:24, l...@gnu.org (Ludovic Courtès) writes:
(define-wrapped-pointer-type class?
wrap-class unwrap-class print-class)
Looks great! Would be a great addition to system foreign.
(with-syntax ((type-name (datum-syntax #'pred (gensym)))
(%wrap
Hello!
I’ve used the macro below in a couple of projects. It allows the
creation of disjoint Scheme types for disjoint C pointer types, and
takes care of preserving eq?-ness for equal C pointers.
Example:
--8---cut here---start-8---
;; Create a wrapped