[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about MAKE



The book says, "Dylan does not specify whether the value returned 
must be a newly allocated instance, or whether MAKE is permitted 
to return a previously created instance.  If a new instance is allocated, 
MAKE will call INITIALIZE on the instance before returning it." [page 
51]

1. If MAKE returns a previously created instance, this has got to 
be something that's no longer visible to the program, right? E.g., 
something that the garbage collector has tossed back into a weak-pointer 
pool.  As stated, it sounds as though MAKE could return the same 
object every time!

2. I expect that INITIALIZE will typically be used to assign non-constant 
values to slots, to attach pointers to the new object, etc.  If so, 
then it would seem to make sense for MAKE to call INITIALIZE even 
when it's returning some "recycled" object, no?