[plt-scheme] Contracts on Structures vs Guards

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Jun 11 11:10:07 EDT 2009

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


Posted on the users mailing list.