[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

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?


Paulo Jorge Matos - pocmatos at gmail.com

Posted on the users mailing list.