Re: [eclipse-clp-users] List of Terms to Term

From: Matthew Skala <mskala_at_cs.toronto.edu>
Date: Tue, 23 Feb 2010 13:47:25 -0500 (EST)
On Tue, 23 Feb 2010, Christian Wirth wrote:
> The problem i have is, i need to call \+(\+(List)) .. but i get an
> error:  type error in existing_file([d_role(Player, state), 'd_++'(_403,
> _478, state), 'd_++'(_403, _478, state), d_cell(_402, _478, state)],
> [".eco", "", ".ecl", ".pl"], [readable], _786)

Without taking a position on whether it's a good idea, I think you can
accomplish your intended effect with this:

list_to_and([],true).
list_to_and([A|B],(A,C)):-list_to_and(B,C).

List=[write(foo),nl],list_to_and(List,And),\+(\+(And)).

-- 
Matthew Skala, postdoctoral researcher, Universities of Toronto and Waterloo
mskala_at_cs.toronto.edu    mskala_at_cs.uwaterloo.ca    mskala_at_ansuz.sooke.bc.ca
Received on Tue Feb 23 2010 - 19:22:11 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET