plt/racket — pull request #183 by 97jaz (2012-12-03 23:54:04+00:00)
Title: fix prop:cpointer so that it works with a procedure value (as per the docs)

This is a tiny change to allow prop:cpointer to work the way the documentation says it does:

> The property value must be either an exact non-negative integer indicating an
> immutable field in the structure (which must, in turn, be initialized to a C pointer
> value), a procedure that takes the structure instance and returns a C pointer
> value, or a C pointer value.

Procedure values don't currently work. Test case:

```racket
#lang racket/base

(require ffi/unsafe)
(struct foo (ptr)
#:property prop:cpointer 0)

(define a-foo (foo (malloc 16 'raw)))
(free a-foo)

(struct bar (ptr)
#:property prop:cpointer (λ (s) (bar-ptr s)))

(define a-bar (bar (malloc 16 'raw)))
(free a-bar)
```