-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate reduce
and accumulate
?
#153
Labels
breaking changes
deprecation/obsoletion
Marking things for eventual removal
simplification
Making things simpler
Comments
okamsn
added
simplification
Making things simpler
deprecation/obsoletion
Marking things for eventual removal
breaking changes
labels
Feb 2, 2023
To replace Currently, we need to do something like this: ;; => 24
;; Note that this example `reduce` doesn't currently work because `loopy-result'
;; is initialized to `nil'.
(loopy (list i '(1 2 3 4))
(reduce i #'*))
(loopy (list i '(1 2 3 4))
(set first-time t nil)
(set-accum (if first-time
i
(* i loopy-result)))) It would be better if we did something like this: (loopy (list i '(1 2 3 4))
(set-accum i (* i loopy-result)))
;; Same as above:
(loopy (list i '(1 2 3 4))
(set loopy-result i (* i loopy-result))
(finally-return loopy-result)) |
However, we can't, because it's impossible to distinguish between |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking changes
deprecation/obsoletion
Marking things for eventual removal
simplification
Making things simpler
set-accum
is the more general version of both. Thereduce
command has a sligtly different argument order compared to the function anyway.The text was updated successfully, but these errors were encountered: