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

Re: clarifications



    Some pathnames don't denote disks, and yet "free-space" is a meaningful
    concept. Why not "free-space" or "file-free-space" at least, instead of
    "disk-free-space"?
Yes. You've helped clarify the intended semantics which is,
If I saved a file with pathname P, how big could it be before
it ran out of room?
"free-space" could mean: how much virtual memory have I got left?
"file-free-space" disambiguates, however, we might want to disambiguate
based on the type of the argument [with maybe a few keywords].

There could be a whole set of free-space functions for:
virtual-memory [ROOM prints out a user useful answer, not a number that
                could be used by a program]
arrays         [returns number of elements between fill pointer and the
                real length]
numbers of various kinds  [how much more they can grow before they reach
               their limit. If number is negative, how much more they
               can grow downward? This should probably be disambiguated with
               a keyword. One problem is, you'd like to return a number of the
               same type, which would be impossible to do for, say, a number
               that was negative, to represent the distance to its positive max.]
hash-table    [how much room before a rehash is necessary. This is necessarily 
               implementation dependent
               Also, if there is a maximum size for a hash-table, how much
               room until then?]          
package        how many more symbols can I stick in this package
readtable      how many dispatch macros are undefined for the dispatch char
               C,  which would default to #   .
stream         You might want to open a stream for writting and specify a
               limit. Free-space would tell you how far until that limit.
list
sequence

For lists and sequences, you might be adding to them sequentially, after having
               initially creted them with some "empty" value such as NIL.
               free-space could find out how much space there was from the end
               until the first "non-empty" element. The empty value would default to nil.

Think of free-space like we've been thinking of undo, copy, setf ....
a generally useful concept that can be reasonably applied to a lot
of different data types.
It would make it easier to implement this free-space in terms of
another class of fns, SIZE or LENGTH.  
There is already an attempt to make LENGTH work generically 
in sequences. Why not with files, etc?
In fact, a bunch of the sequence operators could be meaningfully
applied to other data types. 

I recognize that these concepts mesh
with ideas from new flavors and commonloops.