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

unbind global variables

4 views
Skip to first unread message

Cris A. Fugate

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
I am relatively new to Scheme. I know how to bind a variable
using define, but is there a way to unbind a global variable?
--
**********************************************************************
Cris A. Fugate Lucent Technologies, Robust Process Automation
fug...@lucent.com http://ihgpweb.ih.lucent.com/~fugate
630 713-8255 Founder of the Lucent Tcl/Tk User Group

Shriram Krishnamurthi

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
"Cris A. Fugate" <fug...@lucent.com> writes:

> I am relatively new to Scheme. I know how to bind a variable
> using define, but is there a way to unbind a global variable?

Yes, but why do you want to do this?

Cris A. Fugate

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
I am porting an extension from Tcl which uses unset to unbind
global variables representing a data type called a frame.
I suppose I could put frame definitions in a global table,
but just makes things more complicated.

George Schott

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
That's a cool last name. It was just on TV too. As some man, who was
quicker than a speeding bullet, and was stealing priceless valueables.

George Schott

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to

Jost Boekemeier

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Shriram Krishnamurthi <shr...@cs.rice.edu> writes:

> "Cris A. Fugate" <fug...@lucent.com> writes:
>
> > I am relatively new to Scheme. I know how to bind a variable
> > using define, but is there a way to unbind a global variable?
>
> Yes, but why do you want to do this?

:(

Why does MZ Scheme support `undefine'?


Jost

Simon Slavin

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
In article <3945572E...@lucent.com>,
"Cris A. Fugate" <fug...@lucent.com> wrote:

> Shriram Krishnamurthi wrote:
> >
> > "Cris A. Fugate" <fug...@lucent.com> writes:
> >
> > > I am relatively new to Scheme. I know how to bind a variable
> > > using define, but is there a way to unbind a global variable?
> >
> > Yes, but why do you want to do this?
>

> I am porting an extension from Tcl which uses unset to unbind
> global variables representing a data type called a frame.
> I suppose I could put frame definitions in a global table,
> but just makes things more complicated.

Actually, I would recommend that you virtualise the variables which
were global in the Tcl solution. Create a single variable called
'frames' and use 'assoc'-type calls to manipulate it. Scheme isn't
really designed for arbitrary creation and deletion of variables.

Simon.
--
http://www.hearsay.demon.co.uk | _Microsoft_ is going to write the software
No junk email please. | that spies on me? I feel better already.
| -- John D. Goulden

David Rush

unread,
Jun 15, 2000, 3:00:00 AM6/15/00
to
sla...@hearsay.demon.co.uk@localhost (Simon Slavin) writes:
> In article <3945572E...@lucent.com>,
> "Cris A. Fugate" <fug...@lucent.com> wrote:
> > I am porting an extension from Tcl which uses unset to unbind
> > global variables representing a data type called a frame.
> > I suppose I could put frame definitions in a global table,
> > but just makes things more complicated.
>
> Actually, I would recommend that you virtualise the variables which
> were global in the Tcl solution. Create a single variable called
> 'frames' and use 'assoc'-type calls to manipulate it.

Or go with putprop/getprop in a Scheme that supports it. You can also
implement it yourself fairly easily ({put,get}prop is
non-standard). This really isn't very different from Simon's approach,
but it may feel more Tcl-ish. (Tcl just hides the global table
manipulations from the user...)

david rush
--
If you give someone Fortran, he has Fortran.
If you give someone Lisp, he has any language he pleases.
-- Guy L. Steele Jr.

0 new messages