octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Block comments


From: Rik
Subject: Re: Block comments
Date: Wed, 12 Jan 2011 09:24:04 -0800

> 1) What is the state of block comments? I see that the FAQ has been
> updated, but only seems to refer to one style of block comments, with
> %{ %} and not with #{ #}. Do they work like they do in Matlab now?
Block comments are allowed.  I fear that the FAQ is seriously out-of-date.
 I added the documentation to the manual, see Section 2.7.2 of Getting
Started, back in April, 2009.  There is, as you point out, something a
little odd with the parsing.

disp (1);
#{
disp (2);
disp (3);#}
disp (4);

The code above produces what you would expect:
1
4

Having the start of the block on the same line of the code, however,
produces the odd result that the last commented line is actually run.

disp (1);
#{ disp (2);
disp (3);#}
disp (4);

And the output is:

1
3
4

This, hopefully, is a simple fix in the parser.

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]