[sc-users] .interpret

koonce at grove.ufl.edu koonce at grove.ufl.edu
Fri Dec 8 14:30:22 PST 2006


I'm basically trying to craft a workaround to an existing large program.

In a nutshell, I have a group of declared variables that I also use as 
symbols to access items in an IdentityDictionary. I simply want an elegant 
way to transfer the stuff pointed at in the dictionary by the symbols to 
the already declared, corresponding variable location of the same name.

Make sense?

Paul Koonce


On Fri, 8 Dec 2006, James Harkins wrote:

> Can you say more about what you're trying to do?
>
> People often think .interpret is a catchall for programming problems,
> but usually it indicates that you're trying to go about something in
> the wrong way.
>
> hjh
>
> On 12/8/06, koonce at grove.ufl.edu <koonce at grove.ufl.edu> wrote:
>> 
>> 
>> Can someone tell me the trick to doing something like this:
>> 
>> (
>> 
>> a = \c ;
>> 
>> b = a.asString ++ " =  1 " ;
>> 
>> b.interpret ;
>> 
>> c.postln ;
>> 
>> )
>> 
>> 
>> which works, but using declared variables instead, like the following:
>> 
>> (
>> var mySymbol ;
>> 
>> a = \mySymbol ;
>> 
>> b = a.asString ++ " =  1 " ;
>> 
>> b.interpret ;
>> 
>> mySymbol.postln ;
>> 
>> )
>> 
>> which seems to fail to compile the interpreted string with the variable
>> declared outside, I guess. (See error below.)
>> 
>>
>>   ERROR: Variable 'mySymbol' not defined.
>>     in file 'selected text'
>>     line 1 char 16 :
>>    mySymbol =  1
>> -----------------------------------
>> nil
>> nil
>> 
>
>
> -- 
> James Harkins /// dewdrop world
> jamshark70 at dewdrop-world.net
> http://www.dewdrop-world.net
>
> "Come said the Muse,
> Sing me a song no poet has yet chanted,
> Sing me the universal."  -- Whitman
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>


More information about the sc-users mailing list