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

Conversation

Projects
None yet
2 participants
@Wilfred
Contributor

Wilfred commented Aug 30, 2013

No functionality changes, just fixing byte compiler warnings.

@kans

This comment has been minimized.

Member

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.

kans added a commit that referenced this pull request Aug 30, 2013

Merge pull request #18 from Wilfred/master
Fix byte compiler warnings

@kans kans merged commit dd8ffde into Floobits:master Aug 30, 2013

@Wilfred

This comment has been minimized.

Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment