[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ann]: An Implementation of the Shen programming language in Elisp a
Re: [Ann]: An Implementation of the Shen programming language in Elisp and a call for help
Mon, 16 May 2016 13:54:01 -0400
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
[ I thought I had sent a reply but I can't see it, so here's another one. ]
> However I could use some help with a couple of issues with packaging and
> warnings generated by the byte-compiler:
> 1. I can't seem to get rid of warnings when byte-compiling the generated
> "shen.el"  even though I have the byte-compile-warnings property the top
> of the file. I'm getting a lot of "unused lexical variable" warnings even
> though "lexical" is in the list of warnings.
I recommend you don't touch byte-compile-warnings. Instead, handle each
warning individually. For "unused var" warnings, you have various options
(by order of preference):
1- Get rid of the variable.
2- Add an underscore at the beginning of the var's name. This tells the
compiler that this variable *should* not be used.
3- Add an artificial use of the var. Typically a call to `ignore', as in:
(defun toto (arg1)
(let ((var2 val))
(ignore arg1 var2)
This is usually the best way to deal with non-hygienic vars
introduced in macros where we can't tell if the macro's expansion
will or will not make use of the variable.
4- Add a (defvar <thevar>) to indicate the variable should use dynamic scoping.
> 2. I would like for the "shen.el" and "shen-primitives.el"  file to be
> byte-compiled and loaded right after compilation even though they don't
> have any autoloads. Currently they are only loaded with I call the function
> `shen/repl`  which doesn't feel very responsive. Ideally they are loaded
> at the time they are compiled.
I don't understand, sorry: in my context, compilation takes place once and
for all when you install the package, so loading it at that time wouldn't
help all the other times when I use the package without first
byte-compiling it (because it's already byte-compiled).
Could you explain in more details what's your use-case or scenario?