So I am making a program to dynamically make playlists from songs with Prolog(swi) and I was wondering if anyone could help me figure something out.
This is what I have
playlist_artist(Artist) :-
song(Title, Artist, Album, Length, Genre),
assert(playlist(Title, Artist, Album, Length, Genre)).
the song module will return the title, and all for every song of that artist, but assert will only be called for the first song. now since its not returning a list of songs, only modifying the Title variable I cant recusivly call assert for each of them, I don't know how to repeat multiple operations otherwise.
Anyone have any suggestion?