Re: A variable that holds a string which may be the name of a variable.

2009-12-03 Thread Richard Shann
On Thu, 2009-12-03 at 18:56 +, Neil Jerram wrote: > Linas Vepstas writes: > > > 2009/12/2 Neil Jerram : > > Neil, > > > > For my own edification -- is tehre any difference between > > > >> (let ((sym (with-input-from-string mything read))) > > > > and > > > > (let ((sym (string->symbol mythi

Re: A variable that holds a string which may be the name of a variable.

2009-12-03 Thread Neil Jerram
Linas Vepstas writes: > 2009/12/2 Neil Jerram : > Neil, > > For my own edification -- is tehre any difference between > >>  (let ((sym (with-input-from-string mything read))) > > and > > (let ((sym (string->symbol mything))) In the case where mything is a string consisting of symbol syntax chara

Re: A variable that holds a string which may be the name of a variable.

2009-12-03 Thread Neil Jerram
Richard Shann writes: > Thanks to all guileans who have responded. I seem to have a workable > solution based on Neil's code. The thing I hadn't grokked was the > existence of the with-input-from-string procedure. I had been messing > with defined? and symbol? but got nowhere. I would say the ma

Re: A variable that holds a string which may be the name of a variable.

2009-12-03 Thread Linas Vepstas
2009/12/2 Neil Jerram : Neil, For my own edification -- is tehre any difference between >  (let ((sym (with-input-from-string mything read))) and (let ((sym (string->symbol mything))) ? --linas

Re: A variable that holds a string which may be the name of a variable.

2009-12-03 Thread Richard Shann
Thanks to all guileans who have responded. I seem to have a workable solution based on Neil's code. The thing I hadn't grokked was the existence of the with-input-from-string procedure. I had been messing with defined? and symbol? but got nowhere. FWIW the core bit of code I ended up with takes th

Re: A variable that holds a string which may be the name of a variable.

2009-12-02 Thread Linas Vepstas
2009/12/2 Richard Shann : > I am stuck on one of those symbol/variable-name-in-a-string things > again: > > (define mything "display") > (display (eval-string mything)) > > that's fine. But can I test that the string in mything is the name of a > variable before doing the eval-string and finding ou

Re: A variable that holds a string which may be the name of a variable.

2009-12-02 Thread Neil Jerram
Richard Shann writes: > I am stuck on one of those symbol/variable-name-in-a-string things > again: > > (define mything "display") > (display (eval-string mything)) > > that's fine. But can I test that the string in mything is the name of a > variable before doing the eval-string and finding out

A variable that holds a string which may be the name of a variable.

2009-12-02 Thread Richard Shann
I am stuck on one of those symbol/variable-name-in-a-string things again: (define mything "display") (display (eval-string mything)) that's fine. But can I test that the string in mything is the name of a variable before doing the eval-string and finding out the hard way? I've been doing (symbol?