[Top][All Lists]

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

Re: use end or endif is indifferent?

From: Luca Manzari
Subject: Re: use end or endif is indifferent?
Date: Thu, 29 Nov 2018 16:57:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Whops, apologies since I see that I missed the point -- and yeah it would definitely be a plus.

Would there be any advantage in implementing the ability to parse "special" comments? I think of emacs local variables, where any comment block in whatever language containing the strings "Local Variables:" and "End:" allows to set file-specific variables. [1]

If this feature was worth adding, then one might have things like


Again, whether it's worth the effort I can't really say.


[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html

On 2018-11-29 16:24, Nicholas Jankowski wrote:

On Thu, Nov 29, 2018 at 10:17 AM Luca Manzari <address@hidden <mailto:address@hidden>> wrote:

    Octave already treats whatever follows % as a comment, so nothing
    prevents you from writing end%if or end%for already. Doing so makes for
    code that is both Octave and Matlab compatible.

it's compatible, but as mentioned earlier using end instead of endif loses Octave's 'advanced diagnostic abilities'.  end%if is still just end as far as Octave is concerned.  I can't imagine, though, the level of interpreter changes that would be required to have it selectively parse something that would otherwise be handled as a comment, and the number of false parses this could generate.

reply via email to

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