🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1514

Re: sublists

#1514
From: goldsmig
Date: Tue, 29 Sep 1992 19:24
18 lines
1250 bytes
Do you mean to treat each of the elements in the sublists, no matter 
how deeply nested, in the same light?  In that case, it would seem
that something like:
remove(Rem,[H|T],[Rem_head|T_rest]):-
  H=..[.,_,_], %test to see if it is a list itself
  remove(Rem,H,Rem_head),
  remove(Rem,T,T_rest).
would take care of the cases where you ran into a sublist.
In article <1992Sep21.185751.10980@ucselx.sdsu.edu>, maxc0251@ucselx.sdsu.edu (sharon goldman) writes:
>  I am working on a program to delete elements from a list. My problem
> is that if the list contains sublists, it won't work.  I have tried
> using the predicate atom(Head) and deleting elements from the sublist
> that way, but then i have trouble appending those results onto the rest
> of the list.
> 
> any ideas??
> .
> 
Technical Details
Message-ID: <1992Sep29.112458.1@cgsvax.claremont.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!sdd.hp.com!elroy.jpl.nasa.gov!news.claremont.edu!cgsvax.claremont.edu!goldsmig
References: <1992Sep21.185751.10980@ucselx.sdsu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!sdd.hp.com!elroy.jpl.nasa.gov!news.claremont.edu!cgsvax.claremont.edu!goldsmig
From: goldsmig@cgsvax.claremont.edu
Subject: Re: sublists
Message-ID: <1992Sep29.112458.1@cgsvax.claremont.edu>
Lines: 18
Sender: news@muddcs.claremont.edu (The News System)
Organization: The Claremont Graduate School
References: <1992Sep21.185751.10980@ucselx.sdsu.edu>
Date: 29 Sep 92 11:24:58 PST