[emacs-w3m:13824] Re: [emacs-w3m/emacs-w3m] Replace obsolete forms (#101)
yamaoka <[email protected]> Thu, 05 Aug 2021 16:27:04 -0700
| Newsgroups | gmane.emacs.w3m |
|---|---|
| Message-ID | <emacs-w3m/emacs-w3m/pull/101/[email protected]> |
> I also see usage of function 'inline' whichsee docstring explicitly says "You don't need this."
Yes, you don't need this if running the ELisp code without byte-compiling. But when the code is compiled into elc, a function surrounded in `inline` will be replaced in the byte-code with its function definition itself, while compiled into the code equivalent to `(funcall function-name)` if it is not inlined.
```
(byte-compile
(lambda (url)
(inline (w3m-cache-remove-1 url))))
=> #[257 "\211\302^A^H\"\303\211^B\205/^@\304^C@ \"\210^BA@\211\262^C^CAA\211\26\
2^C|\210^A\303\211\223\210\211\303\211\223\210\305^C^H\"\211^P\207" [w3m-cache-\
articles w3m-cache-hashtb assoc nil remhash delq] 8 "
(fn URL)"]
(byte-compile
(lambda (url)
(w3m-cache-remove-1 url)))
=> #[257 "\300^A!\207" [w3m-cache-remove-1] 3 "
(fn URL)"]
```
Using `inline` makes a byte-code faster, so we use `inline` if the code often or repeatedly runs.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/emacs-w3m/emacs-w3m/pull/101#issuecomment-893888079