[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: |
Mon, 5 Aug 2013 20:17:51 +0200 |
2013/8/5 Stefan Monnier <address@hidden>:
>> (mapcar (if flag 'f1 'f2) list)
>> => (mapcar (if flag #'f1 #'f2) list)
>
> No, I definitely don't want to get into such fanciness.
> But I do want compiler warnings if the coder writes
>
> (mapcar (if flag #'f1 #'f2) list)
>
> and `f1' or `f2' are unknown.
My code does that and indeed that was, what I first implemented. I
then added the second check, where (quote f1) is handled for functions
known to be higher-order.
>> Shouldn't the markup for user-written functions be a bit easier?
>
> I'm not too worried about it, no. We should instead aim to teach people
> to write #'foo instead of 'foo.
I am not sure about that... On the one hand, I see your point, since
consistently writing #'function is better for the byte compiler, as in
the (if flag #'f1 #'f2) form; If #'f1 is the standard method people
will write (if flag 'f1 'f2) and not get a warning.
On the other hand though, subjectively, #'f1 is a huge deal more
visual clutter and somewhat awkward to type (on a German keyboard at
least). Might be just a training effect, but I also feel that the
hash-quote sequence moves the attention away from the function name,
while 'f1 does not (or #f1, '#f1 for that matter, but those are not
elisp).
- Klaus
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/01
- Re: Can the byte-compiler check whether functions passed by name are defined?, Klaus-Dieter Bauer, 2013/08/04
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/04
- Re: Can the byte-compiler check whether functions passed by name are defined?, Klaus-Dieter Bauer, 2013/08/05
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/05
- Re: Can the byte-compiler check whether functions passed by name are defined?,
Klaus-Dieter Bauer <=
- Re: Can the byte-compiler check whether functions passed by name are defined?, Klaus-Dieter Bauer, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Klaus-Dieter Bauer, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Glenn Morris, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Glenn Morris, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/07
- Re: Can the byte-compiler check whether functions passed by name are defined?, Klaus-Dieter Bauer, 2013/08/08
- Re: Can the byte-compiler check whether functions passed by name are defined?, Stefan Monnier, 2013/08/08