Quantcast
Channel: Creating a list from a from a set of atoms in Prolog - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Creating a list from a from a set of atoms in Prolog

$
0
0

Eventually, I will need to create a list of lists in Prolog, but currently, I am having difficulty taking atoms and creating an initial list. I have a cat predicate whose will take in the cat's color and breed. The name of the cat will represent the name of the list. For example:

fluffy[white, persian]

dante[gray, russian_blue]

I have tried to use the following code to create the first list, but I always get a compilation error:

cat([Color, Breed], Name(Color, Breed), Name).

The error tells me I need a , or a (.

Any thoughts on what I am doing wrong?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>