Skip to content

Commit

Permalink
s/##vector-/##values-/g where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Dec 11, 2024
1 parent 257c06a commit c476d2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/gerbil/compiler/compile.ss
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ namespace: gxc

(def (generate-runtime-values-count var)
(def (generate-inline)
['if ['##values? var] ['##vector-length var] 1])
['if ['##values? var] ['##values-length var] 1])

;; see gambit#422
(with-inline-unsafe-primitives (generate-inline)
Expand All @@ -542,8 +542,8 @@ namespace: gxc
(def (generate-runtime-values-ref var i rest)
(def (generate-inline)
(if (and (fx= i 0) (not (stx-pair? rest)))
['if ['##values? var] ['##vector-ref var 0] var]
['##vector-ref var i]))
['if ['##values? var] ['##values-ref var 0] var]
['##values-ref var i]))

;; see gambit#422
(with-inline-unsafe-primitives (generate-inline)
Expand All @@ -555,22 +555,22 @@ namespace: gxc
(cond
((fx= i 0)
(with-inline-unsafe-primitives
['if ['##values? var] ['##vector->list var] ['list var]]
['if ['##values? var] ['##values->list var] ['list var]]
['let []
'(declare (not safe))
['if ['##values? var] ['##vector->list var] ['list var]]]))
['if ['##values? var] ['##values->list var] ['list var]]]))
((fx= i 1)
(with-inline-unsafe-primitives
['if ['##values? var] ['##cdr ['##vector->list var]] '(quote ())]
['if ['##values? var] ['##cdr ['##values->list var]] '(quote ())]
['let []
'(declare (not safe))
['if ['##values? var] ['##cdr ['##vector->list var]] '(quote ())]]))
['if ['##values? var] ['##cdr ['##values->list var]] '(quote ())]]))
(else
(with-inline-unsafe-primitives
['##list-tail ['##vector->list var] i]
['##list-tail ['##values->list var] i]
['let []
'(declare (not safe))
['##list-tail ['##vector->list var] i]]))))
['##list-tail ['##values->list var] i]]))))

(def (generate-runtime-lambda% self stx)
(ast-case stx ()
Expand Down
10 changes: 5 additions & 5 deletions src/gerbil/runtime/eval.ss
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace: #f
(error (if (fx< count k)
"Too few values for context"
"Too many values for context")
(if (##values? obj) (##vector->list obj) obj)
(if (##values? obj) (##values->list obj) obj)
k))))

(def (__compile stx)
Expand Down Expand Up @@ -114,7 +114,7 @@ namespace: #f
(lambda (id k)
(and (__AST-e id)
(__SRC
`(define ,(__SRC id) (##vector-ref ,tmp ,k))
`(define ,(__SRC id) (##values-ref ,tmp ,k))
stx)))
ids (iota len)))
stx)))))))
Expand Down Expand Up @@ -263,7 +263,7 @@ namespace: #f
(foldr (lambda (hd r)
(match hd
([id . k]
(cons `(,id (##vector-ref ,tmp ,k)) r))))
(cons `(,id (##values-ref ,tmp ,k)) r))))
bind init)))
(else
(__SRC
Expand Down Expand Up @@ -337,7 +337,7 @@ namespace: #f
(foldr (lambda (hd r)
(match hd
([id . k]
(cons `(set! ,id (##vector-ref ,tmp ,k)) r))))
(cons `(set! ,id (##values-ref ,tmp ,k)) r))))
bind init)))
(else
(__SRC
Expand Down Expand Up @@ -416,7 +416,7 @@ namespace: #f
(match hd
([id . k]
(__SRC
`(set! ,id (##vector-ref ,tmp ,k))
`(set! ,id (##values-ref ,tmp ,k))
stx))))
init))
stx)
Expand Down

0 comments on commit c476d2f

Please sign in to comment.