Skip to content
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

Use cl-lib function instead of cl.el #12

Merged
merged 1 commit into from Apr 2, 2017
Merged

Conversation

syohex
Copy link
Contributor

@syohex syohex commented Feb 10, 2017

And remove eval-when-compile for using cl-lib function.

And remove eval-when-compile for using cl-lib function.
Copy link
Owner

@narendraj9 narendraj9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this commit as reduce is an alias for cl-reduce. So, assuming that the latter is the recommended for newer code.

@@ -177,8 +176,8 @@ not balance at point."
(neg-amounts (seq-filter (lambda (n)
(not (< 0 n)))
amounts))
(pos-amounts-sum (reduce '+ pos-amounts :initial-value 0.0))
(neg-amounts-sum (reduce '+ neg-amounts :initial-value 0.0))
(pos-amounts-sum (cl-reduce '+ pos-amounts :initial-value 0.0))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked at the files cl-lib.el and cl-seq.el. The function cl-reduce is defined in cl-seq.el and cl-seq has not been required in cl-lib.el. How is it happening that we have cl-reduce (which is also being used by reduce) loaded when we require only cl-lib.el?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@narendraj9

Look at the bottom of the cl-lib.el, you will find the expression

(unless (load "cl-loaddefs" 'noerror 'quiet)
  ;; When bootstrapping, cl-loaddefs hasn't been built yet!
  (require 'cl-macs)
  (require 'cl-seq))

Basically it is trying to load cl-loaddefs (which in turn loads cl-seq) if that fails it loads cl-seq directly

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. So, the requires are at the end of the file. Thanks :)

@narendraj9 narendraj9 merged commit 1a36745 into narendraj9:master Apr 2, 2017
@syohex syohex deleted the cl-lib branch April 3, 2017 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants