Trying to glean practical applications of DLR

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 6 months ago.

  • Author
    Posts
  • #5914

    by willsteele at 2012-09-02 08:12:34

    I read Joel's post earlier this year and could sense his excitement.

    http://huddledmasses.org/powershell-3-finally-on-the-dlr/

    Yet, in my every day scripts I have not been able to see any practical benefits to these under the hood changes. Are there things I could take more advantages of to see the improvements brought about by the DLR? Or, is this purely an internal PowerShell engine overhaul we measure in terms like faster performance, more efficient scripts, etc? If there is a set of objects that I have not tapped into I'd be curious what those may be and how to explore/study that side of things.

    by mjolinor at 2012-09-02 09:13:57

    I haven't found anything new directly attributable to DLR.

    About the only operational difference I've encountered is anonymous filters don't work any more.

    $sb = {$_ * 2}
    $sb.IsFilter = $true
    1..5 | &$sb

    Works in V2, doesn't work in V3, but easily fixed by using a named filter.

    by willsteele at 2012-09-02 10:42:02

    So, you have to do the old, explicit filter {} definition as with a function instead of letting it be implied. Is that correct?

    by mjolinor at 2012-09-02 12:27:20

    Yes. You can still use a script block as an anonymouns function.

    Now it seems that compile time happens earlier, and once it's compiled, the filter status is fixed, and can't be changed.

    If you want a filter you have to tell it beforehand.

You must be logged in to reply to this topic.