scrhartley commented on PR #106:
URL: https://github.com/apache/freemarker/pull/106#issuecomment-2161626816

   Now I've had some time to sit with it, I'm rethinking `break` not working 
the same as with `case`. Although it's not needed, it seems like it may be less 
surprising if it works the same (perhaps fewer support questions). It would 
also provide a mechanism for people who are desperate to avoid whitespace.  
   _**Note**: If we made that change, we would need to decide the behavior of 
`continue` , due to its surprising legacy handling with `case`._
   
   Example trying to avoid whitespace:
   ```freemarker
   <#switch animal.size>
     <#on "tiny", "small">This will be processed if it is small<#break>
     <#on "medium">This will be processed if it is medium<#break>
     <#default>This will be processed if it is neither<#break>
   </#switch>
   ```
   Counter-argument example instead using `t` (using `rt` seems to lead to 
slightly different results):
   ```freemarker
   <#switch animal.size>
     <#on "tiny", "small">This will be processed if it is small<#t>
     <#on "medium">This will be processed if it is medium<#t>
     <#default>This will be processed if it is neither<#t>
   </#switch>
   ```
   
   This is more a request for opinion than me making a decision. The motivation 
behind this directive was to give us a `switch` which isn't deprecated due to 
fall-through, but other than that, additional complications seem unnecessary. I 
might have a different opinion if we weren't reusing the `switch` directive.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to