Good point. This is all achievable with the cond-expand approach, the compiler can accept a flag to explicitly disable contract checks.

-- vyzo

On Wed, Nov 27, 2019 at 4:45 PM Marc Feeley <feeley@iro.umontreal.ca> wrote:

> On Nov 27, 2019, at 9:10 AM, Dimitris Vyzovitis <vyzo@hackzen.org> wrote:
>
> When the compiler detects that it is in a safe context (absence of a local or prelude (not safe) declaration), then it
> can emit a (define-cond-expand-feature|gerbil-runtime-checks|) for gsc, and compile in the contract checks.
>

BTW I don’t think you should conflate the presence of a (not safe) declaration and avoiding contract checks.  The two are closely related, but maybe you want finer control to disable them separately.

Marc