mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-17 08:27:45 +03:00
Added dynamic function 'Project.no-echo' to disable echoing in examples.
This commit is contained in:
parent
8928b10aa4
commit
669aca2b96
@ -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))))
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
(use Float)
|
||||
(use Array)
|
||||
(use IO)
|
||||
(Project.no-echo)
|
||||
|
||||
(defn fib [n]
|
||||
(if (< n 2)
|
||||
|
@ -1,4 +1,5 @@
|
||||
(local-include "../examples/banana.h")
|
||||
(Project.no-echo)
|
||||
|
||||
(register-type Apple)
|
||||
(register-type Banana [price Double, size Int])
|
||||
|
@ -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))
|
||||
|
@ -1,3 +1,4 @@
|
||||
(Project.no-echo)
|
||||
(Debug.sanitize-addresses)
|
||||
|
||||
(Project.config "print-ast" true)
|
||||
|
@ -1,6 +1,7 @@
|
||||
(use IO)
|
||||
(use Int)
|
||||
(use Array)
|
||||
(Project.no-echo)
|
||||
|
||||
(definterface fmap (λ [(λ [a] a) b] b))
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
(Debug.sanitize-addresses)
|
||||
(Project.no-echo)
|
||||
(use Array)
|
||||
|
||||
(deftype (Trivial t) [x t])
|
||||
|
@ -1,4 +1,4 @@
|
||||
(Project.config "print-ast" true)
|
||||
(Project.no-echo)
|
||||
(Debug.sanitize-addresses)
|
||||
|
||||
(def s "I'm a global string...")
|
||||
|
@ -1,5 +1,7 @@
|
||||
(load-and-use SDL)
|
||||
|
||||
(Project.config "title" "Minimal")
|
||||
|
||||
(defn tick [state]
|
||||
(+ state 10))
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
(Project.no-echo)
|
||||
|
||||
(defn changing-target-of-ref []
|
||||
(let [s1 @"hello"
|
||||
s2 @"goodbye"
|
||||
|
@ -1,4 +1,5 @@
|
||||
(use Array)
|
||||
(Project.no-echo)
|
||||
|
||||
(deftype Age [x Int])
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user