From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c469fdacc2f3302b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 16 Mar 2010 19:31:45 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dynamic Variant Record Creation References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID: <4b9fce92$0$6730$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 16 Mar 2010 19:31:46 CET NNTP-Posting-Host: fdc60d22.newsspool2.arcor-online.net X-Trace: DXC=FW^inc@cIYZI?44J>Z[:RQA9EHlD;3YcR4Fo<]lROoRQ8kFZLh>_cHTX3j]IXjYD_5NDdU X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:10566 Date: 2010-03-16T19:31:46+01:00 List-Id: Warren schrieb: > procedure Get_Token(Object : in out Lexer; Token : out Token_Unit) is > > procedure Emit_Token(T : Token_Type) is > T : Token_Type := Token_Type'Val(Character'Pos(Ch)); > begin > Token := ( Token => T ); > end; > > ... > > end; > In the above, I need to create a Token_Unit from > a single character (there is no "id" in this case). The values > of operator characters are carefully coordinated in the Token_Type > using a representation clause (just FYI). This text appears to be GNATable: procedure Emit_Token(T : Token_Type) is Some_T : Token_Type := Token_Type'Val(Character'Pos(Ch)); subtype Result_Type is Token_Unit (Token => Some_T); Result : Result_Type; begin -- Token := ( Token => T ); Token := Result; end; > But the issue is this: > > *.adb:339:33: value for discriminant "token" must be static Is this true?