comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: "strings are delimited by double quote character", where there's a character variable
Date: Fri, 1 Dec 2017 11:09:59 -0800 (PST)
Date: 2017-12-01T11:09:59-08:00	[thread overview]
Message-ID: <1b00c77a-4710-4a97-abac-f3407311bc38@googlegroups.com> (raw)
In-Reply-To: <8f8f88d8-b9f6-492e-991a-283509b21696@googlegroups.com>

On Friday, December 1, 2017 at 8:08:41 AM UTC-7, Mehdi Saada wrote:
> I got a a Character variable gnat says it is a String, while functions taking it as parameter take only Characters. Mentions of the variable in the procedure: 
> C: Character := ''; -- strings are delimited by double quote character
> while C /= '' loop 
>         Get(C); PUSH(C); 
> end loop; 
> while (C /= '') loop -- same here        
>         Get(C); 
>         PUSH(C); 
> end loop;

The character you are using is referred to in Ada as "Apostrophe" (See Package Ada.Characters.Latin_1) the character referred to as a double-quote character is "Quotation". -- Respectively, these are Character'(''') and Character'('"').

String and Character are two separate types, though related, and are therefore not interchangeable. / A String is an array of Character, and thus can be specified via aggregate as ('H', 'e', 'l', 'l', 'o')... this would be rather tedious and so there exists a bit of syntactic sugar to specify a String: these are the Quotation delimiters and result in the previous value also being representable as "Hello".


  parent reply	other threads:[~2017-12-01 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 15:08 "strings are delimited by double quote character", where there's a character variable Mehdi Saada
2017-12-01 16:38 ` A. Cervetti
2017-12-01 16:43 ` AdaMagica
2017-12-01 16:49 ` Jeffrey R. Carter
2017-12-01 18:13   ` Mehdi Saada
2017-12-01 17:23 ` Dennis Lee Bieber
2017-12-01 17:44   ` Dennis Lee Bieber
2017-12-01 19:09 ` Shark8 [this message]
2017-12-05 21:45   ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox