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

Issue ADJUST-ARRAY-DISPLACEMENT



    Date: 29 May 87 21:13 PDT
    From: Masinter.pa@Xerox.COM

    Issue:        ADJUST-ARRAY-DISPLACEMENT

I'm happy with most of this clarification as far as it goes, but I have a
few other things that I'd like to see cleaned up before it goes out...

    ...
    (4) A is displaced to B before the call, but not displaced afterward.  A
    gets a new "data region", and contents of B are copied into it as
    appropriate to maintain the existing old contents; additional elements
    of A are taken from the :initial-element.  However, the use of
    :initial-contents causes all old contents to be discarded.

Hmm. I can almost get COPY-ARRAY out of this, couldn't I? Maybe...

(DEFUN COPY-ARRAY (ARRAY)
  (ADJUST-ARRAY (MAKE-ARRAY (ARRAY-DIMENSIONS ARRAY)
			    :ELEMENT-TYPE (ARRAY-ELEMENT-TYPE ARRAY)
			    :DISPLACED-TO ARRAY)
		:DISPLACED-TO NIL))

This isn't one of the things I necessarily think needs clarification. I just
thought it was curious. The rest of this message is of more significant interest.

    Note that if array X is displaced to array Y, and array Y is displaced
    to array Z, and array Y is altered by Adjust-Array, array X must now
    refer to the adjusted contents of Y. ...

I'm happy with this statement, but it sounds like it follows from one or
more of the four previous rules, and I'm not clear which. If it really
redundant, perhaps you could make the reason more clear. If not, it
shouldn't begin with "Note that...".

As nearly as I can tell, the discussion of ADJUST-ARRAY both here and in
CLtL does not say what happens if :DISPLACED-TO is omitted. Ie, is
 (ADJUST-ARRAY (MAKE-ARRAY ... :DISPLACED-TO A))
the same as 
 (ADJUST-ARRAY (MAKE-ARRAY ... :DISPLACED-TO A) :DISPLACED-TO NIL)
or the same as
 (ADJUST-ARRAY (MAKE-ARRAY ... :DISPLACED-TO A) :DISPLACED-TO A)
?

The current style of wording looks like the sort of clever :ADJUSTABLE 
wording that got us into such a frenzy. Even if there's intentional ambiguity,
we should be clear about that fact. My guess, though, is that no ambiguity
was intended here.