Skip to content

Commit

Permalink
Merge branch 'jpellegrini-compiler-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
egallesio committed Sep 11, 2023
2 parents 70f93fc + c990b34 commit 9db367a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/compiler.stk
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
; ======================================================================

;; The global variable *code-constants* contains a list of constants for the
;; code being compiled.
;; code being compiled.
;; Why is its index not also kept in the list? Because the index is the position
;; of the element in the list, and it's calculated when the compiler calls this
;; function (fetch-constant).
Expand Down Expand Up @@ -1785,12 +1785,22 @@ doc>


;; ======================================================================

;; Compiles access to a symbol in the SCHEME module, using a special
;; VM instruction INSCHEME:
;;
;; (%%in-scheme x) =>
;; GLOBAL-REF 0
;; INSCHEME
;;
;; Constants:
;; 0: x
(define (compile-in-scheme e env tail)
(if (= (length e) 2)
(begin
(compile (cadr e) env (cadr e) tail)
(emit 'INSCHEME))
(compiler-error '%%in-scheme "expected one argument")))
(compiler-error '%%in-scheme e "expected one argument")))

;;;;======================================================================
;;;;
Expand Down

0 comments on commit 9db367a

Please sign in to comment.