Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Local static variables.

0 views
Skip to first unread message

Tom Enebo

unread,
May 11, 1993, 4:46:39 PM5/11/93
to

SOS,

I would like to be able to define a variable in Emacs-Lisp that
is local to a function, but does not lose it's value when the functions
exits. I know I can create a local variable via let, but any local
variables within let are disposed upon exit of let.

Any suggestions are welcome,

-Tom
------------------------------------------------------------------
Thomas E Enebo (CIS, User Services) en...@staff.tc.umn.edu
--
------------------------------------------------------------------
Thomas E Enebo (CIS, User Services) en...@staff.tc.umn.edu
$|=1;for("!","E","M","O","T"){print $l=$_.$l,"\015";sleep 1;}

Barry Margolin

unread,
May 12, 1993, 4:52:25 PM5/12/93
to
In article <C6vr3...@news.cis.umn.edu> en...@staff.tc.umn.edu (Tom Enebo) writes:
> I would like to be able to define a variable in Emacs-Lisp that
>is local to a function, but does not lose it's value when the functions
>exits. I know I can create a local variable via let, but any local
>variables within let are disposed upon exit of let.

You can't do this in Emacs Lisp, it doesn't have local static variables or
lexical closures. You have to use a global variable.
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

Always a rainbow

unread,
May 12, 1993, 11:18:35 PM5/12/93
to
In article <C6vr3...@news.cis.umn.edu> en...@staff.tc.umn.edu (Tom Enebo) writes:
> I would like to be able to define a variable in Emacs-Lisp that
>is local to a function, but does not lose it's value when the functions
>exits. I know I can create a local variable via let, but any local
>variables within let are disposed upon exit of let.


If getting object oriented is a viable alternative, try the Eoops
package.
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
Life is what you make of the random chances. [@@]####=
"I will not raise taxes on the middle class." -- Anonymous \/ H H
`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'

0 new messages