Accessing the Index of an array in LISP -
I am working on Lisp programming, where I want to get the maximum from an array. I have written some initial code but got trapped there. I have seen many online tutorials but there was not enough help which I could understand.
Here is my code. So far, I have created an array of size 5. I have found this method from an online tutorial.
(Mer-arrange 5) # (zero zero zero zero) Now I want to set the value in these array indexes and then I How can I use those indexes?
Thanks in advance.
You have to store some space where you can use it eg
(come on (my-array (mer-array 11: initial-element 7))) (my-array 5); == > 7 (setf (myfree-array 3) 2); ==> 2 my-array;) ;; == & gt; # (7 7 7 2 7 ...) This can be lexical as my example, but you can also make it as a package variable (global) too.
Comments
Post a Comment