It helps to explain details like this that went into your design. Voting seems premature, but "request for comment" does help share the understanding. Typically I would expect at least a few parts of your design where options were explored and a choice was made. By not exposing the options considered and the choices made, you are requiring the voters to redo this thought process or accept your choices on faith. ________________________________ From: Daniel.Sun <sun...@apache.org> Sent: Monday, November 4, 2019 10:49 AM To: d...@groovy.incubator.apache.org <d...@groovy.incubator.apache.org> Subject: Re: [VOTE] Support switch expression in the next version
You know code block is not an expression. The reason to transform switch expression to switch statement in closure is make switch expression appear everywhere, e.g. ``` def process(String s) { "Hello, $s" } def a = 6 def r = process( switch (a) { case 6 -> 'a' default -> 'b' } ) assert 'Hello, a' == r ``` P.S. Java's text block looks smarter, but I still like Groovy's raw text block. When we want to get same result of Java's text block, just call `groovyText.stripIndent()`, which I think it's more flexible. ( My 2 cents ) Cheers, Daniel.Sun ----- Apache Groovy committer & PMC member Blog: https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.sunlan.me&d=DwICAg&c=4ZIZThykDLcoWk-GVjSLmy8-1Cr1I4FWIvbLFebwKgY&r=tPJuIuL_GkTEazjQW7vvl7mNWVGXn3yJD5LGBHYYHww&m=rrYePGxUdHeV6jQmQvDH-Eof_hKhDMU0-tS-syYL5MU&s=71MsgRj2JLvfOgINOMT6ULZEGJctqg2MirgQoLddmeU&e= Twitter: @daniel_sun -- Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__groovy.329449.n5.nabble.com_Groovy-2DDev-2Df372993.html&d=DwICAg&c=4ZIZThykDLcoWk-GVjSLmy8-1Cr1I4FWIvbLFebwKgY&r=tPJuIuL_GkTEazjQW7vvl7mNWVGXn3yJD5LGBHYYHww&m=rrYePGxUdHeV6jQmQvDH-Eof_hKhDMU0-tS-syYL5MU&s=D-BFH9Wb66X8yB4z3rZjNb6ySpTmhE2aJLcQG7Vwfn4&e=