Is it possible to make a list of proc names then loop through the list and run 
those procs.

Perplexity.ai gave this answer which works:
    
    
    import tables
    
    proc test1() =
      echo "Hello"
    
    proc test2() =
      echo "World"
    
    let procTable = {
      "test1": test1,
      "test2": test2
    }.toTable()
    
    for procName in ["test1", "test2"]:
      if procTable.hasKey(procName):
        procTable[procName]()
    
    
    
    Run

Is there an easier way, that doesn't require tables? Tried this, doesn't work:
    
    
    for procName in ["test1", "test2"]:
      procName()
    
    
    Run

Reply via email to