PowerShell: an elegant way to create closures

后端 未结 2 703
离开以前
离开以前 2021-02-15 10:45

Keith Hill explained me that blocks in PowerShell are not closures and that to create closures from blocks I have to call method .GetNewClosure().

Is there any elegant w

2条回答
  •  眼角桃花
    2021-02-15 11:03

    These links might be of some help they talk about closures in PowerShell 2.0

    • http://blogs.msdn.com/powershell/archive/2009/03/27/get-closure-with-getnewclosure.aspx
    • http://www.nivot.org/2009/03/28/PowerShell20CTP3ModulesInPracticeClosures.aspx

提交回复
热议问题