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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c9d5fc258548b22a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y12g2000prf.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Tue, 8 Feb 2011 12:52:06 -0800 (PST) Organization: http://groups.google.com Message-ID: <60094497-35cc-496a-95b5-0e4a57f342ef@y12g2000prf.googlegroups.com> References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <4d4ff70e$0$6886$9b4e6d93@newsspool2.arcor-online.net> <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.googlegroups.com> <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> <1f229967-d3cf-42b6-8087-c97ee08652f3@i40g2000yqh.googlegroups.com> <4d51169e$0$7657$9b4e6d93@newsspool1.arcor-online.net> <4d51905c$0$19486$882e7ee2@usenet-news.net> <36212a7b-deab-45d9-ac45-aa29cd90c7bc@o18g2000prh.googlegroups.com> <4d51a7bb$0$19486$882e7ee2@usenet-news.net> NNTP-Posting-Host: 174.28.151.164 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1297198326 8472 127.0.0.1 (8 Feb 2011 20:52:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Feb 2011 20:52:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y12g2000prf.googlegroups.com; posting-host=174.28.151.164; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17033 Date: 2011-02-08T12:52:06-08:00 List-Id: On Feb 8, 1:27=A0pm, Hyman Rosen wrote: > On 2/8/2011 3:11 PM, Shark8 wrote:> No, that's not it. What is 'it' is th= at the C programmers =A0treated > > =A0> Ada as if it were C and the result was, as expected, bad Ada. > > It is my understanding that Ada proponents believe that > using Ada results in better programs than using C. First off, I purposely did not say (or even imply) that using Ada "automagically" makes one a better programmer, or that it makes the programs themselves better. Let me put it a different way: pneumatic tires are a pretty good development; they can absorb shock to some degree as well as allowing a measure of protection from damage to the wheels {rim/hub} and in so doing help minimize the cost of when you eventually run into some road hazard.... but there is NOTHING preventing you from going out and letting all the air out of your tires and experiencing the same wheel-cost as the old covered-wagons, no? IOW, Ada could have all the most wonderful features and helps possible but if one never uses them then they do no good whatsoever to that person. > But when presented with a program written in Ada that is not > demonstrably better, that program is removed from the set > of Ada programs under consideration by virtue of having > been written by "C people". That is precisely the "no true > Scotsman" fallacy. Again, I was not dismissing any program in itself, or even class of programs, and therefore the "No True Scotsman" fallacy CANNOT apply to what I presented. What is interesting, however, is some of the replies to shown examples of Ada I've written to those well-versed in C/C++ but unfamiliar with Ada. If you're interested I have a LISP interpreter* I would otherwise post to show some of the the "wows" I've gotten; and I'm not doing anything too spectacular things like having my overwriting the S_Expression type's 'read and 'write attributes so I could do something like: Ada.Text_IO.Put_Line( "Begin Run:" ); Open( Input, In_File, Name =3D> "Temp.Txt" ); Declare In_Stream : Access Ada.Streams.Root_Stream_Type'Class:=3D Ada.Text_IO.Text_Streams.Stream( Input ); Use LISP; Begin S_Expression'Read( In_Stream, S ); -- Here's where EVAL would go. S_Expression'Write( Out_Stream, S ); End; Ada.Text_IO.Put_Line( "" ); Ada.Text_IO.Put_Line( "End Run." ); Close( Input ); *Not working, I still have to implement the atomic-level functions, the special-forms cases {like 'if'}, and the Eval function. > > The reverse is less true, I think. If you give an Ada =A0Programmer > > =A0> a "must do" in C, AND he applied the theory/ideology of Ada > =A0> {specifically contract enforcement & rejection/culling of bad > =A0> values}, then the result would NOT be "bad C"... would it? > > In other words, training in a certain style of programming leads > to better programs. Sure, that's plausible. More than plausible. I've had professors able to spot that I'd been 'trained' in Pascal from reading my C-code. "Trained" here actually being self-taught with little more than the compiler and the user's manual for the compiler.