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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3d9e8b4af1a21f1e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: newline in a simple program Reply-To: anon@anon.org (anon) References: X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Wed, 19 Dec 2007 04:35:31 GMT NNTP-Posting-Host: 12.64.48.211 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1198038931 12.64.48.211 (Wed, 19 Dec 2007 04:35:31 GMT) NNTP-Posting-Date: Wed, 19 Dec 2007 04:35:31 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:18998 Date: 2007-12-19T04:35:31+00:00 List-Id: -- -- -- GNAT.IO and "System.IO" uses the "printf" -- -- "Ada.Text_IO" uses "fprintf" because it is based on file stucture. -- Since this package uses files it must closed and -- the core library routine adds a NL character during -- the closing process. -- with Ada.Text_IO ; with GNAT.IO ; with System.IO ; procedure y is begin Ada.Text_IO.Put ( "Testing NL" ) ; GNAT.IO.Put ( "Testing NL" ) ; System.IO.Put ( "Testing NL" ) ; Ada.Text_IO.Put_Line ( "DONE" ) ; end y ; In , Paul writes: >Hi, given the following two simple programs > > >hello.adb >----------------------- >with ada.text_io; >procedure hello is >begin >ada.text_io.put("hello"); >end hello; >----------------------- > > >hello.c >----------------------- >#include >int main() >{ > printf("hello"); >} >----------------------- > >the result for the ada program is: >----------------------- >$ ./hello_in_ada >hello >$ >----------------------- > >and for the c program: >----------------------- >$ ./hello_in_c >hello$ >----------------------- > >The c program does not print a new-line, but the ada program does. > >Is there any way to make the ada program not print a new-line? > >And is this behavior part of the Ada standard or is it just part of gnat? > >I looked for answers, but found none. > >Thanks, > >Paul Zacharzewski