View Single Post
Old 02-20-2021, 07:55 AM   #349
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,204
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
Thank you for this. I think that these additions increase flexibility, allowing someone to solve a problem the way they think about it. Question: is the order of evaluation guaranteed to be the order of the vars in the table? In other words, can the template for second variable be sure that the first variable has been defined?
Currently no. I thought about it and then got lazy and was skeptical whether anyone would need it. So I divided the vars into two groups, first group that does not require iteration is run first. The second group which requires iteration over all books is run after that. Each group is ordered. I will modify in the next release.


Quote:
Originally Posted by chaley View Post
Suggestion: move the "Iterate" checkbox to the second column. It took me a while to find it. I didn't think of scrolling.
OK. I will also modify the aesthetics of the table in the final release. Giving it more width and controlling the width of columns a little better. For now, you can move the order for each action.


Quote:
Originally Posted by chaley View Post
Is it reasonable to open the template editor on double-click if the value starts with "program:"?
Sure.

Quote:
Originally Posted by chaley View Post
Is it reasonable to add a template function set_book_vars(), perhaps only in chain variable templates?
Sure, no problem with that. I don't see the reason to make it only available in chain variables.


Quote:
Originally Posted by chaley View Post
A note: book_vars() (and a possible set_book_vars()) uses a different syntax than globals() and set_globals(). book_vars() requires you to pass an expression that is usually a constant string. The globals() and set_globals() functions require that the arguments be variable names; they cannot be expressions. I think this difference is confusing.
Yes. I will highlight this when I release the version officially.

Quote:
Originally Posted by chaley View Post
Is this a good thing or a bad thing? I am leaning toward 'good' but I am concerned about 'mysterious behavior'. For example, the following template returns 'foo there' because 'hello' has been assigned the value 'foo'.
Not sure about this. I would say let's wait and see if there are any complaints. I don't like the familiar template language to change (unless absolutely necessary), or to have two ways to do the same thing. That might end up be more confusing for some people.

Quote:
Originally Posted by chaley View Post
Final and unrelated question: I am having trouble understanding "Selection options" in Selection Modifier. What if I don't want any of the 3 choices? For example, if I do a search then I want to select the books returned by that search. I don't want the results modified at all, but there isn't a radio button "Don't change selection".

Perhaps I am overthinking it, but it seems to me that the three "groups" in the dialog are executed in order. VLs are cleared if that box is checked, a search is done (or not), resulting in selected books, and then the options are applied.
Yes the steps are carried out in the same order.

I have no problem with adding the option to not change selection. But I don't think it will used much except except maybe to display a search at the end of the chain without selecting any books.

If you combine a search with this new option, the current library view will change to reflect the new search, but no book will be selected. You have to combine the search with "choose all books in current view" or any other option to have books be selected.

Edit: I will do it because it might have some uses.

Last edited by capink; 02-20-2021 at 08:01 AM.
capink is offline   Reply With Quote