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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Sun, 29 Aug 2010 11:12:37 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <4c77d250$0$7653$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1283094744 11352 192.74.137.71 (29 Aug 2010 15:12:24 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 29 Aug 2010 15:12:24 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:HDbdMWlGxyyRU6UvvmfmAwYH8Kk= Xref: g2news1.google.com comp.lang.ada:13816 Date: 2010-08-29T11:12:37-04:00 List-Id: Natasha Kerensikova writes: > Well, let's relatively well hidden compared to its C counterpart, where > I'm only "man gcc" away from the exhaustive list of command-line > switches, or "man whatever_function" away from a standard library > function documentation. I hate man pages, because they tend to require that I already know what I'm looking for. Interestingly, usually when I do "man " these days, I often get a man page that tells me to go look at the "info" docs. Anyway, man pages wouldn't make a lot of sense for windows users. > But then it might be more FreeBSD's fault than GNAT's, considering > provided GNAT man pages don't cover Ada stuff, and provided GNAT info > pages are not in info search path. But then calling the user manual info > file "gnat_ugn.info" is quite unintuitive, and the organization of the > info file looks pretty messy (but then again I'm not used to info > pages, and man pages tend to be shorter and more specialized). OK, but now you know where to find the GNAT docs. I suggest you print out the .pdf files and read them. Or look at the .txt files in your favorite text editor (and search for things). Or look at the .html files in your browser. Or use info. Whatever you're most comfortable with. >>> function Root(From : in Container) return Cursor is >>> begin >>> return Cursor'(Parent => null, Node => From.Root); >>> end Root; >> >> Nothing wrong with that. I would probably write >> "return (Parent => null, Node => From.Root);" > > I wasn't aware of that even-shorter form. "(Parent => null, Node => From.Root)" is an aggregate. It's type is determined from context (in this case, the expected type of the expression is Cursor, because that's what the function returns). "T'(X)" is a qualified expression -- it tells you that the type of X is T. This is necessary when the type is ambiguous. You can also use it for clarity when it's not necessary. Combining the two, you have "Cursor'((Parent => null, Node => From.Root))", but there's a special syntax rule that allows you to leave out one set of parentheses, whenever an aggregate is used as the argument of a qualified expression. >...I should really take the time > to read the reference manual (hoping now I've reached the level needed > to understand it). Well, the RM is pretty tough going. I suggest a text book instead. The Barnes book, for example -- it's fun to read because of John's wry sense of humour. There are also some on-line tutorials you can find via google. > Thanks for your remarks, You're welcome. - Bob