[plt-scheme] Re: accessing a top-level variable whose name is stored in a global variable

From: Gregg Williams (spamme at innerpaths.net)
Date: Tue Jul 28 01:41:00 EDT 2009

My thanks to both Noel's and Matthias' replies, which helped me
rethink some implementation details. I'm now going with a vector, the
zero'th element of which contains the current number of racks, and the
next N of which contain the actual racks. This eliminates the problem
with *infoml:active-rack-name*, which now simply contains an index
that points into the vector of racks.

In retrospect, it's hard to pinpoint the source of my uncertainty. I
was thrown off by the "specialness" of top-level variables. Though
I've done most of my programming in conventional procedural languages,
I've also done some programming in Common Lisp--all of which have
significant differences from Scheme. As a beginning Scheme programmer
with this mostly-conventional programming background, I have to say
that I do sometimes get confused trying to envision a solution that
fits naturally with Scheme, as opposed to trying to transpose another
language's idioms into Scheme. Thanks for your helpful comments.


Posted on the users mailing list.