diff --git a/core/Dynamic.carp b/core/Dynamic.carp index 5c8fbf9b..7a873c68 100644 --- a/core/Dynamic.carp +++ b/core/Dynamic.carp @@ -7,6 +7,13 @@ (defdynamic dec [x] (- x 1)) + (defmodule Project + (doc no-echo "Turn off debug printing in the compiler.") + (defdynamic no-echo [] + (do + (Project.config "print-ast" false) + (Project.config "echo-compiler-cmd" false)))) + ) diff --git a/examples/basics.carp b/examples/basics.carp index d78c2f5d..ce39d1d6 100644 --- a/examples/basics.carp +++ b/examples/basics.carp @@ -3,6 +3,7 @@ (use Float) (use Array) (use IO) +(Project.no-echo) (defn fib [n] (if (< n 2) diff --git a/examples/external_struct.carp b/examples/external_struct.carp index dc9a22e8..c5cb6d9a 100644 --- a/examples/external_struct.carp +++ b/examples/external_struct.carp @@ -1,4 +1,5 @@ (local-include "../examples/banana.h") +(Project.no-echo) (register-type Apple) (register-type Banana [price Double, size Int]) diff --git a/examples/fonts.carp b/examples/fonts.carp index 580fd721..c2334f9f 100644 --- a/examples/fonts.carp +++ b/examples/fonts.carp @@ -2,6 +2,7 @@ (load "SDL_ttf.carp") ;;(Debug.sanitize-addresses) +(Project.config "title" "Fonts") (def font (the (Ptr TTF_Font) NULL)) (def text1 (the (Ptr SDL_Texture) NULL)) diff --git a/examples/function_members.carp b/examples/function_members.carp index 69f2bbdf..a427dfcd 100644 --- a/examples/function_members.carp +++ b/examples/function_members.carp @@ -1,3 +1,4 @@ +(Project.no-echo) (Debug.sanitize-addresses) (Project.config "print-ast" true) diff --git a/examples/functor.carp b/examples/functor.carp index 4645c65a..2149c483 100644 --- a/examples/functor.carp +++ b/examples/functor.carp @@ -1,6 +1,7 @@ (use IO) (use Int) (use Array) +(Project.no-echo) (definterface fmap (λ [(λ [a] a) b] b)) diff --git a/examples/generic_structs.carp b/examples/generic_structs.carp index a0f0c96e..d392b119 100644 --- a/examples/generic_structs.carp +++ b/examples/generic_structs.carp @@ -1,4 +1,5 @@ (Debug.sanitize-addresses) +(Project.no-echo) (use Array) (deftype (Trivial t) [x t]) diff --git a/examples/globals.carp b/examples/globals.carp index 0f099e95..2985b1e8 100644 --- a/examples/globals.carp +++ b/examples/globals.carp @@ -1,4 +1,4 @@ -(Project.config "print-ast" true) +(Project.no-echo) (Debug.sanitize-addresses) (def s "I'm a global string...") diff --git a/examples/minimal_sdl.carp b/examples/minimal_sdl.carp index 130f36ad..0db5975e 100644 --- a/examples/minimal_sdl.carp +++ b/examples/minimal_sdl.carp @@ -1,5 +1,7 @@ (load-and-use SDL) +(Project.config "title" "Minimal") + (defn tick [state] (+ state 10)) diff --git a/examples/setting_variables.carp b/examples/setting_variables.carp index 369953fb..0572e8ca 100644 --- a/examples/setting_variables.carp +++ b/examples/setting_variables.carp @@ -1,3 +1,5 @@ +(Project.no-echo) + (defn changing-target-of-ref [] (let [s1 @"hello" s2 @"goodbye" diff --git a/examples/sorting.carp b/examples/sorting.carp index c1b5644c..3edd975f 100644 --- a/examples/sorting.carp +++ b/examples/sorting.carp @@ -1,4 +1,5 @@ (use Array) +(Project.no-echo) (deftype Age [x Int]) diff --git a/examples/updating.carp b/examples/updating.carp index 3263fad1..53e0fc54 100644 --- a/examples/updating.carp +++ b/examples/updating.carp @@ -1,6 +1,7 @@ ;; A slightly bigger example of how to work with structs and arrays that change (use IO) +(Project.no-echo) (deftype Pos [x Float