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

Re: Src question




   X-Authentication-Warning: fast.cs.utah.edu: majordom set sender to owner-plt-scheme@flux.cs.utah.edu using -f
   Date: Tue, 24 Oct 2000 11:08:32 -0600 (MDT)
   From: Matthew Flatt <mflatt@cs.utah.edu>
   Sender: owner-plt-scheme@fast.cs.utah.edu
   Precedence: bulk

   Quoting Matthias Felleisen:
   >    Ever think about having a function like scheme_make_vector that doesn't
   >    take a fill?  I know for my cases that I am going to have to refill the
   >    vector with specific values and doing it twice doesn't buy me anything. 
   >
   > [...]
   > 
   > That would make Scheme unsafe because someone could accidentally
   > dereference the vector before putting something in. 

   Since RJA is asking about the C-level interface, maybe he means the
   vector is going to be filled by the allocating C function before being
   exposed to Scheme code.

Then he needs to make sure his C functions don't mess up and don't allocate
while they fill. 

   For the next release, I've made scheme_make_vector treat a NULL fill
   value specially: it doesn't walk the vector installing NULLs. The GC
   will ensure that the vector is initially filled with NULL, anyway.

I dont understand that part. If we fill it with NULL, we might as well fill
it with other stuff. He doesn't save anything. 

-- Matthias