chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Patch for unsafe structure getters and setters


From: felix winkelmann
Subject: Re: [Chicken-users] Patch for unsafe structure getters and setters
Date: Sat, 2 Sep 2006 16:20:59 +0200

On 9/1/06, Will M Farr <address@hidden> 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




reply via email to

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