Lambda

Hi,

I do not understand why this error message (I want to create a 2x4 empty tab):

image

Thx

What would it look like if you didn’t use a lambda?

Ok I solved it. :slight_smile:

Tab = [_,_], maplist([List]>>length(List, 4),Tab)

This may be easier to read (matter of taste, of course):

length_(Length, List) :-
    length(List, Length).

Then,

?- Tab = [_, _], maplist(length_(4), Tab).
Tab = [[_, _, _, _], [_, _, _, _]].
1 Like