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

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

Re: Basic emacs lisp question


From: Emanuel Berg
Subject: Re: Basic emacs lisp question
Date: Tue, 09 Sep 2014 22:44:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ken <address@hidden> writes:

>> If you just want to store it in a variable to be
>> able to echo it (?), you can use `let' instead. It
>> has better karma than `setq'.
> Actually, my plan is to do more than just echo it. I
> want to be able to perform tests on it. I want to
> place the %% entries to the beginning of the file
> (this necessitates creating a new file and then
> renaming it to the original file name) Dates that are
> older than today, I want to move to a diary archive
> file. Weekly events will also be lumped together.
>
> Basically to place some order to the file without
> manually editing the file.

OK, well it sounds you may still be able to use let
instead of setq. If you are coming from another
language, be it C or Perl or whatever, it often looks
like this:

int yada_yada (int whatever) {
   int temp_var = whatever*2;
   int temp_var_2 = ... // etc.
}

My experience, which is totally unscientific (on the
other hand I don't know if Stalin ever read
Das Kapital) - nevertheless it seems to work great if
you just substitute all those local variables with let
(and `let*') - you get a really neat, well-defined,
all-but functional Elisp world to play with.

-- 
underground experts united


reply via email to

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