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

Fix byte compiler warnings #18

Merged
merged 6 commits into from Aug 30, 2013
Merged

Fix byte compiler warnings #18

merged 6 commits into from Aug 30, 2013

Conversation

@Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Aug 30, 2013

No functionality changes, just fixing byte compiler warnings.

@kans
Copy link
Member

@kans kans commented Aug 30, 2013

This looks great! We really don't know how to write idiomatic elisp. We'll also put you up on our credits page.

Loading

kans added a commit that referenced this issue Aug 30, 2013
Fix byte compiler warnings
@kans kans merged commit dd8ffde into Floobits:master Aug 30, 2013
@Wilfred
Copy link
Contributor Author

@Wilfred Wilfred commented Sep 2, 2013

Glad to help. I was just kicking the tires on floobits and thought I'd contribute as I was passing through.

FWIW, be careful writing functions like this:

(defun foobar (x)
  (setq y (+ x 1))
  y)

This is leaking a variable, it's equivalent to the JavaScript:

function foobar(x) {
    y = x + 1;
    return y;
}

You can introduce local bindings with let:

(defun foobar (x)
  (let ((y (+ x 1)))
    y))

These issues are easy to spot with the byte-compiler, or you can even install flycheck and it will check your code as you type.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants