in reply to Re^2: Dynamic if loop
in thread Dynamic if statement

Eek, you really did mean code generation. Code generation is not the answer. Why would you build code to check conditions instead of just checking conditions.

You're actual question appears to be "How do I check a set of words (returned by a function) against a set of words?"

Check for what? Are you trying to find the intersection of the sets?

How does the function return the set of words? As a list of strings?

Replies are listed 'Best First'.
Re^4: Dynamic if loop
by Jenda (Abbot) on Mar 25, 2010 at 13:15 UTC

    Well code generation might be an answer. If you need to build the condition once and evaluate many times. Which doesn't really seem to be the condition in this case, but sometimes it's good to do all the work you can upfront, outside the loop and then just call the generated and eval""ed function within the loop.

    Not the easiest thing to write and debug, but sometimes the best solution performance-wise.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.