Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Eric Timmons
iterate
Commits
b12ed599
Commit
b12ed599
authored
Aug 20, 2021
by
Phoebe Goldman
Browse files
more precise type constraints in REDUCING
this better matches previous behavior when RESULT-TYPE is not supplied.
parent
b6b7d821
Changes
1
Hide whitespace changes
Inline
Side-by-side
iterate.lisp
View file @
b12ed599
...
...
@@ -2917,7 +2917,7 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
;;; (REDUCING BY &optional INITIAL-VALUE INTO RESULT-TYPE)
(
defclause
(
reducing
expr
by
op
&optional
initial-value
(
init-val
nil
iv?
)
into
var-spec
result-type
(
type
(
expr-type-only
op
))
)
result-type
type
)
"Generalized reduction"
;; VALUE: the value accumulated so far.
;; If we don't know the initial value, we can't use RETURN-REDUCTION-CODE.
...
...
@@ -2933,13 +2933,14 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
:expression
expr
:test
nil
:variable
var-spec
:type
type
:type
(
or
type
(
expr-type-only
op
))
:accum-kind
nil
))
; matches anything
(
t
(
setq
expr
(
walk-expr
expr
))
(
setq
var-spec
(
or
var-spec
*result-var*
))
(
let*
((
var
(
extract-var
var-spec
))
(
entry
(
make-accum-var-default-binding
var-spec
nil
:using-type-of
expr
:type
type
))
(
prev-first-time-var
(
third
entry
)))
(
multiple-value-bind
(
update-code
first-time-var
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment