[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use Elisp to improve your Elisp - some code issues
From: |
Emanuel Berg |
Subject: |
Re: use Elisp to improve your Elisp - some code issues |
Date: |
Sun, 02 Aug 2015 02:06:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:
>> It would be more illustrative if you provide
>> a counterexample of the same construct which cannot
>> be caught by that or another regexp. It will be
>> interesting to see if that example is anything
>> I would put in my code, ever.
>
> It's easy. Try to simplify (- x x) for any sexp x,
> (assuming x doesn't side effect. Just something like
> (+ 2 y) or (+ (* a x x) (* b x) c).
...?
The example was finding (if a a b). Didn't you say
regexps couldn't identify all such cases because of
lack of expressiveness with respect to the more
expressive Lisp?
Finding (- x x) should be very easy! And
;; find (- x x) - this is line 64
(search-regexp-in-files "~/.emacs.d/emacs-init/**/*.el" "(- \\(.*\\) \\1)")
indeed shows the result:
/home/incal/.emacs.d/emacs-init/search-regexp-in-files.el (64)
(By the way, is there a less bulky way to get the
equivalence of [[:space:]\n]* (and ditto +) at all
places where the punctuation and whitespaces now serve
as delimiters?)
If you mean post-evaluation obviously regexps don't
evaluate anything and they don't know Lisp.
But if you or anyone else do this is Lisp - why not in
the byte-compiler? - and it is an improvement either
with respect to finding all occurrences *or* doing
this post-evaluation (I don't know which you mean)
then I'd use that in an instant rather than my stuff
for analyzing Elisp. I don't see how such things can
be identified post-evaluation because that depends on
evaluation, but perhaps if you only use calculation
with fixed digits it works, tho how many people do how
much of that I wonder.
--
underground experts united
http://user.it.uu.se/~embe8573
- Re: use Elisp to improve your Elisp - some code issues, (continued)
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Marcin Borkowski, 2015/08/01
- Message not available
- Re: use Elisp to improve your Elisp - some code issues, Pascal J. Bourguignon, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Marcin Borkowski, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
Re: use Elisp to improve your Elisp - some code issues, Pascal J. Bourguignon, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
- Message not available
- Message not available
- Re: use Elisp to improve your Elisp - some code issues, Pascal J. Bourguignon, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/01
- Re: use Elisp to improve your Elisp - some code issues, Robert Thorpe, 2015/08/02
- Re: use Elisp to improve your Elisp - some code issues, Pascal J. Bourguignon, 2015/08/02
- Re: use Elisp to improve your Elisp - some code issues, Emanuel Berg, 2015/08/05
- Re: use Elisp to improve your Elisp - some code issues, John Mastro, 2015/08/05
Message not availableRe: use Elisp to improve your Elisp - some code issues, Rusi, 2015/08/02
Re: use Elisp to improve your Elisp - some code issues, Michael Heerdegen, 2015/08/01
Re: use Elisp to improve your Elisp - some code issues, Sam Halliday, 2015/08/02