> 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" <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
> 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
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.