list - Filtering random-outcomes from maplist/3 result -


i wish filter out list list=['f1',a1,a2,' lf2',a1,a2] predicate is_upper/2 , maplist/3 below

is_upper(elem,res) : if elem uppercase atom, assigned res i'd put uppercase atom list list_upper

i try ;

?- maplist(is_upper,list,list_upper). list_upper = ['f1',_a,_b,'f2',_c,_d,'f3',_e,_f] ? ; 

how can filter outs-random _a,_b...

expcted result :

 list_upper = ['f1','f2','f3']  

regards

include/3 collects elements of true resulte , exclude/3 falses

| ?- include(is_lower,['functor1','arg1','arg2','functor2','arg3','arg4','functor3','arg5','arg6'],list_lower). list_lower = [arg1,arg2,arg3,arg4,arg5,arg6] ? ; no 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -