View Single Post
Old 02-10-2025, 04:02 PM   #194
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,529
Karma: 8075938
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by PeterT View Post
Not being a templats language expert, I'd think that using list_intersection might be an idea; something along the lines of list_intersection(tags, <list of comics, fanfiction, etc>

If the list_intersection is null and tags = subjects
List_intersection was the first thing I thought of, but given that the OP is using the "=." form of the search, it won't work well because it checks the entire value.

Using in_list might be better than a series of and conditions. It depends on how common the tests are, because search does shortcutting. By in_list I mean something like this:
Code:
program:
	if ! ("\.Comics$|\.Documentations & Manuals$|\.Fanfiction$|\.Fiction$|\.Magazines & Publications$|\.Magazines & Publications$" inlist $tags) && "\.Subjects$" inlist $tags then
		'whatever'
	fi
However, what you have isn't bad because of shortcutting, is easy to read, and easy to change, so I probably wouldn't mess with it.
chaley is offline   Reply With Quote