Re: [eclipse-clp-users] List of Structures

From: Edgaonkar, Shrirang <Shrirang.Edgaonkar_at_...390...>
Date: Mon, 2 Feb 2015 10:49:00 +0000
Dear Matthew,

  Thanks for the suggestion. Also tried different options. They worked.

Result = [goodsinfo(101, "laptop", "tablet", "iPad"), goodsinfo(102, "notebook",
 "pendrive", "tab")],
 
 findall([X,Y],(member(X,Result),X=goodsinfo{goodsid:101,goodsname:"laptop"},member(Y,Result),Y=goodsinfo{goodsid:102}),Sols).

Thanks and Regards,
Shrirang Edgaonkar

________________________________________
From: mskala_at_...206... [mskala@...206...]
Sent: 02 February 2015 18:29:01
To: Edgaonkar, Shrirang
Cc: Federico Ferri; eclipse-clp-users_at_lists.sourceforge.net
Subject: Re: [eclipse-clp-users] List of Structures

On Mon, 2 Feb 2015, Edgaonkar, Shrirang wrote:
> I am trying this.
> findall(goodsinfo{ goodsid:GoodsId, goodsname:GoodsName, term:Term, searchViews:Searchviews },(member(X, Result),  X=goodsinfo(101, _, _, _)),Sols),

The first argument of findall should be a variable that is given a value
by the success of the second argument.  If, as above, the first argument
does not occur in the second argument, it's almost certainly an error;
you're going to get a list of variables not bound to results.  Try this:

findall(X,(member(X,Result),X=goodsinfo{goodsid:101}),Sols).

--
Matthew Skala
mskala_at_...206...                 People before principles.
http://ansuz.sooke.bc.ca/

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
Received on Mon Feb 02 2015 - 10:52:43 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST