Arc Forumnew | comments | leaders | submitlogin
2 points by mpr 2764 days ago | link | parent

So I'm not sure if the argparse function is completely obsoleted by keyword args, but it certainly is in the use case above. With the keyword arguments I've written, you can pass arbitrary code as the default value. So I've rewritten the scrape function above like this

    (ndef scrape (addr --keys (outfile ((tokens addr #\/) -1)) use-ssl)
      (prn outfile)
      (prn use-ssl))
Yes, there is some funny variable capture business going on here. But I think it's interesting to think about anyway :)