Re: [q-lang-users] Memory management in libqint
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-06-13 13:00:03
|
Albert Graef scripsit: > Oops, not right, it's already there. qexprsym() should be what you need, > have you tried it? It returns zero if the argument is not a (function or > variable) symbol, and the symbol number otherwise. I discovered that for myself last night, but was too tired to write another email. However, it still doesn't get the actual *name* of the symbol. Then it occurred to me that although it's rather heavyweight, once I know I have a symbol I can use qprint() to return its name. Likewise, qmksym() is only useful for creating a qexpr for a well-known symbol; it returns -1 if the symbol is not known. So I'll use qparse() to create a qexpr for a potentially-unknown symbol coming from Scheme. The only remaining issues are on the Scheme side: how to create a Scheme bignum from an mpz_t, and what to do about Q foreign objects on the Scheme side (probably just wrap them in a specialized Scheme type). -- You're a brave man! Go and break through the John Cowan lines, and remember while you're out there co...@cc... risking life and limb through shot and shell, http://ccil.org/~cowan we'll be in here thinking what a sucker you are! --Rufus T. Firefly |