emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can the byte-compiler check whether functions passed by name are def


From: Klaus-Dieter Bauer
Subject: Re: Can the byte-compiler check whether functions passed by name are defined?
Date: Wed, 7 Aug 2013 21:59:01 +0200

2013/8/7 Stefan Monnier <address@hidden>:
>> The patch only adds a single line of code to byte-compile-normal-call
>> which calls defun byte-compile--higher-order--check-arguments.
>
> But there's no normal call in (if a #'foo1 #'foo2), so how can this work?
>
>
>         Stefan

Good point. It does though.

Input file:
--------------------------------------------------
;; -*- 
mode:emacs-lisp;coding:utf-8-unix;lexical-binding:t;byte-compile-dynamic:t;
-*-

(funcall (if t #'foo) "Hello World")
--------------------------------------------------

Compiler Log:
--------------------------------------------------
Compiling file c:/tmp/id1379159421d7d15c.el at Wed Aug  7 21:53:58 2013

In end of data:
id1379159421d7d15c.el:4:1:Warning: the function `foo' is not known to be
    defined.
--------------------------------------------------

I guess the use of the function just doesn't match its name?

  - Klaus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]