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

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

Re: Is it necessary to reset or clear the global variables ?


From: Kevin Rodgers
Subject: Re: Is it necessary to reset or clear the global variables ?
Date: Tue, 14 Dec 2010 21:44:51 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 11/26/10 6:39 PM, Fren Zeee wrote:
Friends,

I am trying to modify or improve an existing lisp function written by
myself a few years ago. I have observed that when I run it on the test
data after some modification, it appears to run because the global
variables have old value and some regular expression or result did not
produce a nil or did produce a nil which resulted in the failure of
the function to die or crash during execution.

A standard method is to reset all global variables.

As a newbie, I ask you to provide me with advice on what is a good
practice.

If you do not need to persist state across calls to the function, do
not use global variables.  Passing state information to the function
via its arguments is better than accessing it via global variables.

Franz Xe

P.S. Is the word persistence an accurate term to describe this
disease ?

Persistence is neither diseased nor healthy.

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

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