comp.lang.ada
 help / color / mirror / Atom feed
* basic ada question
@ 2005-08-19 16:35 Randy
  2005-08-19 17:55 ` Adrian Knoth
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Randy @ 2005-08-19 16:35 UTC (permalink / raw)


Hi.  I have a few books and have just started to learn about Ada.
I see that some books use a line like:

Ada.float_Text_IO.Get ( Item => P);

I was wondering about the "Item=>."
This is not (not yet anyway) explained and I was wondering if someone 
could tell me more about why/how to use it?
It seems to be optional and not required.

Thanks



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

* Re: basic ada question
  2005-08-19 16:35 basic ada question Randy
@ 2005-08-19 17:55 ` Adrian Knoth
  2005-08-19 20:22   ` Simon Wright
                     ` (3 more replies)
  2005-08-20 22:31 ` [ot] test Randy
  2005-08-20 22:39 ` Randy
  2 siblings, 4 replies; 27+ messages in thread
From: Adrian Knoth @ 2005-08-19 17:55 UTC (permalink / raw)


Randy <abuse@127.0.0.1> wrote:

> Ada.float_Text_IO.Get ( Item => P);
>
> I was wondering about the "Item=>."
> This is not (not yet anyway) explained and I was wondering if someone 
> could tell me more about why/how to use it?

It is a named parameter. You can use it to rearrange the order
of your parameters when calling a function/procedure.

Imagine something like this:

   procedure foo (param1: in t1; param2: in t2; param3: in t3)

So you can call foo with

   foo (a, b, c) where a has type t1, b has type t2 and c has type t3.

You might want to use a different order, so use named parameters:

   foo (param2 => b, param1 => a, param3 => c);

There is more to tell about named parameters, just go on reading
your book.

> It seems to be optional and not required.

You're not forced to use named parameters. It's just a feature
to ease your life ;)

> Thanks

BTW: your postings sucks pretty much: no valid From, non-unique
     message-ID (no fqdn). Perhaps you can correct this.

-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Die W�rde des Menschen ist unauffindbar.



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

* Re: basic ada question
  2005-08-19 17:55 ` Adrian Knoth
@ 2005-08-19 20:22   ` Simon Wright
  2005-08-19 21:13     ` Adrian Knoth
  2005-08-22 13:28     ` Marc A. Criley
  2005-08-19 21:43   ` Randy
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 27+ messages in thread
From: Simon Wright @ 2005-08-19 20:22 UTC (permalink / raw)


Adrian Knoth <adi@thur.de> writes:

>> It seems to be optional and not required.
>
> You're not forced to use named parameters. It's just a feature to
> ease your life ;)

And it can really make it easier to understand a call and be sure you
have the parameters right;

      System.Pool_Size.Deallocate
        (Pool => System.Pool_Size.Stack_Bounded_Pool (Pool),
         Address => Address,
         Storage_Size => Storage_Size,
         Alignment => Alignment);

might look like overkill, but you can be sure it's what was meant.

I sometimes find myself using a mixed style,

               Invalidate (Current_Item (Using),
                           If_For_Instance =>
                             Instance_Base_P (For_The_Instance));

which is more of an annotation. Of course you need to name the
parameters so that they make sense when used like this (in particluar,
name them from the point of view of the caller).



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

* Re: basic ada question
  2005-08-19 20:22   ` Simon Wright
@ 2005-08-19 21:13     ` Adrian Knoth
  2005-08-22 13:28     ` Marc A. Criley
  1 sibling, 0 replies; 27+ messages in thread
From: Adrian Knoth @ 2005-08-19 21:13 UTC (permalink / raw)


Simon Wright <simon@pushface.org> wrote:

>>> It seems to be optional and not required.
>> You're not forced to use named parameters. It's just a feature to
>> ease your life ;)
>
>       System.Pool_Size.Deallocate
>         (Pool => System.Pool_Size.Stack_Bounded_Pool (Pool),
>          Address => Address,
>          Storage_Size => Storage_Size,
>          Alignment => Alignment);
>
> might look like overkill, but you can be sure it's what was meant.

Though I agree in general, I often feel confused when the
formal parameter is named like the right hand side. Especially
when used in VHDL it's a drawback to have IO-ports and signals
share the same name (you don't know whether you're connecting
to a signal (multiple endpoints) or a port (single endpoints))

Of course the workaround is simple: special naming convention ;)

JFTR

-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Sollte es Dir gut gehen, mach Dir nichts draus. Das geht vorbei.



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

* Re: basic ada question
  2005-08-19 17:55 ` Adrian Knoth
  2005-08-19 20:22   ` Simon Wright
@ 2005-08-19 21:43   ` Randy
  2005-08-19 22:03     ` Adrian Knoth
  2005-08-20  3:30   ` Jeffrey R. Carter
  2005-08-20  6:36   ` [OT] Randy
  3 siblings, 1 reply; 27+ messages in thread
From: Randy @ 2005-08-19 21:43 UTC (permalink / raw)


Thank you for the advice on my question!
I am grateful that you took your time to answer it.


Adrian Knoth wrote:

> 
> 
> BTW: your postings sucks pretty much: no valid From, non-unique
>      message-ID (no fqdn). Perhaps you can correct this.
> 

If by "sucks" you mean I'm am not following some common format, then 
sorry, didn't look like there was one.
If by "sucks" you mean you don't know my email, I did that for a reason.
At this time I have no wish to "correct" it.  My questions and the 
answers given may help some other new person, so I think they should be 
in the newsgroup, not in email.  If I am in the wrong group let me know.
Thanks
Randy



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

* Re: basic ada question
  2005-08-19 21:43   ` Randy
@ 2005-08-19 22:03     ` Adrian Knoth
  0 siblings, 0 replies; 27+ messages in thread
From: Adrian Knoth @ 2005-08-19 22:03 UTC (permalink / raw)


Randy <abuse@127.0.0.1> wrote:

>> BTW: your postings sucks pretty much: no valid From, non-unique
>>      message-ID (no fqdn). Perhaps you can correct this.
> If by "sucks" you mean I'm am not following some common format, then 
> sorry, didn't look like there was one.

Yeah, it's not about your email address, it's all about your
message id which is generated by your newsagent.

According to rfc850, 2.1.7, it has to be unique and with respect
to rfc822 it is mentioned that it *must* contain a full domain
name.

So to say your newsreader violates rfc850 and you should
take some time to change this.

FYI: comp.lang.ada is bidirectionally gated to a mailing list.


f'up poster, cause there's no longer a relation to Ada

-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Bei "Megatitten" erwartet ja auch niemand, dass die Dame da 1 Mio. St�ck
von hat.                (Ralph Angenendt zur KiB/KB-SI-Einheiten-Diskussion)



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

* Re: basic ada question
  2005-08-19 17:55 ` Adrian Knoth
  2005-08-19 20:22   ` Simon Wright
  2005-08-19 21:43   ` Randy
@ 2005-08-20  3:30   ` Jeffrey R. Carter
  2005-08-20 14:28     ` Robert A Duff
  2005-08-21 17:37     ` Steve
  2005-08-20  6:36   ` [OT] Randy
  3 siblings, 2 replies; 27+ messages in thread
From: Jeffrey R. Carter @ 2005-08-20  3:30 UTC (permalink / raw)


Adrian Knoth wrote:

> It is a named parameter. You can use it to rearrange the order
> of your parameters when calling a function/procedure.

It's more about clarity than order. Something like

Insert (Into => Name_List, Item => Current.Name);

is usually clearer than

Insert (Name_List, Current.Name);

-- 
Jeff Carter
"Mr. President, we must not allow a mine-shaft gap!"
Dr. Strangelove
33



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

* [OT]
  2005-08-19 17:55 ` Adrian Knoth
                     ` (2 preceding siblings ...)
  2005-08-20  3:30   ` Jeffrey R. Carter
@ 2005-08-20  6:36   ` Randy
  2005-08-20 12:58     ` [OT] Larry Kilgallen
  2005-08-20 21:27     ` [OT] TEST Randy
  3 siblings, 2 replies; 27+ messages in thread
From: Randy @ 2005-08-20  6:36 UTC (permalink / raw)


Adrian Knoth wrote:


> 
> BTW: your postings sucks pretty much: no valid From, non-unique
>      message-ID (no fqdn). Perhaps you can correct this.
> 

Could someone explain what he is talking about here?
I am afraid I don't know.



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

* Re: [OT]
  2005-08-20  6:36   ` [OT] Randy
@ 2005-08-20 12:58     ` Larry Kilgallen
  2005-08-20 19:48       ` [OT] Randy
  2005-08-20 21:27     ` [OT] TEST Randy
  1 sibling, 1 reply; 27+ messages in thread
From: Larry Kilgallen @ 2005-08-20 12:58 UTC (permalink / raw)


In article <tbANe.159$Vg7.100@trnddc06>, Randy <abuse@127.0.0.1> writes:
> Adrian Knoth wrote:

>> BTW: your postings sucks pretty much: no valid From, non-unique
>>      message-ID (no fqdn). Perhaps you can correct this.
> 
> Could someone explain what he is talking about here?
> I am afraid I don't know.

Sometimes I help to interpret, but not when the person being unclear
cannot bother to use civil language.



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

* Re: basic ada question
  2005-08-20  3:30   ` Jeffrey R. Carter
@ 2005-08-20 14:28     ` Robert A Duff
  2005-08-21 17:37     ` Steve
  1 sibling, 0 replies; 27+ messages in thread
From: Robert A Duff @ 2005-08-20 14:28 UTC (permalink / raw)


"Jeffrey R. Carter" <spam@spam.com> writes:

> Adrian Knoth wrote:
> 
> > It is a named parameter. You can use it to rearrange the order
> > of your parameters when calling a function/procedure.
> 
> It's more about clarity than order.

I strongly agree.  Being "creative" with the order of parameters makes
the code harder to read.  Uniformity is good.  I always use the same
order in all calls -- same order as the formals are declared -- even
when using named notation.  At least, I try -- I wish the compiler would
help me out by enforcing that.  (Or give me a tool that fixes it.)

>... Something like
> 
> Insert (Into => Name_List, Item => Current.Name);
> 
> is usually clearer than
> 
> Insert (Name_List, Current.Name);

Yes.  I'm a big fan of named notation.

Another advantage is when you have two parameters of the same type.
You can't accidently switch them if you used named notation.

I think you should choose formal parameter names that read nicely in
named-notation calls (even if they cause the body of the procedure to be
slightly less readable).

- Bob



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

* Re: [OT]
  2005-08-20 12:58     ` [OT] Larry Kilgallen
@ 2005-08-20 19:48       ` Randy
  2005-08-20 20:25         ` [OT] Adrian Knoth
  0 siblings, 1 reply; 27+ messages in thread
From: Randy @ 2005-08-20 19:48 UTC (permalink / raw)


Larry Kilgallen wrote:
> In article <tbANe.159$Vg7.100@trnddc06>, Randy <abuse@127.0.0.1> writes:
> 
>>Adrian Knoth wrote:
> 
> 
>>>BTW: your postings sucks pretty much: no valid From, non-unique
>>>     message-ID (no fqdn). Perhaps you can correct this.
>>
>>Could someone explain what he is talking about here?
>>I am afraid I don't know.
> 
> 
> Sometimes I help to interpret, but not when the person being unclear
> cannot bother to use civil language.

Yes, I hear you.  I thought he was quite rude for no reason.
I just don't know if he even has a valid point.
I'm wondering why he was looking at the header instead of the message.
Maybe he is some hacker looking for a person's ID to steal.  Who knows.



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

* Re: [OT]
  2005-08-20 19:48       ` [OT] Randy
@ 2005-08-20 20:25         ` Adrian Knoth
  2005-08-20 21:55           ` [OT] Way out in Left field Randy
  2005-08-20 22:44           ` [OT] Randy
  0 siblings, 2 replies; 27+ messages in thread
From: Adrian Knoth @ 2005-08-20 20:25 UTC (permalink / raw)


Randy <abuse@127.0.0.1> wrote:

>>>>BTW: your postings sucks pretty much: no valid From, non-unique
>>>>     message-ID (no fqdn). Perhaps you can correct this.
>>>Could someone explain what he is talking about here?
>>>I am afraid I don't know.
>> Sometimes I help to interpret, but not when the person being unclear
>> cannot bother to use civil language.
> Yes, I hear you.  I thought he was quite rude for no reason.

I'm sorry, I never intended to be rude. I'm not a native speaker
and I don't know that "sucks" is so negative. My intention was
to only state that there are some points which could be improved.

Though I prefer complete From-lines and especially a valid
reply-to-address (which would let me tell all those things by
mail instead of disturbing the audience with it), the real
point to critizize is the violation of RFC850.

I think you're completely new to usenet so I guess you don't
know what I'm talking about. Actually it isn't even your fault,
your software is doing wrong.

If you read <http://www.faqs.org/rfcs/rfc850.html> and especially
2.1.7 you'll see that your message-id *must* contain a real
domain name. Yours (trnddc03) isn't sufficient.

The sense of putting a valid domain name there is to guarantee
the uniqueness of message-ids. That's important to identify
every single posting all over the world. Any collision would
break the primary key property. It's like two persons sharing the
same name: you're always getting into trouble when referring
to one of them ;)

> I'm wondering why he was looking at the header instead of
> the message. Maybe he is some hacker looking for a person's
> ID to steal.  Who knows.

You're kidding?


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Man kann gar nicht so viel essen wie man kotzen m�chte!



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

* Re: [OT] TEST
  2005-08-20  6:36   ` [OT] Randy
  2005-08-20 12:58     ` [OT] Larry Kilgallen
@ 2005-08-20 21:27     ` Randy
  2005-08-20 22:52       ` Frank J. Lhota
  1 sibling, 1 reply; 27+ messages in thread
From: Randy @ 2005-08-20 21:27 UTC (permalink / raw)


Randy wrote:
> Adrian Knoth wrote:
> 
> 
>>
>> BTW: your postings sucks pretty much: no valid From, non-unique
>>      message-ID (no fqdn). Perhaps you can correct this.
>>
> 
> Could someone explain what he is talking about here?
> I am afraid I don't know.

Test post



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

* Re: [OT] Way out in Left field
  2005-08-20 20:25         ` [OT] Adrian Knoth
@ 2005-08-20 21:55           ` Randy
  2005-08-20 22:44           ` [OT] Randy
  1 sibling, 0 replies; 27+ messages in thread
From: Randy @ 2005-08-20 21:55 UTC (permalink / raw)


Adrian Knoth wrote:
> Randy <abuse@127.0.0.1> wrote:
> 
> 
>>>>>BTW: your postings sucks pretty much: no valid From, non-unique
>>>>>    message-ID (no fqdn). Perhaps you can correct this.
>>>>
>>>>Could someone explain what he is talking about here?
>>>>I am afraid I don't know.
>>>
>>>Sometimes I help to interpret, but not when the person being unclear
>>>cannot bother to use civil language.
>>
>>Yes, I hear you.  I thought he was quite rude for no reason.
> 
> 
> I'm sorry, I never intended to be rude. I'm not a native speaker
> and I don't know that "sucks" is so negative. My intention was
> to only state that there are some points which could be improved.

It is hard to put meaning into text.
If you are not a native English speaker then perhaps you should not use 
words when you don't know the meaning of them?


> Though I prefer complete From-lines and especially a valid
> reply-to-address (which would let me tell all those things by
> mail instead of disturbing the audience with it), the real
> point to critizize is the violation of RFC850.
> 
> I think you're completely new to usenet so I guess you don't
> know what I'm talking about. Actually it isn't even your fault,
> your software is doing wrong.
> 
> If you read <http://www.faqs.org/rfcs/rfc850.html> and especially
> 2.1.7 you'll see that your message-id *must* contain a real
> domain name. Yours (trnddc03) isn't sufficient.
> 
> The sense of putting a valid domain name there is to guarantee
> the uniqueness of message-ids. That's important to identify
> every single posting all over the world. Any collision would
> break the primary key property. It's like two persons sharing the
> same name: you're always getting into trouble when referring
> to one of them ;)

I looked at that and I understand what you are looking for.
I don't know why it does not put the domain name.  I don't have any 
options to change this that I know of.
I am afraid you will have to accept it as it is for now.  Sorry.
Perhaps in the next upgrade to this program it will be addressed.
This is a windows port of a Linux mail program. I see you use Debian.

>>I'm wondering why he was looking at the header instead of
>>the message. Maybe he is some hacker looking for a person's
>>ID to steal.  Who knows.
> 
> 
> You're kidding?
> 
> 

Hey you never know.  I don't know you from Adam.
I really don't think most people look at the header unless they are 
looking to find out where the person is from or other information.
I don't see the point in looking at it in the first place, and if it is 
just an interest of yours, you could have explained much better about 
what was going on instead of just saying my post sucked,(you did in this 
message, thanks for clearing that up a little for me.)
Most ID theft (from what I understand of it, and that is not very much 
at this point) is from people outside of the U.S.A.
(This being from a newscast for a 10 minute segment about ID theft)
Guess you all figure everyone in the U.S.A. is rich or something. 
(cough, cough)

Anyway I'm done spouting sorry for the length of it.



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

* [ot] test
  2005-08-19 16:35 basic ada question Randy
  2005-08-19 17:55 ` Adrian Knoth
@ 2005-08-20 22:31 ` Randy
  2005-08-20 22:39 ` Randy
  2 siblings, 0 replies; 27+ messages in thread
From: Randy @ 2005-08-20 22:31 UTC (permalink / raw)


Randy wrote:
> Hi.  I have a few books and have just started to learn about Ada.
> I see that some books use a line like:
> 
> Ada.float_Text_IO.Get ( Item => P);
> 
> I was wondering about the "Item=>."
> This is not (not yet anyway) explained and I was wondering if someone 
> could tell me more about why/how to use it?
> It seems to be optional and not required.
> 
> Thanks

test post



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

* [ot] test
  2005-08-19 16:35 basic ada question Randy
  2005-08-19 17:55 ` Adrian Knoth
  2005-08-20 22:31 ` [ot] test Randy
@ 2005-08-20 22:39 ` Randy
  2 siblings, 0 replies; 27+ messages in thread
From: Randy @ 2005-08-20 22:39 UTC (permalink / raw)



"Randy" <abuse@127.0.0.1> wrote in message news:NTnNe.64$_f.57@trnddc03...
> Hi.  I have a few books and have just started to learn about Ada.
> I see that some books use a line like:
>
> Ada.float_Text_IO.Get ( Item => P);
>
> I was wondering about the "Item=>."
> This is not (not yet anyway) explained and I was wondering if someone 
> could tell me more about why/how to use it?
> It seems to be optional and not required.
>
> Thanks
test post 





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

* Re: [OT]
  2005-08-20 20:25         ` [OT] Adrian Knoth
  2005-08-20 21:55           ` [OT] Way out in Left field Randy
@ 2005-08-20 22:44           ` Randy
  1 sibling, 0 replies; 27+ messages in thread
From: Randy @ 2005-08-20 22:44 UTC (permalink / raw)


> Though I prefer complete From-lines and especially a valid
> reply-to-address (which would let me tell all those things by
> mail instead of disturbing the audience with it), the real
> point to critizize is the violation of RFC850.
>
> I think you're completely new to usenet so I guess you don't
> know what I'm talking about. Actually it isn't even your fault,
> your software is doing wrong.
>

OK Mozilla, Thunderbird and outlook express all do the same thing.  I am 
guessing that my mail programs either are all "in violation" or that my ISP 
makes up the message ID.  Either way it seems to be out of my hands. 





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

* Re: [OT] TEST
  2005-08-20 21:27     ` [OT] TEST Randy
@ 2005-08-20 22:52       ` Frank J. Lhota
  2005-08-20 23:00         ` Randy
  0 siblings, 1 reply; 27+ messages in thread
From: Frank J. Lhota @ 2005-08-20 22:52 UTC (permalink / raw)


"Randy" <abuse@verizon.net> wrote in message 
news:4fNNe.2309$Hi.1932@trnddc04...
> Randy wrote:
>> Adrian Knoth wrote:
>>
>>
>>>
>>> BTW: your postings sucks pretty much: no valid From, non-unique
>>>      message-ID (no fqdn). Perhaps you can correct this.
>>>
>>
>> Could someone explain what he is talking about here?
>> I am afraid I don't know.
>
> Test post

OK, time for me to give the standard USENET advice: to test newsgroup 
posting, use groups such as alt.test. It is considered impolite to post test 
posts to groups set up for conversations.

-- 
"All things extant in this world,
Gods of Heaven, gods of Earth,
Let everything be as it should be;
Thus shall it be!"
- Magical chant from "Magical Shopping Arcade Abenobashi"

"Drizzle, Drazzle, Drozzle, Drome,
Time for the this one to come home!"
- Mr. Lizard from "Tutor Turtle"





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

* Re: [OT] TEST
  2005-08-20 22:52       ` Frank J. Lhota
@ 2005-08-20 23:00         ` Randy
  0 siblings, 0 replies; 27+ messages in thread
From: Randy @ 2005-08-20 23:00 UTC (permalink / raw)


Frank J. Lhota wrote:

> 
> OK, time for me to give the standard USENET advice: to test newsgroup 
> posting, use groups such as alt.test. It is considered impolite to post test 
> posts to groups set up for conversations.
> 
Sorry.
I guess I should have posted it there.
Only testing to check the message-ID that someone else here complained out.
Good grief, you people are picky.



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

* Re: basic ada question
  2005-08-20  3:30   ` Jeffrey R. Carter
  2005-08-20 14:28     ` Robert A Duff
@ 2005-08-21 17:37     ` Steve
  2005-08-21 21:45       ` Randy
  1 sibling, 1 reply; 27+ messages in thread
From: Steve @ 2005-08-21 17:37 UTC (permalink / raw)


"Jeffrey R. Carter" <spam@spam.com> wrote in message 
news:mtxNe.9344$RS.5707@newsread3.news.pas.earthlink.net...
> Adrian Knoth wrote:
>
>> It is a named parameter. You can use it to rearrange the order
>> of your parameters when calling a function/procedure.
>
> It's more about clarity than order. Something like
>
> Insert (Into => Name_List, Item => Current.Name);
>
> is usually clearer than
>
> Insert (Name_List, Current.Name);
>

A few years ago I translated a bunch of Pascal source code to Ada using a 
tool I obtained through this newsgroup.  I tweaked the sources of the 
translator to qualify all of the names in the procedure and function calls 
in the generated Ada code.  In most cases it made the code more readable 
than the original Pascal sources.  It also identified a number of bugs.

Steve
(The Duck)

> -- 
> Jeff Carter
> "Mr. President, we must not allow a mine-shaft gap!"
> Dr. Strangelove
> 33 





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

* Re: basic ada question
  2005-08-21 17:37     ` Steve
@ 2005-08-21 21:45       ` Randy
  2005-08-22 13:41         ` Steve
  0 siblings, 1 reply; 27+ messages in thread
From: Randy @ 2005-08-21 21:45 UTC (permalink / raw)


Steve wrote:

>>
> 
> 
> A few years ago I translated a bunch of Pascal source code to Ada using a 
> tool I obtained through this newsgroup.  I tweaked the sources of the 
> translator to qualify all of the names in the procedure and function calls 
> in the generated Ada code.  In most cases it made the code more readable 
> than the original Pascal sources.  It also identified a number of bugs.
> 
> Steve
> (The Duck)

Hi.  That sounds like an interesting tool.  Do you have a link to it 
still or perhaps I can get a copy through email?
Thanks a lot :)
(Does it have source too? or just binary?)
Randy



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

* Re: basic ada question
  2005-08-19 20:22   ` Simon Wright
  2005-08-19 21:13     ` Adrian Knoth
@ 2005-08-22 13:28     ` Marc A. Criley
  1 sibling, 0 replies; 27+ messages in thread
From: Marc A. Criley @ 2005-08-22 13:28 UTC (permalink / raw)


Simon Wright wrote:

> I sometimes find myself using a mixed style,
> 
>                Invalidate (Current_Item (Using),
>                            If_For_Instance =>
>                              Instance_Base_P (For_The_Instance));

I find the mixed style particularly valuable in situations where Boolean 
arguments are used.  For example, if I had the procedure declaration:

   procedure Do_Something(To_This_Instance   : in Item_Type;
                          First_Time_Through : in Boolean);

Invocations of this procedure could look like:

    Do_Something(Current_Instance, True);

Correct, but that "True" doesn't tell you a whole lot.  You could
define your own two-value enumeration, with enumerals First and
Not_First, but all you really need in that procedure is just plain
old Boolean.  You could also subtype Boolean, use renames clauses on,
or define constants for, True and False, but that's just more code
that could easily distract the reader, when all you really need is
an invocation like this:

    Do_Something(Current_Instance, First_Time_Through => True);

Within the procedure's implementation, the context and appropriateness
of the Boolean argument is apparent, and the invocation of it using
named notation for the Boolean parameter pulls some of that context into
the caller for increased clarity.

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



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

* Re: basic ada question
  2005-08-21 21:45       ` Randy
@ 2005-08-22 13:41         ` Steve
  2005-08-23  1:47           ` Steve
  0 siblings, 1 reply; 27+ messages in thread
From: Steve @ 2005-08-22 13:41 UTC (permalink / raw)


"Randy" <abuse@127.0.0.1> wrote in message 
news:xB6Oe.6857$M3.4264@trnddc05...
> Steve wrote:
>
>>>
>>
>>
>> A few years ago I translated a bunch of Pascal source code to Ada using a 
>> tool I obtained through this newsgroup.  I tweaked the sources of the 
>> translator to qualify all of the names in the procedure and function 
>> calls in the generated Ada code.  In most cases it made the code more 
>> readable than the original Pascal sources.  It also identified a number 
>> of bugs.
>>
>> Steve
>> (The Duck)
>
> Hi.  That sounds like an interesting tool.  Do you have a link to it still 
> or perhaps I can get a copy through email?
> Thanks a lot :)
> (Does it have source too? or just binary?)
> Randy

I will email the original author of the translator to see if he has any 
objections to my passing on the sources.

A couple of notes:
  The module was written specifically to translate VAXeln Pascal (EPascal).
  Comments in the sources are very sparse (it took me a long time to make 
revisions).
  The translation was not complete, but was probably better than 95%.
  It got a few (though very few) things wrong.

It's been a while, but as I recall after running the translator it took 
about 20 minutes per KSLOC to fix up the translated code.

Steve
(The Duck)





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

* Re: basic ada question
  2005-08-22 13:41         ` Steve
@ 2005-08-23  1:47           ` Steve
  2005-08-23 17:24             ` Martin Krischik
  0 siblings, 1 reply; 27+ messages in thread
From: Steve @ 2005-08-23  1:47 UTC (permalink / raw)


"Steve" <nospam_steved94@comcast.net> wrote in message 
news:A8GdnUVARKDeSJTeRVn-qw@comcast.com...
> "Randy" <abuse@127.0.0.1> wrote in message 
> news:xB6Oe.6857$M3.4264@trnddc05...
[snip]
> I will email the original author of the translator to see if he has any 
> objections to my passing on the sources.
>
> A couple of notes:
>  The module was written specifically to translate VAXeln Pascal (EPascal).
>  Comments in the sources are very sparse (it took me a long time to make 
> revisions).
>  The translation was not complete, but was probably better than 95%.
>  It got a few (though very few) things wrong.
>
> It's been a while, but as I recall after running the translator it took 
> about 20 minutes per KSLOC to fix up the translated code.
>

FYI: I have permission to redistribute the sources, now I just need to find 
my latest snapshot and a place to upload them.

Steve
(The Duck)


> Steve
> (The Duck)
>
> 





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

* Re: basic ada question
  2005-08-23  1:47           ` Steve
@ 2005-08-23 17:24             ` Martin Krischik
  2005-08-23 21:32               ` Adrian Knoth
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Krischik @ 2005-08-23 17:24 UTC (permalink / raw)


Steve wrote:

> "Steve" <nospam_steved94@comcast.net> wrote in message
> news:A8GdnUVARKDeSJTeRVn-qw@comcast.com...
>> "Randy" <abuse@127.0.0.1> wrote in message
>> news:xB6Oe.6857$M3.4264@trnddc05...
> [snip]
>> I will email the original author of the translator to see if he has any
>> objections to my passing on the sources.
>>
>> A couple of notes:
>>  The module was written specifically to translate VAXeln Pascal
>>  (EPascal). Comments in the sources are very sparse (it took me a long
>>  time to make
>> revisions).
>>  The translation was not complete, but was probably better than 95%.
>>  It got a few (though very few) things wrong.
>>
>> It's been a while, but as I recall after running the translator it took
>> about 20 minutes per KSLOC to fix up the translated code.
>>
> 
> FYI: I have permission to redistribute the sources, now I just need to
> find my latest snapshot and a place to upload them.

There is allways SourceForge or Tigris.

Martin

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



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

* Re: basic ada question
  2005-08-23 17:24             ` Martin Krischik
@ 2005-08-23 21:32               ` Adrian Knoth
  2005-08-24 16:41                 ` Martin Krischik
  0 siblings, 1 reply; 27+ messages in thread
From: Adrian Knoth @ 2005-08-23 21:32 UTC (permalink / raw)


Martin Krischik <krischik@users.sourceforge.net> wrote:

[pascal-to-ada]
>> FYI: I have permission to redistribute the sources, now I just need to
>> find my latest snapshot and a place to upload them.
> There is allways SourceForge or Tigris.

If the code should not be maintained, it is no problem to put
it on my website. Sourceforge seems to be write-only (afterwards
the code is somewhere noone could remember ;)


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Morgenstund hat Gold im Mund, und Gold im Mund ist ungesund



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

* Re: basic ada question
  2005-08-23 21:32               ` Adrian Knoth
@ 2005-08-24 16:41                 ` Martin Krischik
  0 siblings, 0 replies; 27+ messages in thread
From: Martin Krischik @ 2005-08-24 16:41 UTC (permalink / raw)


Adrian Knoth wrote:

> Martin Krischik <krischik@users.sourceforge.net> wrote:
> 
> [pascal-to-ada]
>>> FYI: I have permission to redistribute the sources, now I just need to
>>> find my latest snapshot and a place to upload them.
>> There is allways SourceForge or Tigris.
> 
> If the code should not be maintained, it is no problem to put
> it on my website. Sourceforge seems to be write-only (afterwards
> the code is somewhere noone could remember ;)

Actually the opposite is true - as long as the original uploader won't
foreget to fill in the trove category. Also you can request to take over a
project if it is stalled. As such SF projects have better survival rates.

Martin

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



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

end of thread, other threads:[~2005-08-24 16:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19 16:35 basic ada question Randy
2005-08-19 17:55 ` Adrian Knoth
2005-08-19 20:22   ` Simon Wright
2005-08-19 21:13     ` Adrian Knoth
2005-08-22 13:28     ` Marc A. Criley
2005-08-19 21:43   ` Randy
2005-08-19 22:03     ` Adrian Knoth
2005-08-20  3:30   ` Jeffrey R. Carter
2005-08-20 14:28     ` Robert A Duff
2005-08-21 17:37     ` Steve
2005-08-21 21:45       ` Randy
2005-08-22 13:41         ` Steve
2005-08-23  1:47           ` Steve
2005-08-23 17:24             ` Martin Krischik
2005-08-23 21:32               ` Adrian Knoth
2005-08-24 16:41                 ` Martin Krischik
2005-08-20  6:36   ` [OT] Randy
2005-08-20 12:58     ` [OT] Larry Kilgallen
2005-08-20 19:48       ` [OT] Randy
2005-08-20 20:25         ` [OT] Adrian Knoth
2005-08-20 21:55           ` [OT] Way out in Left field Randy
2005-08-20 22:44           ` [OT] Randy
2005-08-20 21:27     ` [OT] TEST Randy
2005-08-20 22:52       ` Frank J. Lhota
2005-08-20 23:00         ` Randy
2005-08-20 22:31 ` [ot] test Randy
2005-08-20 22:39 ` Randy

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