unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [Ann]: An Implementation of the Shen programming language in Elisp and a call for help
Date: Mon, 16 May 2016 13:54:01 -0400	[thread overview]
Message-ID: <jwv1t51zyij.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAJrReyi7YiyjCELAu8hMNyhfuh9m6BgfH0fqYgtm04UWbjevwg@mail.gmail.com

[ 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" [4] 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" [5] 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` [6] 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?


        Stefan




      parent reply	other threads:[~2016-05-16 17:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 21:01 [Ann]: An Implementation of the Shen programming language in Elisp and a call for help aditya siram
2016-05-14  1:08 ` Alexis
2016-05-14  1:11   ` aditya siram
2016-05-14  1:30     ` Alexis
2016-05-14  1:41 ` Michael Heerdegen
2016-05-14 13:29 ` Stefan Monnier
2016-05-16 17:54 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv1t51zyij.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).