On Sun, 2009-04-19 at 11:45 +0300, Abdulaziz Ghuloum wrote: > On Apr 19, 2009, at 6:36 AM, Derick Eddington wrote: > > > [...] > > What this demonstrates is (according to my understanding): > > > > - PLT (mzscheme) makes a new instance of a library (T0 in this > > example) > > every time it processes an import of it, and then some. I understand > > why eight of these instantiations happen, but I have no idea why the > > other five happen. > > I can't justify it either. Actually, on my machine, I get only 10 > instantiations (using "plt-r6rs ++path . t.sps") and not 13! I bet > you'd get a different number of invocations in DrScheme due to the > check-syntax feature.
I get 10 for plt-r6rs, 13 for mzscheme, and 22 for DrScheme with "Debugging" on (which I believe is the default). > Imagine that > T0 there contained a guardian to guard some resources. Now you have > 13 of them at different library instance, 12 of which inaccessible > when the program finally runs and thus garbage along with all the > resources they're intended to protect.] Interesting example. > I believe (sounding like a beauty pageant) ... Hahahha! > Otherwise > it would feel just too overwhelming for people who haven't probably > thought it possible to perform computations (let along side effects) > at compile time. This possibility was certainly a mind-bender for me when I was introduced. It took me many small steps and doing a lot of progressively more advanced experiments for two years to understand it as I do now. -- : Derick ----------------------------------------------------------------
