Re: Help on insert using delete





matthiasse@xxxxxxx wrote:
> yeah its almost what i need
>
> i just thought of inserting it once -
>
> insert(a,[b,c,d],X).
>
> X= [a,b,c,d]
> no.
>
> the point is to use this delete implementation
> delete(_,[],[]).
> delete(X,[X|L],M):-!,delete(X,­L,M).
> delete(X,[Y|L1],[Y|L2]):-delet­e(X,L1,L2).
>
> but i dont think its possible

First, going to practical thinks:

Change delete(_,[],[]) by delete(_,Q,Q).
Or even do something like:

delete(_,A,B) :- (var(A)-> A=B; A=[], B=[]).

Reason:

The oposite of insert ONE element is remove ONE element.
The oposite of remove ALL elements that .. is insert INFINITE elements
that ... .

(Note: typing without test, no prolog available now).

.



Relevant Pages

  • Re: Help on insert using delete
    ... yeah its almost what i need ... i just thought of inserting it once - ... but i dont think its possible ... Prev by Date: ...
    (comp.lang.prolog)
  • Re: Bernina or Pfaff
    ... Yeah, it's medical. ... I can wind them, that's not a problem, nor is ... inserting it into the case. ... It's getting the dang case back in the ...
    (rec.crafts.textiles.quilting)
  • Re: - Week 32 results
    ... thankyouverymuch ... Yeah, predictable in that you keep inserting it into my mouth whenever I get ...
    (uk.sport.football)
  • Re: The Happy Warrior
    ... Andy comments: ... Yeah, Dick is always inserting himself into the..... ...
    (soc.senior.issues)
  • Re: Linux Version?
    ... Yeah, ... inserting it deeply into the M$ orificial sheep herd. ...
    (comp.cad.solidworks)