<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Gem #20: Using pragma Shared_Passive for data persistence</title>
	<atom:link href="http://www.adacore.com/2007/12/03/ada-gem-20/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adacore.com/2007/12/03/ada-gem-20/</link>
	<description>AdaCore technology and news</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:59:19 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/12/03/ada-gem-20/comment-page-1/#comment-594</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Thu, 06 Dec 2007 19:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/12/03/ada-gem-20/#comment-594</guid>
		<description>Pascal,

Thanks.  I&#039;d not read about Annex E before reading this.  Now my head hurts. :-)</description>
		<content:encoded><![CDATA[<p>Pascal,</p>
<p>Thanks.  I&#8217;d not read about Annex E before reading this.  Now my head hurts. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pascal Obry</title>
		<link>http://www.adacore.com/2007/12/03/ada-gem-20/comment-page-1/#comment-591</link>
		<dc:creator>Pascal Obry</dc:creator>
		<pubDate>Thu, 06 Dec 2007 17:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/12/03/ada-gem-20/#comment-591</guid>
		<description>Paul,

Yes you are right the output is just a stream. And it is
indeed possible to specify the streamed format. We could
link together this gem with the previous one on stream
using an XML format.

For example the following store implementation will
outout counter as an XML like stream:

with Ada.Streams;
package Store is
   pragma Shared_Passive;

   use Ada.Streams;

   type My_Int is new Integer;

   procedure Write_Int
      (S : access Root_Stream_Type&#039;Class; V : in My_Int);
   for My_Int&#039;Write use Write_Int;

   Counter : My_Int := 0;
end Store;

package body Store is
   procedure Write_Int
      (S : access Root_Stream_Type&#039;Class; V : in My_Int) is
   begin
      String&#039;Write
         (S, &quot;&quot; &amp; My_Int&#039;Image (V) &amp; &quot;&quot;);
   end Write_Int;
end Store;

The &#039;Read implementation is left to the reader as
an exercice.

Pascal.</description>
		<content:encoded><![CDATA[<p>Paul,</p>
<p>Yes you are right the output is just a stream. And it is<br />
indeed possible to specify the streamed format. We could<br />
link together this gem with the previous one on stream<br />
using an XML format.</p>
<p>For example the following store implementation will<br />
outout counter as an XML like stream:</p>
<p>with Ada.Streams;<br />
package Store is<br />
   pragma Shared_Passive;</p>
<p>   use Ada.Streams;</p>
<p>   type My_Int is new Integer;</p>
<p>   procedure Write_Int<br />
      (S : access Root_Stream_Type&#8217;Class; V : in My_Int);<br />
   for My_Int&#8217;Write use Write_Int;</p>
<p>   Counter : My_Int := 0;<br />
end Store;</p>
<p>package body Store is<br />
   procedure Write_Int<br />
      (S : access Root_Stream_Type&#8217;Class; V : in My_Int) is<br />
   begin<br />
      String&#8217;Write<br />
         (S, &#8220;&#8221; &amp; My_Int&#8217;Image (V) &amp; &#8220;&#8221;);<br />
   end Write_Int;<br />
end Store;</p>
<p>The &#8216;Read implementation is left to the reader as<br />
an exercice.</p>
<p>Pascal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pascal Obry</title>
		<link>http://www.adacore.com/2007/12/03/ada-gem-20/comment-page-1/#comment-590</link>
		<dc:creator>Pascal Obry</dc:creator>
		<pubDate>Thu, 06 Dec 2007 17:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/12/03/ada-gem-20/#comment-590</guid>
		<description>Christoph,

Thanks for the kind words. The GNAT implementation should
indeed be specified clearly.

Pascal.</description>
		<content:encoded><![CDATA[<p>Christoph,</p>
<p>Thanks for the kind words. The GNAT implementation should<br />
indeed be specified clearly.</p>
<p>Pascal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/12/03/ada-gem-20/comment-page-1/#comment-584</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Tue, 04 Dec 2007 16:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/12/03/ada-gem-20/#comment-584</guid>
		<description>In what format is the data stored?  I presume that it&#039;s essentially a stream output (e.g. &#039;Output)?  If so, it might be interesting if the &#039;Output could be overridden (assuming the Ada.Streams is Pure - which I haven&#039;t looked at).

Thanks for a cool gem!</description>
		<content:encoded><![CDATA[<p>In what format is the data stored?  I presume that it&#8217;s essentially a stream output (e.g. &#8216;Output)?  If so, it might be interesting if the &#8216;Output could be overridden (assuming the Ada.Streams is Pure &#8211; which I haven&#8217;t looked at).</p>
<p>Thanks for a cool gem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christoph Grein</title>
		<link>http://www.adacore.com/2007/12/03/ada-gem-20/comment-page-1/#comment-583</link>
		<dc:creator>Christoph Grein</dc:creator>
		<pubDate>Tue, 04 Dec 2007 07:33:07 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/12/03/ada-gem-20/#comment-583</guid>
		<description>Hey, that&#039;s a really nice gem, actually. Two remarks, though.

The storing in a file is, I reckon, a GNAT implementation detail (at least the file name). This should be pointed out. AARM E.1(11.a)

Where in the RM is it specified that the initialisation of a shared passive variable is only performed the very first time? I searched the whole RM, but without avail.</description>
		<content:encoded><![CDATA[<p>Hey, that&#8217;s a really nice gem, actually. Two remarks, though.</p>
<p>The storing in a file is, I reckon, a GNAT implementation detail (at least the file name). This should be pointed out. AARM E.1(11.a)</p>
<p>Where in the RM is it specified that the initialisation of a shared passive variable is only performed the very first time? I searched the whole RM, but without avail.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

