Or returning a closure from a proc 
    
    
    proc closeness(str:string):proc(s:string):string=
      let greeting = str
      return proc(s:string):string = greeting & s & '!'
    
    let hello = closeness("Hello, ")
    let hey = closeness("Hey, ")
    assert hello("Nim") == "Hello, Nim!"
    assert hey("there") == "Hey, there!"
    
    
    Run

But blocks are brilliant, I didn't get them at first now use them all the time

Reply via email to