mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
core: fix stray usage of outdated debug functionality
This commit is contained in:
parent
76d86f13e1
commit
cfee23c429
@ -41,15 +41,10 @@
|
||||
|
||||
)
|
||||
|
||||
;; HACK! This silences compiler errors about 'source-location' and 'source-path' being undefined.
|
||||
;; Actual calls to these special forms will be handled directly in the dynamic evaluator, see 'Eval.hs'.
|
||||
(defdynamic source-location [] "")
|
||||
(defdynamic source-path [] "")
|
||||
|
||||
;; Crash the program with an error message unless the expression evaluates to 'true'.
|
||||
(defmacro assert [expr]
|
||||
(list 'if (list '= true expr)
|
||||
()
|
||||
(list 'do
|
||||
(list 'println* "Assertion '" (str expr) "' failed at " (list 'source-location))
|
||||
(list 'println* (list 'fmt "Assertion '%s' failed at line %d, column %d in file %s" (str expr) (line) (column) (file)))
|
||||
'(System.exit 1))))
|
||||
|
@ -277,7 +277,7 @@
|
||||
;; Allows inclusion of C headers relative to the Carp file in which this macro is called.
|
||||
(defmacro relative-include [file]
|
||||
(list 'local-include
|
||||
(list 'Dynamic.String.join [(list 'Dynamic.String.directory (list 'source-path))
|
||||
(list 'Dynamic.String.join [(list 'Dynamic.String.directory (list 'file))
|
||||
"/"
|
||||
file])))
|
||||
|
||||
|
@ -283,10 +283,10 @@
|
||||
</h3>
|
||||
</a>
|
||||
<div class="description">
|
||||
defn
|
||||
macro
|
||||
</div>
|
||||
<p class="sig">
|
||||
(λ [a] a)
|
||||
Macro
|
||||
</p>
|
||||
<pre class="args">
|
||||
(trace x)
|
||||
|
Loading…
Reference in New Issue
Block a user