Abdulaziz Ghuloum wrote:

On Sep 20, 2009, at 4:01 PM, David Van Horn wrote:

I have a mostly portable implementation of ra:quote here:

  http://svn.lambda-calcul.us/srfi/random-access-lists/

It uses the hash table approach, although it doesn't work in Ikarus since it uses make-hashtable (this seems fixable since you gave a hash table approach, I just haven't had time to digest your emails).

Comments on this code is appreciated.

Maybe I'm missing something but your approach doesn't look kosher:

(1) You cannot stash a value in a hash table at macro-expansion time and fetch it later at run-time. (2) Using integer counters is broken when you have separate compilations. This is because for every compilation the counter would be reset (this is why I used gensyms, not counters in my previous email) so you will end up with two constants having the same counter.

OK, I've moved syntax.sls to syntax.larceny.sls since it seems to make Larceny specific assumptions beyond just single instantation, but also that hash tables can be shared across phases.

Since Ikarus allows records to appear under quote, I have taken a slightly different approach than what you had sent. The test suite now passes on Ikarus, Larceny, and PLT. Records are still generative because of a bug in PLT that prevents the nongenerative clause from being used, so there are probably still issues with separate compilation in Ikarus. I will fix this when the PLT bug is resolved.

Does the code seem reasonable now (modulo generative concern above)?

David

Reply via email to