Thanks for the replies 

Is it possible to express the "withAs" template as a macro?

So that my example could look like this:
    
    
    with open("test.txt") as f:
        echo f.readLine()
    

I think it should be possible, since eg nimpylib lets you use this syntax:
    
    
    class Customer(object):
      """A customer of ABC Bank with a checking account. Customers have the
      following properties:
      Attributes:
          name: A string representing the customer's name.
          balance: A float tracking the current balance of the customer's 
account.
      """
    

eg, over here:

[https://github.com/Yardanico/nimpylib/blob/master/examples/example2.nim](https://github.com/Yardanico/nimpylib/blob/master/examples/example2.nim)

Reply via email to