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,dc1fff2721602dfa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.100.41 with SMTP id ev9mr1157705wib.0.1359529694803; Tue, 29 Jan 2013 23:08:14 -0800 (PST) Path: i11ni27804wiw.0!nntp.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada and string literals Date: Wed, 30 Jan 2013 09:08:12 +0200 Organization: Tidorum Ltd Message-ID: References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net 3CfM5VWpjUkH2Dq4x3hOfgriUpyZOWuPh+kfHY/JtGzk+gZLkkjGzfjIWuMZRSW+UA Cancel-Lock: sha1:6RpojYJCmp80Bz7mP5tHx7py6Fg= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2013-01-30T09:08:12+02:00 List-Id: On 13-01-30 02:44 , codeallergy wrote: > hi comp.lang.ada, > > question from a newcomer: Why ada does not allow using a string literal with access type ? > > abc : access string := "LITERAL"; -- error. Because, unlike C, Ada does not confuse arrays with pointers. This is the closest Ada equivalent: Literal : aliased constant String := "LITERAL"; abc : access constant String := Literal'Access; -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .