Block Comments in V2

Block Comments in V2

  • Comments 4

Smith Catar was looking at my Tech Ed demos and noticed that I used block comments.  These are not in the CTP that you have so I guess I sorta let this one leak out.  Yes - V2 will have BLOCK COMMENTS!!!

Block comments start with "<# and end with "#>".  e.g.

<# 
This is
a
block comment
#>

Happy happy. 
Block comments - you asked for them, you'll get them. 

Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
  • Nice to hear! However the <# #> literals look quite ugly to me. Any comments on why you choose these literals and not e.g. /* */ like in c++, c# and other languages?

    tia

  • Oh...Microsoft will excute Stop-Leak cmdlet for you...

  • Thanks Jeffrey, good to have this feature coming!

  • Block comments good. Choice of delimiters? Hmmm.

    One of my favourite languages REBOL (hint, hint, prod) has many different datatypes. Okay, maybe far too many datatypes? ;->

    But, one of those data types is a tag!

    i.e

    type? <html width="100">

    >> tag!

    in much the same way you can go:

    type? "My name as a string"

    >> string!

    This means you can use xml and html in your code without having to escape the entire text on quotes...

    ie write-host "<tag here="30">

    would become

    write-host  <tag here="30">

    Now I'd much rather see the angle brackets used for a nifty language features like this with respect to XML - than used for block comments..

    Cos then.. would return a list of three items...

    function web-page()

    {

       <html>

       "This is my $name"

       </html>

    }

    web-page | out-server

    Cheers,

    Rob Lancaster

Page 1 of 1 (4 items)