home *** CD-ROM | disk | FTP | other *** search
- fun searchlist (l,f,x)=
- if l==nil then nil
- else if exec f with [(hd l) x] then hd l
- else searchlist tl l f x;;
-
- fun deletelist (l,x)=
- if l==nil then nil
- else let l->[l2 next] in if l2==x then next
- else l2::deletelist next x;;
-
- fun apply_on_list(l,f,x)=
- if l==nil then 0
- else let l -> [a nxt] in
- (
- exec f with [a x];
- apply_on_list nxt f x
- );;
-
- fun rev_apply_on_list(l,f,x)=
- if l==nil then 0
- else let l -> [a nxt] in
- (rev_apply_on_list nxt f x; exec f with [a x];0);;
-
- fun search_in_list(l,f,x)=
- if l==nil then nil
- else let l -> [a nxt] in if exec f with [a x] then a
- else search_in_list nxt f x;;
-
- fun remove_from_list(l,p)=
- if l==nil then nil
- else let l -> [a nxt] in if a==p then nxt
- else a::remove_from_list nxt p;;
-
- fun create_tab(n,f,x)=
- let mktab n nil -> t in
- (
- let 0->i in
- while i<n do
- (
- set t.i=exec f with [i x];
- set i=i+1
- );
- t
- );;
-
- fun LimitText (obj,n,nn)=
- {
- let _GETlineCount obj -> count in
- {
- while count-n>0 do
- {
- _DELline obj 0;
- set count=count-1;
- };
- _SCROLLtext obj 0 count-nn-1;
- 0
- }
- };;
-