Re: Converting Scheme to Prolog



Shorter by two lines :-)

del(_,[],[]).
del(H,[H|T],Out) :-
!,
del(H,T,Out).
del(H,[[H2|T2]|T],[Out1|Out2]) :-
!,
del(H,[H2|T2],Out1),
del(H,T,Out2).
del(X,[H|T],Out1) :-
Out1=[H|Out2],
del(X,T,Out2).

Regards,
Pineapple

(The Chair, First National N Queens Workshop, Competition, Symposium,
and Imposium)


.



Relevant Pages

  • Re: Converting Scheme to Prolog
    ... (The Chair, First National N Queens Workshop, Competition, Symposium, ... and Imposium) ...
    (comp.lang.prolog)
  • Re: Converting Scheme to Prolog
    ... delete an item from a list, or a list of lists. ... (The Chair, First National N Queens Workshop, Competition, Symposium, ... and Imposium) ...
    (comp.lang.prolog)