comp.lang.ada
 help / color / mirror / Atom feed
* String Problem
@ 2005-09-06 21:15 TC
  2005-09-06 21:28 ` Hyman Rosen
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: TC @ 2005-09-06 21:15 UTC (permalink / raw)


How Inizialize a string to null?
How read a string from keyboard until return?

Thanks



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-06 21:15 String Problem TC
@ 2005-09-06 21:28 ` Hyman Rosen
  2005-09-07 19:33   ` Tapio Marjom�ki
  2005-09-07 16:45 ` Martin Krischik
  2005-09-07 21:53 ` Brian May
  2 siblings, 1 reply; 10+ messages in thread
From: Hyman Rosen @ 2005-09-06 21:28 UTC (permalink / raw)


TC wrote:
> How Inizialize a string to null?
> How read a string from keyboard until return?

How learn a programming language?

Why don't you find an Ada textbook and read it?
Or if you're going to school, how about paying
attention to what you're being taught? For sure,
asking these silly little one-step-at-a-time
questions isn't going to teach you anything, and
if you ever need to demonstrate Ada knowledge to
anyone, you will fail.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-06 21:15 String Problem TC
  2005-09-06 21:28 ` Hyman Rosen
@ 2005-09-07 16:45 ` Martin Krischik
  2005-09-07 21:53 ` Brian May
  2 siblings, 0 replies; 10+ messages in thread
From: Martin Krischik @ 2005-09-07 16:45 UTC (permalink / raw)
  To: TC

<verï¿œffentlicht & per Mail versendet>

TC wrote:

> How Inizialize a string to null?

What kind of string:

http://en.wikibooks.org/wiki/Ada_Programming/Strings

> How read a string from keyboard until return?

READ:

http://en.wikibooks.org/wiki/Ada_Programming/Libraries/Ada.Text_IO

Well you could just try to read the textbook before asking. Or you soon need
to get yourself another user-id because we had it with you!

So to get this strait: If very very soon you are not getting any answers any
more it is not because Ada can't do it. Or that is is very complicated to
to so in Ada. No it will be because you have not done any research on the
subject. Doing research is indeed an integral part of your studies - we all
know by now that you are a student - a real software engineer would not as
such primitive questions.

You can avoid that. Ask questions in the following form:

I have read http://... and I did not quite understand ... . Can somebody
explain it in more detail. Thank you.

I have looked at http://... and http://... and http://... and I did not find
anything about ... . Does anybody know where I can find informations
about ... . Thank you.

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-06 21:28 ` Hyman Rosen
@ 2005-09-07 19:33   ` Tapio Marjom�ki
  2005-09-07 21:34     ` Ludovic Brenta
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tapio Marjom�ki @ 2005-09-07 19:33 UTC (permalink / raw)


Ada is a superb programming language, you say,
and there ought to be lots of expertize in this news group.

But every time when a newbie presents "a simple question", nobody is willing 
to (or capable of) answering with a couple briljant Ada source lines spiced 
with variations and finesses ...

Decent answers would encourage the newbie to study Ada more.

"Hyman Rosen" <hyman.rosen@gmail.com> wrote in message 
news:1126042135.302735.294240@g44g2000cwa.googlegroups.com...
> TC wrote:
>> How Inizialize a string to null?
>> How read a string from keyboard until return?
>
> How learn a programming language?
>
> Why don't you find an Ada textbook and read it?
> Or if you're going to school, how about paying
> attention to what you're being taught? For sure,
> asking these silly little one-step-at-a-time
> questions isn't going to teach you anything, and
> if you ever need to demonstrate Ada knowledge to
> anyone, you will fail.
> 





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-07 19:33   ` Tapio Marjom�ki
@ 2005-09-07 21:34     ` Ludovic Brenta
  2005-09-08 13:25     ` Marc A. Criley
  2005-09-08 17:25     ` Martin Krischik
  2 siblings, 0 replies; 10+ messages in thread
From: Ludovic Brenta @ 2005-09-07 21:34 UTC (permalink / raw)


"Tapio Marjomäki" <tapio.marjomaki@kolumbus.fi> writes:
> Ada is a superb programming language, you say, and there ought to be
> lots of expertize in this news group.
>
> But every time when a newbie presents "a simple question", nobody is
> willing to (or capable of) answering with a couple briljant Ada
> source lines spiced with variations and finesses ...
>
> Decent answers would encourage the newbie to study Ada more.

This newsgroup is like any other language or computer science
newsgroup.  We do not do students' homework for them.  A newbie who is
unwilling to learn will only get the kind of answers above.  A newbie
who shows interest will receive very detailed answers.

So, to all students: if you cannot be bothered to learn, I cannot be
bothered to help you.  If on the other hand, you are genuinely
interested in learning, I will go out of my way to help you.

This is the general attitude here, not just mine.

-- 
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-06 21:15 String Problem TC
  2005-09-06 21:28 ` Hyman Rosen
  2005-09-07 16:45 ` Martin Krischik
@ 2005-09-07 21:53 ` Brian May
  2005-09-08  1:14   ` Jeffrey R. Carter
  2 siblings, 1 reply; 10+ messages in thread
From: Brian May @ 2005-09-07 21:53 UTC (permalink / raw)


>>>>> "TC" == TC  <tecomeco@inwind.it> writes:

    TC> How Inizialize a string to null?  How read a string from
    TC> keyboard until return?

What is a "null string"?

I have seen a university assignment for the C++ string type that says
"on error return a null string" (no: it did not mean "null pointer").
Actually, exceptions may have been a better solution, but exceptions
have not been covered yet in that course.

So what is a "null string"? Is it the same thing as an "empty string"?
-- 
Brian May <bam@snoopy.apana.org.au>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-07 21:53 ` Brian May
@ 2005-09-08  1:14   ` Jeffrey R. Carter
  2005-09-08  7:23     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 10+ messages in thread
From: Jeffrey R. Carter @ 2005-09-08  1:14 UTC (permalink / raw)


Brian May wrote:

> What is a "null string"?

ARM 2.6:

"A null string literal is a string_literal with no string_elements between the 
quotation marks."

and, from the Examples section:

'""    --  a null string literal'

ARM 4.2:

"The evaluation of a string_literal that is a primary yields an array value 
containing the value of each character of the sequence of characters of the 
string_literal, as defined in 2.6. The bounds of this array value are determined 
according to the rules for positional_array_aggregates (see 4.3.3), except that 
for a null string literal, the upper bound is the predecessor of the lower bound.

"For the evaluation of a string_literal of type T, a check is made that the 
value of each character of the string_literal belongs to the component subtype 
of T. For the evaluation of a null string literal, a check is made that its 
lower bound is greater than the lower bound of the base range of the index type. 
The exception Constraint_Error is raised if either of these checks fails."

ARM A.3.2:

" Each of the names To_Lower, To_Upper, and To_Basic refers to two functions: 
one that converts from Character to Character, and the other that converts from 
String to String. The result of each Character-to-Character function is 
described below, in terms of the conversion applied to Item, its formal 
Character parameter. The result of each String-to-String conversion is obtained 
by applying to each element of the function's String parameter the corresponding 
Character-to-Character conversion; the result is the null String if the value of 
the formal parameter is the null String. The lower bound of the result String is 1."

Similar uses of the phrase "null string" may be found in the descriptions of the 
various Ada.Strings.* packages, and in other places. It does not seem to ever be 
described. The meaning seems to be a value of type String with 'Length = 0, or 
a[n] [Un]Bounded_String such that the function Length returns 0. It could also 
be defined as a string that is equal to "".

-- 
Jeff Carter
"I like it when the support group complains that they have
insufficient data on mean time to repair bugs in Ada software."
Robert I. Eachus
91



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-08  1:14   ` Jeffrey R. Carter
@ 2005-09-08  7:23     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry A. Kazakov @ 2005-09-08  7:23 UTC (permalink / raw)


On Thu, 08 Sep 2005 01:14:16 GMT, Jeffrey R. Carter wrote:

> Similar uses of the phrase "null string" may be found in the descriptions of the 
> various Ada.Strings.* packages, and in other places. It does not seem to ever be 
> described. The meaning seems to be a value of type String with 'Length = 0, or 
> a[n] [Un]Bounded_String such that the function Length returns 0. It could also 
> be defined as a string that is equal to "".

It could also be: "null string" is an identity element (zero) for the
concatenation (&): for any A : String "" & A = A and A & "" = A. It makes
sense if we consider strings as atomic values. "Empty string" corresponds
the view on strings as containers/sets.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-07 19:33   ` Tapio Marjom�ki
  2005-09-07 21:34     ` Ludovic Brenta
@ 2005-09-08 13:25     ` Marc A. Criley
  2005-09-08 17:25     ` Martin Krischik
  2 siblings, 0 replies; 10+ messages in thread
From: Marc A. Criley @ 2005-09-08 13:25 UTC (permalink / raw)


Tapio Marjom�ki wrote:

> But every time when a newbie presents "a simple question", nobody is willing 
> to (or capable of) answering with a couple briljant Ada source lines spiced 
> with variations and finesses ...

I _strongly_ take issue with this accusation.  Even a casual review of 
the comp.lang.ada archives will show an overwhelmingly positive and 
patient responsiveness to questions posted by both newbies and 
programmers of all experience levels.

For a recent example, see the "Help needed for ada package" thread, 
where the poster was originally looking to pay someone to do his Ada 
homework.  After being soundly thrashed for making such a request, he 
had a change of heart and decided instead to do the work himself.  This 
resulted in an abundance of technical advice being provided to him, 
including design suggestions, code snippets, links, and programming 
examples.

Show us a thread where a newbie was skewered over asking a question 
where it wasn't glaringly obvious they were trying to get someone to 
_do_ their homework, versus _help_ with it.

> 
> Decent answers would encourage the newbie to study Ada more.

The newbie has to take the first step, and do some studying on their 
own.  Once there's evidence in a posting that initiative has been taken, 
that they're asking legitimate questions about issues that could 
genuinely be confusing to one learning the language, and demonstrating 
some understanding of the language (and programming), the Adaphiles here 
have shown again and again their willingness to help out with explaining 
bugs, recommending techniques, and clarifying Ada's way of doing things.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: String Problem
  2005-09-07 19:33   ` Tapio Marjom�ki
  2005-09-07 21:34     ` Ludovic Brenta
  2005-09-08 13:25     ` Marc A. Criley
@ 2005-09-08 17:25     ` Martin Krischik
  2 siblings, 0 replies; 10+ messages in thread
From: Martin Krischik @ 2005-09-08 17:25 UTC (permalink / raw)


Tapio Marjomï¿œki wrote:

> Ada is a superb programming language, you say,
> and there ought to be lots of expertize in this news group.
> 
> But every time when a newbie presents "a simple question", nobody is
> willing to (or capable of) answering with a couple briljant Ada source
> lines spiced with variations and finesses ...

No we help everybody and indeed we answered many questions of TC. However
the student at hand did not do any research - and that is bad - he has to
learn research that as well as programming.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-09-08 17:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 21:15 String Problem TC
2005-09-06 21:28 ` Hyman Rosen
2005-09-07 19:33   ` Tapio Marjom�ki
2005-09-07 21:34     ` Ludovic Brenta
2005-09-08 13:25     ` Marc A. Criley
2005-09-08 17:25     ` Martin Krischik
2005-09-07 16:45 ` Martin Krischik
2005-09-07 21:53 ` Brian May
2005-09-08  1:14   ` Jeffrey R. Carter
2005-09-08  7:23     ` Dmitry A. Kazakov

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