Currently comparison operators like -eq and -gt use methods from LanguagePrimitives to emulate PowerShell's comparison behavior and will also pull local variables from the scope the delegate is created in.
I'm starting to use PSLambda more and more as a sort of replacement for Add-Type. In these scenarios I think it ends up hurting more than helping.
I'd like a strict mode that:
- Can be turned on and off within the context of a delegate. (e.g. including a statement like
enable strict or strict Comparisons, Variables)
- Can be turned on and off within the context of a script block (e.g.
use strict { $a -eq $b })
- Disables pulling variables from the creation scope automatically, but still allows something like
$using:variableName
Currently comparison operators like
-eqand-gtuse methods fromLanguagePrimitivesto emulate PowerShell's comparison behavior and will also pull local variables from the scope the delegate is created in.I'm starting to use PSLambda more and more as a sort of replacement for
Add-Type. In these scenarios I think it ends up hurting more than helping.I'd like a strict mode that:
enable strictorstrict Comparisons, Variables)use strict { $a -eq $b })$using:variableName