From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: eval-when-load? Date: Thu, 16 Jul 2015 11:33:40 -0500 Message-ID: <86fv4ohxjv.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437064488 23979 80.91.229.3 (16 Jul 2015 16:34:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 16:34:48 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 16 18:34:33 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZFm7F-0005pn-KY for ged-emacs-devel@m.gmane.org; Thu, 16 Jul 2015 18:34:33 +0200 Original-Received: from localhost ([::1]:41074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFm7F-000885-1Z for ged-emacs-devel@m.gmane.org; Thu, 16 Jul 2015 12:34:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFm70-00087u-Th for emacs-devel@gnu.org; Thu, 16 Jul 2015 12:34:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFm6v-0005gW-QS for emacs-devel@gnu.org; Thu, 16 Jul 2015 12:34:18 -0400 Original-Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:58901) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZFm6v-0005di-Iq for emacs-devel@gnu.org; Thu, 16 Jul 2015 12:34:13 -0400 Original-Received: (qmail 28555 invoked by uid 0); 16 Jul 2015 16:34:05 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy9.mail.unifiedlayer.com with SMTP; 16 Jul 2015 16:34:05 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw2 with id t4SK1q00q2UdiVW014SN8G; Thu, 16 Jul 2015 10:26:29 -0600 X-Authority-Analysis: v=2.1 cv=ItWNLtPg c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=9i_RQKNPAAAA:8 a=y7kgw_RnJtkA:10 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=zOBTXjUuO1YA:10 a=Nb9QMp2T_7A5EIxsIL4A:9 Original-Received: from [76.218.37.33] (port=52925 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZFm6c-0006sH-T2 for emacs-devel@gnu.org; Thu, 16 Jul 2015 10:33:55 -0600 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.20.122 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187902 Archived-At: A project I'm working on has a form like this at top level in a file: (defvar jde-jdhelper-singleton (jde-jdhelper nil) "The JDHelper singleton instance.") `jde-jdhelper' can throw an error, which it does during byte-compile (it complains about not finding "wget"). We want the variable defined at load time, and we want the error at load time, but we don't care at compile time. So I'd like to do: (eval-when-load (defvar jde-jdhelper-singleton (jde-jdhelper nil) "The JDHelper singleton instance.")) but `eval-when-load' is not defined. Is there a work-around? We could change the var to a function that checks if the initialization is done, but that seems a heavy solution. -- -- Stephe