Welcome to MSDN Blogs Sign in | Join | Help

Block Comments in V2

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

Published Saturday, June 14, 2008 3:29 PM by PowerShellTeam

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Block Comments in V2

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

Saturday, June 14, 2008 11:32 AM by Maximilian Hänel

# re: Block Comments in V2

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

Sunday, June 15, 2008 5:00 AM by Smith Catar

# re: Block Comments in V2

Thanks Jeffrey, good to have this feature coming!

Monday, June 16, 2008 8:50 AM by Chuck Heatherly

# re: Block Comments in V2

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

Wednesday, August 06, 2008 6:19 AM by Rob Lancaster

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker