core: fix stray usage of outdated debug functionality

This commit is contained in:
hellerve 2018-09-19 17:53:09 +02:00
parent 76d86f13e1
commit cfee23c429
3 changed files with 4 additions and 9 deletions

View File

@ -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))))

View File

@ -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])))

View 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)