<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>idea CGA Grammar: case/else in ArcGIS CityEngine Ideas</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idi-p/930590</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Would be nice to allow statements outside the case/else construct.&lt;BR /&gt;&lt;BR /&gt;For example, this is NOT allowed (to my knowledge):&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case attrHello == 1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Building&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Garden&lt;BR /&gt;&lt;BR /&gt;while this IS valid:&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case attrHello == 1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Building&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Garden&lt;BR /&gt;&lt;BR /&gt;This is a very simple (dummy) example. However, for complex things, this restriction becomes very annoying, and turns your code very verbose and unclean.&lt;BR /&gt;You could put the common code in a intermediate rule but, again, you're writing code which is becoming unreadable&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;André

&lt;!-- content transformation source ID: 08730000000bvbH --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Mar 2012 02:09:24 GMT</pubDate>
    <dc:creator>AndréCardoso</dc:creator>
    <dc:date>2012-03-06T02:09:24Z</dc:date>
    <item>
      <title>CGA Grammar: case/else</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idi-p/930590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Would be nice to allow statements outside the case/else construct.&lt;BR /&gt;&lt;BR /&gt;For example, this is NOT allowed (to my knowledge):&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case attrHello == 1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Building&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Garden&lt;BR /&gt;&lt;BR /&gt;while this IS valid:&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case attrHello == 1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Building&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(material.name, "diffuse")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Garden&lt;BR /&gt;&lt;BR /&gt;This is a very simple (dummy) example. However, for complex things, this restriction becomes very annoying, and turns your code very verbose and unclean.&lt;BR /&gt;You could put the common code in a intermediate rule but, again, you're writing code which is becoming unreadable&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;André

&lt;!-- content transformation source ID: 08730000000bvbH --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 02:09:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idi-p/930590</guid>
      <dc:creator>AndréCardoso</dc:creator>
      <dc:date>2012-03-06T02:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Grammar: case/else</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idc-p/930591#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;better: &lt;A href="http://www.scala-lang.org/node/120"&gt;http://www.scala-lang.org/node/120&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;object&lt;/SPAN&gt; MatchTest1 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;extends&lt;/SPAN&gt; Application {
  &lt;SPAN class="keyword" style="font-weight: bold;"&gt;def&lt;/SPAN&gt; matchTest(x: Int): String = x &lt;SPAN class="keyword" style="font-weight: bold;"&gt;match&lt;/SPAN&gt; {
    &lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; 1 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"one"&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; 2 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"two"&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; _ &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"many"&lt;/SPAN&gt;
  }
  println(matchTest(3))
}
&lt;/PRE&gt;

&lt;!-- content transformation source ID: 00a3000000FUye5 --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 15:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idc-p/930591#M44</guid>
      <dc:creator>chandesrisbasile1</dc:creator>
      <dc:date>2012-04-03T15:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Grammar: case/else</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idc-p/930592#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;a better syntax: &lt;A href="http://www.scala-lang.org/node/120"&gt;http://www.scala-lang.org/node/120&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;object&lt;/SPAN&gt; MatchTest1 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;extends&lt;/SPAN&gt; Application {
  &lt;SPAN class="keyword" style="font-weight: bold;"&gt;def&lt;/SPAN&gt; matchTest(x: Int): String = x &lt;SPAN class="keyword" style="font-weight: bold;"&gt;match&lt;/SPAN&gt; {
    &lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; 1 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"one"&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; 2 &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"two"&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: bold;"&gt;case&lt;/SPAN&gt; _ &lt;SPAN class="keyword" style="font-weight: bold;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="string-literal" style="color: green; background-color: white;"&gt;"many"&lt;/SPAN&gt;
  }
  println(matchTest(3))
}
&lt;/PRE&gt;

&lt;!-- content transformation source ID: 00a3000000FUyNK --&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 15:16:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-ideas/cga-grammar-case-else/idc-p/930592#M45</guid>
      <dc:creator>chandesrisbasile1</dc:creator>
      <dc:date>2012-04-03T15:16:25Z</dc:date>
    </item>
  </channel>
</rss>

