| Date: | Tue, 20 Jul 2010 11:00:02 -0700 |
| Reply-To: | Sterling Paramore <gnilrets@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Sterling Paramore <gnilrets@GMAIL.COM> |
| Subject: | Re: Thoughts on nested comments? |
| In-Reply-To: | <E0B423A8C0D1E74B8905B2C5CB38C1AF081954@GENO3.wharton.upenn.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
When I want to comment out code for testing and debugging, I just create a
macro:
<stuff that runs>
%macro outercomment;
<stuff that doesn't run>
%macro comment;
<stuff that doesn't run>
%mend comment;
%mend outercomment;
<stuff that runs>
-Sterling
On Tue, Jul 20, 2010 at 10:31 AM, Keintz, H. Mark <mkeintz@wharton.upenn.edu
> wrote:
> Folks:
>
> This is an informal request to SAS-L for thoughts on a nested comment
> mechanism. I.e. if the next sasware ballot included an item like "introduce
> nested comments", how might the feature look in practice?
>
>
> JUSTIFICATION:
>
> AFAIK, SAS does not support nested comments. In particular a single "*/"
> cancels the effect of any number of preceding unpaired "/*" delimiters.
>
> I for one would appreciate the ability to nest comments. When developing,
> say, a 7-step program I may have steps 3 and 5 already vetted and each
> therefore commented out via "/* ... */". If, after further testing, I want
> to comment out steps 2 through 6, I can't simply insert delimiters before
> step 2 and after step 6.
>
>
> PROPOSAL:
>
> Add //* and *// as nested comment delimiters, such that:
>
> //* Increases the comment level by 1
> *// Decreases the comment level by 1
>
>
> EXAMPLE: using the 7-step program mentioned above, I start out with steps 3
> and 5 commented with the proposed tokens.
>
> ... step 1 SAS code ...
> ... step 2 SAS code ...
> //*
> ... step 3 SAS code ... treated as a comment (level 1)
> *//
> ... step 4 SAS code ...
> //*
> ... step 5 SAS code ... treated as a comment (level 1)
> *//
> ... step 6 SAS code ...
> ... step 7 SAS code ...
>
> Subsequently I want to comment steps 2 through 6. I would add //* before
> step 2 and *// after step 6:
>
> ... step 1 SAS code ...
> //*
> ... step 2 SAS code ... treated as a comment (level 1)
> //*
> ... step 3 SAS code ... treated as a comment (level 2)
> *//
> ... step 4 SAS code ... treated as a comment (level 1)
> //*
> ... step 5 SAS code ... treated as a comment (level 2)
> *//
> ... step 6 SAS code ... treated as a comment (level 1)
> *//
> ... step 7 SAS code ...
>
> CONSIDERATIONS:
> 1. This feature should not be allowed to break the behavior of /* and */.
> In particular all comment levels established by //* would be subordinate
> to the effect of */, which would terminate all levels.
>
> 2. I know of no usage of the token "//*" in current SAS programs, and an
> unpaired "*//" would be treated the same as an unpaired "*/". So IMO these
> particular tokens are highly unlikely to be present in current programs.
> I.e. they shouldn't break any current code.
>
>
>
> (Ahem) Comments?
>
>
> regards,
> Mark
>
|