Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Goldman
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
Pipeline
#5427
passed with stage
in 4 minutes and 44 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
iterate.lisp
View file @
b12ed599
...
@@ -2917,7 +2917,7 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
...
@@ -2917,7 +2917,7 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
;;; (REDUCING BY &optional INITIAL-VALUE INTO RESULT-TYPE)
;;; (REDUCING BY &optional INITIAL-VALUE INTO RESULT-TYPE)
(
defclause
(
reducing
expr
by
op
&optional
initial-value
(
init-val
nil
iv?
)
(
defclause
(
reducing
expr
by
op
&optional
initial-value
(
init-val
nil
iv?
)
into
var-spec
into
var-spec
result-type
(
type
(
expr-type-only
op
))
)
result-type
type
)
"Generalized reduction"
"Generalized reduction"
;; VALUE: the value accumulated so far.
;; VALUE: the value accumulated so far.
;; If we don't know the initial value, we can't use RETURN-REDUCTION-CODE.
;; 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)"
...
@@ -2933,13 +2933,14 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
:expression
expr
:expression
expr
:test
nil
:test
nil
:variable
var-spec
:variable
var-spec
:type
type
:type
(
or
type
(
expr-type-only
op
))
:accum-kind
nil
))
; matches anything
:accum-kind
nil
))
; matches anything
(
t
(
t
(
setq
expr
(
walk-expr
expr
))
(
setq
expr
(
walk-expr
expr
))
(
setq
var-spec
(
or
var-spec
*result-var*
))
(
setq
var-spec
(
or
var-spec
*result-var*
))
(
let*
((
var
(
extract-var
var-spec
))
(
let*
((
var
(
extract-var
var-spec
))
(
entry
(
make-accum-var-default-binding
var-spec
nil
(
entry
(
make-accum-var-default-binding
var-spec
nil
:using-type-of
expr
:type
type
))
:type
type
))
(
prev-first-time-var
(
third
entry
)))
(
prev-first-time-var
(
third
entry
)))
(
multiple-value-bind
(
update-code
first-time-var
)
(
multiple-value-bind
(
update-code
first-time-var
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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