Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
colleagues:
what does the listcat function do? i wrote a simple app to display the output of a listcat function with the second argument set to 'NIL'...and the output is the same...what does that second argument do?
here is my simple app:
typeof lcatlist = [S r1];;
fun listcat (p, q)=
if p==nil
then
q
else let p -> [h nxt] in
h::listcat nxt q;;
fun main ()=
//_cacheActivate;
set lcatlist = "henry"::"martha"::"john"::nil;
_showconsole;
_fooSList (listcat lcatlist nil);
_fooSList lcatlist;
0;;
iri you used listcat in getting the list of all files in a partition....what reason is it needed for?
Offline
ok, i did another test....
fun main ()=
//_cacheActivate;
set lcatlist = "henry"::"martha"::"john"::nil;
let "jimmy"::"johnny"::nil -> second_parameter_list in
(
_showconsole;
_fooSList (listcat lcatlist second_parameter_list);
_fooSList lcatlist;
);
0;;
does the listcat just put two lists together without including the 'nil', (the last element) of the first list?
Last edited by hebdemnobad (16-Dec-2014 19:58:00)
Offline
yes, this is exactly what it does.
Offline
listcat => lists concatenation
fun main ()=
//_cacheActivate;
set lcatlist = "henry"::"martha"::"john"::nil;
_showconsole;
_fooSList (listcat lcatlist nil);
_fooSList lcatlist;
0;;
Of course, if you set the argument to nil ...
You are right, it is also very important to check that the behavior is correct with unexpected values
Offline
Pages: 1