This works:
    
    
    proc test1 = echo "Hello"
    proc test2 = echo "World"
    for p in [test1, test2]: p()
    
    
    Run

Note the dropped optional ()s for an empty parameter list. Before you were 
trying to "call" a "string" which is.. not something most people would expect 
to work. Even Python would require `eval()` there.

Note that if you put a literal string Nim after the opening triple back-ticks, 
this Forum will render it more colorfully.

Also, your next challenge is likely to be that the type of a Nim `proc` 
includes its signature and collection elements need to be of the same type. 
E.g., if you add `(i: int)` to one of your two procs but not the other, it will 
no longer compile. But maybe all your procs are the same type.

Reply via email to