help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Obtaining a Lisp form from a file


From: Emanuel Berg
Subject: Re: Obtaining a Lisp form from a file
Date: Tue, 25 Jul 2017 20:22:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Udyant Wig wrote:

> Is there a better way to write this?
>
> (let ((foo-buffer (get-buffer-create "*foo*"))
> foo-form) (with-current-buffer foo-buffer
> (insert-file-contents foo-file)) (setq foo-form
> (read foo-buffer)) (kill-buffer foo-buffer)
> foo-form)

If nothing else, stop using the foobar stuff.
Always give proper names. I understand it is
just for testing but 1) it tends to make
testing worse as it decreases the mental
discipline, and 2) often enough such supposedly
testing code makes it into the real thing (or
bugs occur at the point when "OK, now it works,
let's just rename it right").

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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