Arc Forumnew | comments | leaders | submitlogin
3 points by shader 4150 days ago | link | parent

Hmm. Have you started a new branch that is the official target, so that we're all working together instead of separately as we port our favorite things over?

I wouldn't mind helping you with the help/documentation stuff as I wrote some of it (src and the current version of fns), and it's probably my favorite part as well. Right now I'm a bit busy working on a new and improved ppr so that the src function actually returns reasonable looking source code ;)

I have been thinking about a new way to do the source code storage for src. I noticed that every time scheme makes a lambda, it remembers where in the code it was created. That means that the information about where the source is is associated with the lambda object, not the name. What if we modified the way that ac-fn worked, so that it associated each fn with its source code? That way all procedures, macros included, would have their source code available for inspection.

That's the idea, the hard part is making it work, and making it work without leaving the old definitions behind when the lambda no longer exists (temporary code, etc.) Any ideas? Maybe we could use vectors like the tag system? That would make it easy to look them up in a table, but doesn't fix the problem of garbage collection. Also, hacking it on at such a low level means that it probably captures the state of the source code after all of the macro expansions, so it may not be such a good idea after all.



2 points by CatDancer 4150 days ago | link

the hard part is making it work, and making it work without leaving the old definitions behind when the lambda no longer exists

I don't know about the first part, but for the second, what you want is a weak hash table (http://download.plt-scheme.org/doc/372/html/mzscheme/mzschem...) with the lambda's stored as the keys. The weak hash table holds the keys "weakly", which means it doesn't prevent the keys (the lambda's) from being garbage collected, and when they are garbage collected, the related value is dropped from the table.

-----