[Laszlo-dev] escaped code in live examples

Lou Iorio liorio at laszlosystems.com
Wed Oct 24 10:45:02 PDT 2007


>
>>
>> I propose we remove these processing instructions. If nothing  
>> else, surely it
>> will speed up the build and reduce confusion. I know I was  
>> confused. As John
>> says, let's discuss.
>
> Yes! Do it! Whenever you touch a file, feel free to remove these  
> "commented out" example code.
>
>>
>> As to making the parser ignore stuff in the xml document, how  
>> about plain old
>> comments? It's easy to grep for these, and we could use something  
>> simple, like:
>>
>> <!-- TODO: add example. IORIO 24 oct 2007 -->
>> <!-- IGNORE: no longer used
>>     stuff to ignore
>> IORIO 24 oct 2007 -->
>
> The tricky thing is making it ignore tags that contain comments:
>
> If you've got
> <button>Nice</button> <!-- this button's label is "Nice" -->
>
> ...then you can't comment it out with
> <!-- IGNORE
> <button>Nice</button> <!-- this button's label is "Nice" -->
> bshine 24 oct 2007 -->
>
> because the parser will try to close the comment after Nice"-->
>
> That's why we sometimes use <?ignore   ?> to comment out
> lzx code as we're developing it.
>
> I think the right answer here is... if you have to comment out  
> something
> that includes comments, either...
> a) you're wrong, you don't really need to comment it out, you  
> should just
> delete it and let subversion be your backup...
> b) comment it out with <!-- --> and remove any spurious close- 
> comments within the comment.
> c) wrap it in a <switch> <when runtime="never"></when> <otherwise>  
> </otherwise></switch> (I'm actually not sure if this works, but it  
> seems like a cool idea; the equivalent in C of doing
> if (false) {
> ... } else {
> ...
> }
I like the first choice, or the first choice replaced by a simple  
comment, like:

<!-- removed legacy code that was ignored by build. IORIO 23 oct 2007  
-->
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20071024/def3db36/attachment.html


More information about the Laszlo-dev mailing list