Could you educate me a little about this? I think you're referring to the compare function passed to table.sort? Why can't it call yield(), if table.sort is called from a context that allows yielding? Maybe a concrete example would help me understand better. Thanks.
you can't yield from a C function, or something like that, which I guess is what the sort functions passed to table.sort look like.
for example, calling keyword:getName() within a sort function will fail every time, even if sorting from a task context with catalog access...
Its on my to-do list to fix all the bugs due to the sort functions that worked in Lr2 but don't work in Lr3 due to this error.
So, to summarize: the problem is not that the yield fails due to not being in a task, but fails due to some other calling context considerations that I don't understand, having to do with using C libraries...
Just try writing a sort function that calls keyword:getName() and you'll see.
I can provide some source code later if need be.
Interesting, thanks much for the explanation.
btw - I've now fixed all those sort functions by rearranging the code to confine all the calls to get metadata and such to before the sort, instead of within.