Re: possibility of java style // end of line comments?

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Wednesday, October 15, 2008, 1:15:33 PM, Attila Szegedi wrote:

> Yeah, problem is, we add a one-line comment syntax, it'll blow some  
> poor sap's templates apart who happens to use these characters  
> literally. I.e. double-forward-slash certainly wouldn't fly for people
> who use FreeMarker to generate Java or C++ source code (well, who  
> bother to emit comments into them, that is).
>
> Something similar to the existing [#-- would maybe be acceptable, i.e.
> with one more dash [#--- but that gives you a five character prefix...
> Or maybe [#- with a single dash, assuming our tokenizer requires a  
> whitespace after the token, so it wouldn't mistake [#-- for [#-  
> followed by another dash. Actually, same goes for [#---, that will  
> only work if tokenizer wouldn't mistake it for [#-- followed by  
> another dash.

Bad idea... A "[" visually asks for for a "]" pair, an even
technically in many text editors due to the pair highlighting. (Then,
"[#--- --#]" is legal comment, so it's not even 100% BC.) Then it
complicates the rule as I said in the other mail, and for what? For
writing "[#--- blah" instead of "[#-- blah --#]"? No a that big win
than writing "// blah".

Also, there are much higher priority tasks right now... I'm saying it
because I'm already seeing as Jon, returning from the FreeCC world,
committing this with a sudden flame of anti-ersatz enthusiasm. :-)

> Attila.
>
> On Oct 15, 2008, at 12:47 PM, Daniel Dekany wrote:
>
>> Tuesday, October 14, 2008, 11:28:02 PM, Newman, John W wrote:
>>
>>> Hi,
>>>
>>> I’m working on a template now that is exceptionally complicated.
>>> So complicated, that for once I’m actually writing comments in  
>>> it.  :-o
>>>
>>> It’s less than ideal to always have to close them with --], it
>>> would be nice if FM added some kind of // like feature.  Just a
>>> random idea I figured I’d pass on to kick around for 2.4.  But I do
>>> remember years ago when I wrote a lexer & parser for a java variant,
>>> and both /* and // were surprisingly difficult to handle.
>>
>> That's not the real problem, Jonathan is a smart guy... ;-) The
>> problem with all the syntactical shortcuts (because we have seen a few
>> proposals in that topic) that they complicate the language rules, and
>> for a template language that's seldom acceptable, since it's something
>> that people should learn as quickly as possible and then also remember
>> it if they don't use the language every day. More general purpose
>> languages can accept themselves more. For this reason I'm reluctant to
>> vote for any additional syntactical tricks... Of course I know that in
>> some applications they are quite much desirable, but the interest of
>> the majority is more important. (I think the only way to address these
>> kind of issues is that the engine has a better architecture that makes
>> it easy to define and correctly treat(!) alternative template
>> languages.)
>>
>>> -John
>>
>> -- 
>> Best regards,
>> Daniel Dekany
>

-- 
Best regards,
 Daniel Dekany


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.