[plt-scheme] Contracts on Structures vs Guards

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jun 11 16:23:35 EDT 2009


On Jun 11, 2009, at 11:10 AM, Paulo J. Matos wrote:

> Hi all,
> I am wondering if there is any difference performance-wise between
> defining a guard on a structure and defining a contract on the
> structure.
> I am I correct to say that the contract on the structure is only
> checked in module boundaries while guards are always checked when the
> structure is built and therefore having contracts would always be at
> least as fast as guards (when assuming that guards are only used to
> check the types of values)?
> Contracts are also probably the recommended style, right?
> Cheers,
> -- 
> Paulo Jorge Matos - pocmatos at gmail.com
> http://www.pmatos.net
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.