Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dogie.macc.wisc.edu!uwvax!sevenlayer.cs.wisc.edu!bothner From: bothner@sevenlayer.cs.wisc.edu (Per Bothner) Newsgroups: comp.lang.lisp Subject: Clarification of array semantics needed Message-ID: <11765@spool.cs.wisc.edu> Date: 20 Nov 90 06:58:18 GMT Sender: news@spool.cs.wisc.edu Organization: U of Wisconsin CS Dept Lines: 36 I'm trying to implement (in C++) CL arrays, but I find CLtL:2 rather confusing on some of the details. Perhaps someone here can help a poor non-Lisp-hacker (and perhaps ANSI could be more specific about the details). * If an array A is displaced to a vector B with a fill-pointer, is B's fill-pointer ignored when accessing A? That seems a reasonable interpretation (confirmed by a simple test with kcl). It does make the remark "(Note, however, that one can create a multidimensional array that a *displaced* to a vector that has a fill pointer.)" [p. 454, 6th line from bottom] seem rather irrelevant. Or are *all* fill-pointers checked when following a chain of displacements? * Is the following legal? (setq A (make-array ... :adjustable t :displaced-to B)) A later (adjust-array A ...) should just change A's diminsions? What if :initial-contents is given to the adjust-array? * I find section 17.6 on adjust-array totally confusing. The various "clarifications" don't help. For example: * Page 456, line 12: "but this may be achieved ... by creating a new array and modifying the array argument to be displaced..." seems to be contradicted by p 457, line 19. * The whole "clarification" on p 458 is unclear to me. If I have: (setq B (adjust-array A ...)) does the phrase "the result" refer to B or A? -- --Per Bothner bothner@cs.wisc.edu Computer Sciences Dept, U. of Wisconsin-Madison