<div dir="ltr">I posted this to Stack Overflow (<a href="http://stackoverflow.com/questions/36504292/iso-pascal-record-variants-without-a-field-name">http://stackoverflow.com/questions/36504292/iso-pascal-record-variants-without-a-field-name</a>), but it hasn't gotten any feedback. So, here I go...<div><br></div><div><div>Free Pascal allows you to do this:</div><div><br></div><div>type RPoint = Record</div><div> Case Boolean of</div><div> False : (X,Y,Z : Real);</div><div> True : (R,theta,phi : Real);</div><div>end;</div><div><br></div><div>To construct it, you do:</div><div><br></div><div>var p: RPoint;</div><div>begin</div><div> p.x := 1;</div><div>end.</div><div><br></div><div>There's one part I don't understand: what's the purpose of the Case Boolean part? I understand that you can do case MyVal: Boolean; then MyVal becomes the field selector. However, what is the purpose when there is no field selector, just a type?</div><div><br></div><div>In addition, the ISO Pascal standard says:</div><div><br></div><div>With each variant-part shall be associated a type designated the selector-type possessed by the variant-part . If the variant-selector of the variant-part contains a tag-field, or if the case-constant- list of each variant of the variant-part contains only one case-constant, then the selector-type shall be denoted by the tag-type, and each variant of the variant-part shall be associated with those values specified by the selector-type denoted by the case-constants of the case-constant-list of the variant . Otherwise, the selector-type possessed by the variant-part shall be a new ordinal-type that is constructed to possess exactly one value for each variant of the variant-part, and no others, and each such variant shall be associated with a distinct value of that type.</div><div><br></div><div>I don't quite understand what the selector-type is and why it would be a new ordinal-type. Wouldn't the selector-type just be the type like in case Boolean of? And what does each case-constant-list having only one case-constant have to do with it?</div><div><br></div><div>Thanks in advance!</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Ryan</div><div dir="ltr">[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.<br></div><div dir="ltr"><div><a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a><div style="display:inline-block;width:16px;height:16px"> </div></div></div></div></div></div></div></div>
</div></div>