On 9/1/06, Will M Farr <[EMAIL PROTECTED]> wrote:
Hello all,
So, I was wrong about the unsafe vector-ref in Chicken---it doesn't
check indices or types. But, structure getters and setters do check
types even in unsafe mode. The attached patch against the current
darcs repository (i.e. darcs patch, not diff patch) implements type-
checks for struct getters and setters using (ensure ...), so they
will compile into nothing in unsafe mode. Kon tells me that the misc-
extn egg already has such a define-record-type macro, so maybe
there's a reason this isn't already in the main distribution---if so,
just ignore it :).
Thanks, I've added the patch. The expansion of the structure accessor
checks are a bit expensive, so I've modified them slightly, since "ensure"
also expands into error-message output, etc.
Of interest may also be the "##core#check" special form, which expands
into "#t" in unsafe mode (otherwise it just returns its argument).
cheers,
felix
--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users