Skip to content

Instantly share code, notes, and snippets.

@fracek
Created June 12, 2014 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fracek/a0949adfcf0ea91bc3bb to your computer and use it in GitHub Desktop.
Save fracek/a0949adfcf0ea91bc3bb to your computer and use it in GitHub Desktop.
define method check-local-bindings
(description :: <project-library-description>) => ()
for-library-method (#f, $compilation of m in description)
// Accessor methods don't have a body. Without this check, for-computations
// crashes.
if (~instance?(m, <&accessor-method>))
/*
for-computations (c in m)
if (c.temporary & ~c.temporary.used? & c.temporary.named?)
let temporary-name = c.temporary.name;
let location = fragment-source-location(temporary-name);
if (location)
note(<variable-defined-but-not-used>,
source-location: location,
variable-name: temporary-name);
end if;
end if;
end for-computations;
*/
format-out("HERE\n");
for-temporaries (t in m)
format-out("%= %=\n", t.used?, t.named?);
if (~t.used? & t.named?)
let temporary-name = t.name;
let location = fragment-source-location(temporary-name);
if (location)
note(<variable-defined-but-not-used>,
source-location: location,
variable-name: temporary-name);
end if;
end if;
end for-temporaries;
end if;
end for-library-method;
end method;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment