[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: (BUG LISPM) at MIT-AI
- From: MLB@MIT-AI
- Date: Sat ,7 Jan 79 11:45:12 EDT
FILLARRAY might be made fancier or have variants as follows:
set fill pointer if present to actual number filled,
extend array if needed,
push many (ie append)
and push & extend.
To be concerte I will propose a new function:
(LOAD-ARRAY-FROM-LIST arr lis &OPTIONAL (base 0) (extend-p nil))
which writes the elements of LIS into ARR starting at BASE, extending
if EXTEND-P is non-nil and updating the fill pointer of ARR if it has one.
This can certainly be coded now but I can't seem to find an efficient way.
To push the contents of a list one could use
(LOAD-ARRAY-FROM-LIST arr lis (1+ (ARRAY-LEADER arr 0)))
Note that this implies dealing with BASE > arraysize cases.
While I'm at it: the appropriate sidekick function might be gotten by the extension
(POP-ARRAY arr &optional (number 1)) which would return a list of NUMBER
elements popped from ARR.