diff options
Diffstat (limited to 'src/algebra/strap/VECTOR.lsp')
-rw-r--r-- | src/algebra/strap/VECTOR.lsp | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/src/algebra/strap/VECTOR.lsp b/src/algebra/strap/VECTOR.lsp index 6b8ecf36..e6ac08f8 100644 --- a/src/algebra/strap/VECTOR.lsp +++ b/src/algebra/strap/VECTOR.lsp @@ -4,23 +4,32 @@ (DECLAIM (FTYPE (FUNCTION (|%List| |%Shell|) |%Thing|) |VECTOR;vector;L$;1|)) +(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Integer|) + |VECTOR;maxIndex;$I;2|)) + +(PUT '|VECTOR;maxIndex;$I;2| '|SPADreplace| '|sizeOfSimpleArray|) + (DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) - |VECTOR;convert;$If;2|)) + |VECTOR;convert;$If;3|)) (DEFUN |VECTOR;vector;L$;1| (|l| $) (SPADCALL |l| (|getShellEntry| $ 10))) -(DEFUN |VECTOR;convert;$If;2| (|x| $) +(DEFUN |VECTOR;maxIndex;$I;2| (|x| $) + (DECLARE (IGNORE $)) + (|sizeOfSimpleArray| |x|)) + +(DEFUN |VECTOR;convert;$If;3| (|x| $) (SPADCALL - (LIST (SPADCALL '|vector| (|getShellEntry| $ 14)) - (SPADCALL (SPADCALL |x| (|getShellEntry| $ 15)) - (|getShellEntry| $ 16))) - (|getShellEntry| $ 18))) + (LIST (SPADCALL '|vector| (|getShellEntry| $ 15)) + (SPADCALL (SPADCALL |x| (|getShellEntry| $ 16)) + (|getShellEntry| $ 17))) + (|getShellEntry| $ 19))) -(DEFUN |Vector| (#0=#:G1406) +(DEFUN |Vector| (#0=#:G1407) (PROG () (RETURN - (PROG (#1=#:G1407) + (PROG (#1=#:G1408) (RETURN (COND ((LETT #1# @@ -40,7 +49,7 @@ (PROGN (LETT |dv$1| (|devaluate| |#1|) . #0=(|Vector|)) (LETT |dv$| (LIST '|Vector| |dv$1|) . #0#) - (LETT $ (|newShell| 35) . #0#) + (LETT $ (|newShell| 36) . #0#) (|setShellEntry| $ 0 |dv$|) (|setShellEntry| $ 3 (LETT |pv$| @@ -89,22 +98,24 @@ (|setShellEntry| $ 6 |#1|) (COND ((|testBitVector| |pv$| 3) - (|setShellEntry| $ 19 - (CONS (|dispatchFunction| |VECTOR;convert;$If;2|) $)))) + (|setShellEntry| $ 20 + (CONS (|dispatchFunction| |VECTOR;convert;$If;3|) $)))) $)))) (MAKEPROP '|Vector| '|infovec| (LIST '#(NIL NIL NIL NIL NIL (|IndexedVector| 6 (NRTEVAL 1)) (|local| |#1|) (|Integer|) (0 . |One|) (|List| 6) - (4 . |construct|) |VECTOR;vector;L$;1| (|OutputForm|) - (|InputForm|) (9 . |convert|) (14 . |parts|) - (19 . |convert|) (|List| $) (24 . |convert|) - (29 . |convert|) (|Mapping| 6 6 6) (|Boolean|) - (|NonNegativeInteger|) (|Equation| 6) (|List| 23) - (|Mapping| 21 6) (|Mapping| 21 6 6) (|UniversalSegment| 7) - (|Void|) (|Mapping| 6 6) (|Matrix| 6) (|SingleInteger|) - (|String|) (|Union| 6 '"failed") (|List| 7)) - '#(|vector| 34 |parts| 39 |convert| 44 |construct| 49) + (4 . |construct|) |VECTOR;vector;L$;1| + |VECTOR;maxIndex;$I;2| (|OutputForm|) (|InputForm|) + (9 . |convert|) (14 . |parts|) (19 . |convert|) (|List| $) + (24 . |convert|) (29 . |convert|) (|Mapping| 6 6 6) + (|Boolean|) (|NonNegativeInteger|) (|Equation| 6) + (|List| 24) (|Mapping| 22 6) (|Mapping| 22 6 6) + (|UniversalSegment| 7) (|Void|) (|Mapping| 6 6) + (|Matrix| 6) (|SingleInteger|) (|String|) + (|Union| 6 '"failed") (|List| 7)) + '#(|vector| 34 |parts| 39 |maxIndex| 44 |convert| 49 + |construct| 54) '((|shallowlyMutable| . 0) (|finiteAggregate| . 0)) (CONS (|makeByteWordVec2| 5 '(0 0 0 0 0 0 0 5 0 0 1 4 0 0 1 2 3 4)) @@ -126,11 +137,11 @@ (|OrderedSet|) (|Aggregate|) (|EltableAggregate| 7 6) (|Evalable| 6) (|SetCategory|) (|Type|) (|Eltable| 7 6) - (|InnerEvalable| 6 6) (|CoercibleTo| 12) - (|ConvertibleTo| 13) (|BasicType|)) - (|makeByteWordVec2| 19 - '(0 7 0 8 1 0 0 9 10 1 13 0 12 14 1 0 9 - 0 15 1 9 13 0 16 1 13 0 17 18 1 0 13 - 0 19 1 0 0 9 11 1 0 9 0 15 1 3 13 0 - 19 1 0 0 9 10))))) + (|InnerEvalable| 6 6) (|CoercibleTo| 13) + (|ConvertibleTo| 14) (|BasicType|)) + (|makeByteWordVec2| 20 + '(0 7 0 8 1 0 0 9 10 1 14 0 13 15 1 0 9 + 0 16 1 9 14 0 17 1 14 0 18 19 1 0 14 + 0 20 1 0 0 9 11 1 0 9 0 16 1 6 7 0 12 + 1 3 14 0 20 1 0 0 9 10))))) '|lookupIncomplete|)) |