in reply to Dynamic use/require
As they are providing the same method, their input and output must be similar, so why not adding an extra input parameter which can be used as a switch inside the one combined module to differentiate accordingly?
And as you are calling your eval in a while loop, there is good chance that after a few runs through the while loop, you have loaded all your different modules anyhow.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamic use/require
by Joost (Canon) on Feb 27, 2008 at 21:54 UTC | |
by CountZero (Bishop) on Feb 28, 2008 at 20:49 UTC |