comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Ada e-books
Date: Thu, 19 Nov 2015 11:19:44 -0700
Date: 2015-11-19T11:19:44-07:00	[thread overview]
Message-ID: <n2l3nl$fs6$2@dont-email.me> (raw)
In-Reply-To: <b0497861-2d1c-4ca0-9cb3-3fb4ddbba17e@googlegroups.com>

On 11/19/2015 02:41 AM, Serge Robyns wrote:
> 
> I did indeed find the LRM e-book and this is why I've been asking for the
> 2012 AARM (I'll add 2A's to avoid confusion).  I'm interested in the
> annotated version in e-book format.  I want to try to read it as I've been
> facing a few issues, miscomprehension, etc. in the hope to understand better
> some 'particularities' and things like the Rosen trick and others.

The ARM and AARM are available at

http://www.ada-auth.org/arm.html

in HTML, PDF, and text versions. I'm not aware of any e-book versions of the
AARM. Most e-readers can display PDFs.

The title of the document is /Ada Reference Manual/, which is why many of us
refer to it as the ARM and interpret the A in ARM as "Ada". It's sometimes
referred to as the RM or LRM, which naturally lead to the questions, "RM for
what?" and "Which language?", which in this context are both answered, "Ada." So
yes, you need to say AARM here to refer to the Annotated ARM.

> I do agree with another post about the price of Programming in Ada 2012.
> However the Kindle format is reasonably priced, but then I don't have a
> Kindle.

The Kindle app on Android tablets works well. I've heard that Calibre can
convert AZW to EPUB, but unless you've done it before you probably won't want to
buy a book

The Rosen trick is used to gain write access to an in-mode parameter. It was
needed pre-Ada 12 to simulate in-out mode parameters to functions; Ada 12 allows
such parameters so it is not needed as much. An example is the Generator passed
to a random-number function such as Ada.Numerics.Float_Random.Random, specified as

function Random (Gen : Generator) return Uniformly_Distributed;

An example of its use can be found in pkg PragmARC.Threefry_Random:

   type Generator is tagged limited private;

   function Random (State : in Generator) return Unsigned_32;
...
   type Generator_Ptr is access all Generator;

   type Generator_Handle (State : Generator_Ptr) is limited null record;

   type Generator is new Ada.Finalization.Limited_Controlled with record
      Handle  : Generator_Handle (State => Generator'Unchecked_Access);
         -- The Rosen Trick
      Key     : Unsigned_256;
      State   : Unsigned_256;
      Output  : Unsigned_256;
      Counter : Natural;
   end record;

Write access to the State parameter of Random can be obtained though

      S : Generator renames State.Handle.State.all;

The PragmARCs are available at

https://pragmada.x10hosting.com/pragmarc.htm

PragmARC.Threefry_Random is only part of the version for ISO/IEC 8652:2007.

-- 
Jeff Carter
"Go and boil your bottoms."
Monty Python & the Holy Grail
01


  reply	other threads:[~2015-11-19 18:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 22:55 Ada e-books Serge Robyns
2015-11-17 23:01 ` Paul Rubin
2015-11-18  8:29   ` Serge Robyns
2015-11-18 12:14     ` Dirk Craeynest
2015-11-19  9:41       ` Serge Robyns
2015-11-19 18:19         ` Jeffrey R. Carter [this message]
2015-11-19 18:35           ` Simon Wright
2015-11-19 20:51             ` Jeffrey R. Carter
2015-11-19 21:29               ` J-P. Rosen
2015-11-19 22:10                 ` Jeffrey R. Carter
2015-11-19 21:50             ` Randy Brukardt
2015-11-19 22:10               ` Simon Wright
2015-11-19 22:17               ` Bob Duff
2015-11-20 21:12                 ` Randy Brukardt
2015-11-20 22:25                   ` Bob Duff
2015-11-22  3:27                     ` John Smith
2015-11-23  9:45                       ` Serge Robyns
2015-11-25 14:01             ` leif.roar
2015-11-25 17:03             ` Paul Rubin
2015-11-19 19:44           ` Serge Robyns
2015-11-20  1:33         ` Steve Johnson
2015-11-19  1:24     ` Steve Johnson
2015-11-19  9:27       ` Hadrien Grasland
2015-11-17 23:29 ` Jeffrey R. Carter
2015-11-18  3:12 ` David Botton
replies disabled

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