This doesn't work because ((temp-table 0) 1) evaluates to the symbol QYVSn5n1, and then passes the symbol itself (not the value of the symbol) to 'thad. If 'thad expects something other than a symbol, this blows up.
If you want to get the value of symbol instead, try using 'eval on the symbol.
arc> (= tab (table))
#hash()
arc> (= (tab 'foo) 'bar)
bar
arc> (= bar [prn "Hello, " _])
#<procedure: bar>
arc> (tab 'foo)
bar
arc> (eval (tab 'foo))
#<procedure: bar>
arc> ((eval (tab 'foo)) "world")
Hello, world
"Hello, "
Of course, if 'thad is really supposed to take a symbol rather than a table directly, you'll need to move the calls to eval inside 'thad.
(I'm curious: why do you need to use symbols here instead of just passing tables to 'thad?)
ah, I think I see how it can be done... I could bind the uniq-table-name to the symbol of the key. .... makes sense (I think) :).
I hadn't thought of this option because I had been storing the order number in the key position and wouldn't have been able to bind anything to a number like '0'. I was doing this because; calling the table using any table function that return all entries, does not return the order as it was stored, but rather it seems to return them randomly (and the order stored was not sortable). ex. (temp-table) or (vals temp-table).
I hope that made sense.
As for the other question(s),I'll try not to overwhelm....
I'm letting users upload one or many spreadsheets of their choice.... so I then store into a newly generated table which in turn generates html table(s) accessible using their web session. After they close out the web session there's no need to store the data since it will write it back out to a new spreadsheet an store it locally for them. Since I am re-using these functions, i've made them generic, but if they refresh the webpage the html-table functions needs to re-run passing in the correct table-names...so I keep track of which tables had been created for re-loading, hence the storing of the table names as symbols in a table.
I doubt that made sense, but it's what i could muster after 6 hours in front of this code :)
Thanks.
T.
As a note my table contained more than just a pair, each entry in the temp-table was storing: order, value, type
calling the table using any table function that return all entries, does not return the order as it was stored, but rather it seems to return them randomly
Yes, if you need to keep track of things in a particular order (such as the order you added them), you should put them in a list.
Note that you can put the same data in both a list and in a table, if that is what you need for your application.
hence the storing of the table names as symbols in a table
If you want to have a mapping of table names to tables, you can store that in its own table:
I'm not sure I understand what you're doing, but perhaps you need another table that maps the symbols you created to the tables they refer to. Call it table-names. Then you could rewrite thad like this:
But I suspect there is a better way of doing what you're trying to do, so if you give us some more details then we might be able to suggest a more sane alternative.