I want make function in lisp, because I have it in java
void index()
{ for(int j=0;j<zoznamP.length;j++){
if (zoznamP[j].equals("2")) indexM=j;}, where String [] zoznamP={"2","3","4"} ;
so i call function (funcion 3) and it returns 2, List I want declared:(defparameter *list* '(3 5 6 8 4 2 1 9))
help with funcion
Re: help with funcion
If I understand the question correctly, the function POSITION does what you want.
Re: help with funcion
Do you want a function that does that, or do you want to write one yourself?
In the first case, you're looking for the index of the element that is equal to the provided value, and the function that does this is position.
If you want to write one yourself, the most succinct and easy way for you would probably be to use the loop macro.
In the first case, you're looking for the index of the element that is equal to the provided value, and the function that does this is position.
If you want to write one yourself, the most succinct and easy way for you would probably be to use the loop macro.