comp.lang.ada
 help / color / mirror / Atom feed
* Looping over a tagged record?
@ 2001-06-19 20:39 M R Goodwin
  2001-06-19 21:31 ` Pascal Obry
                   ` (5 more replies)
  0 siblings, 6 replies; 54+ messages in thread
From: M R Goodwin @ 2001-06-19 20:39 UTC (permalink / raw)


Hi!

This is a part practical, and a part 'I wonder' type problem.
I have a tagged record that is pretty big.  Most, but not all of
the elements in it are a bounded string type.  Because I don't feel
like the typing and all I would need to do to assign and later change
values, I was wondering if there is anyway to loop over all elements in
the record, checking their type and then taking the right action...

type Big_record is tagged record
a1 : String_60;
a2 : String_60;
n1 : Integer;
...
a30 : String_60;
end record;

And I want to do something like:
(And yes, I know its not Ada code!)
For I in ?number of elements? loop
	if I is Integer then Blah, blah
	elsif I is String_60 Blah, Blah.
end;


I've been messing around with it, and have not come to any workable
solution.

Thanks for the help,

Matthew



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
@ 2001-06-19 21:31 ` Pascal Obry
  2001-06-19 21:32 ` Pascal Obry
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 54+ messages in thread
From: Pascal Obry @ 2001-06-19 21:31 UTC (permalink / raw)



"M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> writes:

> I've been messing around with it, and have not come to any workable
> solution.

This is maybe because the design is wrong. Your description of the problem is
a bit dubious to me !

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
  2001-06-19 21:31 ` Pascal Obry
@ 2001-06-19 21:32 ` Pascal Obry
  2001-06-19 22:20   ` Samuel T. Harris
  2001-06-20  1:33 ` Pat Rogers
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 54+ messages in thread
From: Pascal Obry @ 2001-06-19 21:32 UTC (permalink / raw)



"M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> writes:

> Hi!
> 
> This is a part practical, and a part 'I wonder' type problem.
> I have a tagged record that is pretty big.  Most, but not all of
> the elements in it are a bounded string type.  Because I don't feel
> like the typing and all I would need to do to assign and later change
> values, I was wondering if there is anyway to loop over all elements in
> the record, checking their type and then taking the right action...

And now to answer your question: No there is no way to iterate through record's
fields.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 21:32 ` Pascal Obry
@ 2001-06-19 22:20   ` Samuel T. Harris
  2001-06-19 23:45     ` mgoodwinSPAMMY
  0 siblings, 1 reply; 54+ messages in thread
From: Samuel T. Harris @ 2001-06-19 22:20 UTC (permalink / raw)


Pascal Obry wrote:
> 
> "M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> writes:
> 
> > Hi!
> >
> > This is a part practical, and a part 'I wonder' type problem.
> > I have a tagged record that is pretty big.  Most, but not all of
> > the elements in it are a bounded string type.  Because I don't feel
> > like the typing and all I would need to do to assign and later change
> > values, I was wondering if there is anyway to loop over all elements in
> > the record, checking their type and then taking the right action...
> 
> And now to answer your question: No there is no way to iterate through record's
> fields.
> 
> Pascal.

I'm missing the original posting so here are my thoughts
bases on this snippet.

Given that Mr. Goodwin know what to do which each field type
and given the every way to get a record object implies the
code knows which record to expect, then I don't see why
Mr. Goodwin needs to "iterate" on each field since the code
will know which fields to expect and should not necessarily
need to query the type of each field.

It seems to me that given the operation in question being
define for scalar types, then one can easily define the
operation for each composite type as one defines them.
In other words, the type declaration should define
how said operation will be perform on the components.

The problem statement appears dubious to me as well.

Now, if Mr. Goodwin is simply trying to avoid lots of
boilerplate typing when applying this operation to 
composite types, especially records type which are
by definition heterogenous, then he can either use
generics such as I use to implement general width/image/value
function for all types OR he can use an ASIS based
tool to find his composite types and "generate" the
operation body specific to the contents of the composite
type.

-- 
Samuel T. Harris, Senior Software Engineer II
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 22:20   ` Samuel T. Harris
@ 2001-06-19 23:45     ` mgoodwinSPAMMY
  0 siblings, 0 replies; 54+ messages in thread
From: mgoodwinSPAMMY @ 2001-06-19 23:45 UTC (permalink / raw)


In article <3B2FD019.AC7B00F2@gsde.hou.us.ray.com>, "Samuel T. Harris"
<u61783@gsde.hou.us.ray.com> wrote:

Thank you gentlemen, you answered me quite well. Sorry to have a dubious
statement of the problem, was using the wrong part of the brain at the
time :)

Thanks again,

M. R. Goodwin



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
  2001-06-19 21:31 ` Pascal Obry
  2001-06-19 21:32 ` Pascal Obry
@ 2001-06-20  1:33 ` Pat Rogers
  2001-06-20  3:13   ` Pat Rogers
  2001-06-20  2:58 ` DuckE
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 54+ messages in thread
From: Pat Rogers @ 2001-06-20  1:33 UTC (permalink / raw)


You need reflection for that right.  I know of only one implementation for
Ada, but it isn't ready for prime time.
---
Patrick Rogers                       Consulting and Training in:
http://www.classwide.com          Real-Time/OO Languages
progers@classwide.com               Hard Deadline Schedulability Analysis
(281)648-3165                                 Software Fault Tolerance


"M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> wrote in message
news:9god9a$g04$0@208.164.98.151...
> Hi!
>
> This is a part practical, and a part 'I wonder' type problem.
> I have a tagged record that is pretty big.  Most, but not all of
> the elements in it are a bounded string type.  Because I don't feel
> like the typing and all I would need to do to assign and later change
> values, I was wondering if there is anyway to loop over all elements in
> the record, checking their type and then taking the right action...
>
> type Big_record is tagged record
> a1 : String_60;
> a2 : String_60;
> n1 : Integer;
> ...
> a30 : String_60;
> end record;
>
> And I want to do something like:
> (And yes, I know its not Ada code!)
> For I in ?number of elements? loop
> if I is Integer then Blah, blah
> elsif I is String_60 Blah, Blah.
> end;
>
>
> I've been messing around with it, and have not come to any workable
> solution.
>
> Thanks for the help,
>
> Matthew





^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
                   ` (2 preceding siblings ...)
  2001-06-20  1:33 ` Pat Rogers
@ 2001-06-20  2:58 ` DuckE
  2001-06-20 13:15 ` Ted Dennison
  2001-06-21  3:09 ` Looping over a tagged record? gresset1
  5 siblings, 0 replies; 54+ messages in thread
From: DuckE @ 2001-06-20  2:58 UTC (permalink / raw)


I'll share a couple of idea's to explore:

 Idea 1)  Instead of defining the fields of the record as String_60,
Integer, etc..  Define each field as a descendent of a common object.  In
addition to the data fields, add an array of references to the fields.

Something along the lines of:
   type Field_Type is abstract tagged private;
   type Field_Type_Acc is access all Field_Type;
   type String_Field is new Field_Type with private;
   type Integer_Field is new Field_Type with private;
   type Field_List is array( Positive range <> ) of Field_Type_Acc;
   type Big_Record is tagged
     record
       A1 : aliased String_Field;
       A2 : aliased String_Field;
       N1 : aliased Integer_Field;
       Field_References : Field_List(1..3);
     end record;

Then at some point initialize "Field_References" to point to the fields
within the same object.  If Big_Record is derived from Ada.Finalization,
then Field_References may be initialized automatically.

  Idea 2) Keep your existing record definition, but define each field as
aliased.  Then create a list of objects where again each object descends
from the same base class, only now each different object contains a
reference to each of the field types.

Both of these approaches use the same basic theme of setting up an array
that gives you access to all elements using a common base class.  I believe
both of these approaches are "workable" but neither is particularly elegant
or pretty.

I hope this helps,
SteveD


"M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> wrote in message
news:9god9a$g04$0@208.164.98.151...
> Hi!
>
> This is a part practical, and a part 'I wonder' type problem.
> I have a tagged record that is pretty big.  Most, but not all of
> the elements in it are a bounded string type.  Because I don't feel
> like the typing and all I would need to do to assign and later change
> values, I was wondering if there is anyway to loop over all elements in
> the record, checking their type and then taking the right action...
>
> type Big_record is tagged record
> a1 : String_60;
> a2 : String_60;
> n1 : Integer;
> ...
> a30 : String_60;
> end record;
>
> And I want to do something like:
> (And yes, I know its not Ada code!)
> For I in ?number of elements? loop
> if I is Integer then Blah, blah
> elsif I is String_60 Blah, Blah.
> end;
>
>
> I've been messing around with it, and have not come to any workable
> solution.
>
> Thanks for the help,
>
> Matthew





^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-20  1:33 ` Pat Rogers
@ 2001-06-20  3:13   ` Pat Rogers
  0 siblings, 0 replies; 54+ messages in thread
From: Pat Rogers @ 2001-06-20  3:13 UTC (permalink / raw)


"Pat Rogers" <progers@classwide.com> wrote in message
news:84TX6.185$Xh7.12973@nnrp1.sbc.net...
> You need reflection for that right.  I know of only one implementation for
> Ada, but it isn't ready for prime time.

Sigh -- I meant "for that to be done right".





^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
                   ` (3 preceding siblings ...)
  2001-06-20  2:58 ` DuckE
@ 2001-06-20 13:15 ` Ted Dennison
  2001-06-20 15:01   ` M. A. Alves
  2001-06-21  3:09 ` Looping over a tagged record? gresset1
  5 siblings, 1 reply; 54+ messages in thread
From: Ted Dennison @ 2001-06-20 13:15 UTC (permalink / raw)


In article <9god9a$g04$0@208.164.98.151>, M R Goodwin says...
>I have a tagged record that is pretty big.  Most, but not all of
>the elements in it are a bounded string type.  Because I don't feel
>like the typing and all I would need to do to assign and later change
>values, I was wondering if there is anyway to loop over all elements in
>the record, checking their type and then taking the right action...

If you really need to do this, you probably should have put the bounded strings
into an array inside the record, instead of just making them flat fields.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-20 13:15 ` Ted Dennison
@ 2001-06-20 15:01   ` M. A. Alves
  2001-06-21  2:36     ` DuckE
  2001-06-21 17:08     ` Charles Hixson
  0 siblings, 2 replies; 54+ messages in thread
From: M. A. Alves @ 2001-06-20 15:01 UTC (permalink / raw)
  To: comp.lang.ada

> >. . , I was wondering if there is anyway to loop over all elements in
> >the record, checking their type and then taking the right action...
> 
> If you really need to do this, you probably should have put the
> bounded strings into an array inside the record, instead of just
> making them flat fields.

Often I also want to merge record and array i.e. have named _and_
iteratable "components". Theoretically this comes down to "types as
objects", which Ada doesn't have. Practically, a "standard" Ada idiom for
this is an heterogenous array indexed on an enumeration e.g. (not tested):

  ...
  type Field_Ptr is access Field'Class;
  type Field_Names is (Field_1, Field_2, Field_3);
  type Record_Type is array(Field_Names) of Field_Ptr;
  A_Record: Record_Type := (
    Field_1 => Field_Constructor_A(...),
    Field_2 => Field_Constructor_A(...),
    Field_3 => Field_Constructor_B(...));

Now we have a record-like object A_Record with "components" Field_1,
Field_2 of "type" A and Field_3 of "type" B. This example assumes
class-wide programming (including dispatching), with (tagged) type Field
being the root of some derivation class. Iterating over A_Record's
"components":

  for I in A_Record'Range loop
    Do_Something(A_Record(I).all); -- dispatching call
  end loop;

Accessing "components" by name:

  Do_Something(A_Record(Field_1).all);

This particular approach has a notorious shortcoming: field types are not
checked (Field_Ptr values can reference _any_ derived type in the class).
The remedy for this is left as an exercise ;-)

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150 PORTO, Portugal        mob 351+939354002




^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-20 15:01   ` M. A. Alves
@ 2001-06-21  2:36     ` DuckE
  2001-06-21 10:14       ` M. A. Alves
  2001-06-21 17:08     ` Charles Hixson
  1 sibling, 1 reply; 54+ messages in thread
From: DuckE @ 2001-06-21  2:36 UTC (permalink / raw)


"M. A. Alves" <maa@liacc.up.pt> wrote in message
news:mailman.993045741.6638.comp.lang.ada@ada.eu.org...
[snip]
>
> Often I also want to merge record and array i.e. have named _and_
> iteratable "components". Theoretically this comes down to "types as
> objects", which Ada doesn't have. Practically, a "standard" Ada idiom for
> this is an heterogenous array indexed on an enumeration e.g. (not tested):

Could you please elaborate on exactly what you mean by "types as objects"?

>
>   ...
>   type Field_Ptr is access Field'Class;
>   type Field_Names is (Field_1, Field_2, Field_3);
>   type Record_Type is array(Field_Names) of Field_Ptr;
>   A_Record: Record_Type := (
>     Field_1 => Field_Constructor_A(...),
>     Field_2 => Field_Constructor_A(...),
>     Field_3 => Field_Constructor_B(...));
>
> Now we have a record-like object A_Record with "components" Field_1,
> Field_2 of "type" A and Field_3 of "type" B. This example assumes
> class-wide programming (including dispatching), with (tagged) type Field
> being the root of some derivation class. Iterating over A_Record's
> "components":
>
>   for I in A_Record'Range loop
>     Do_Something(A_Record(I).all); -- dispatching call
>   end loop;
>
> Accessing "components" by name:
>
>   Do_Something(A_Record(Field_1).all);
>
> This particular approach has a notorious shortcoming: field types are not
> checked (Field_Ptr values can reference _any_ derived type in the class).
> The remedy for this is left as an exercise ;-)

I believe this will be caught a runtime.  But it really depends on how
Do_Something is defined.

SteveD

>
> --
>    ,
>  M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
>  A M A D O   Rua Campo Alegre, 823         fax 351+226003654
>  A L V E S   P-4150 PORTO, Portugal        mob 351+939354002
>





^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-19 20:39 Looping over a tagged record? M R Goodwin
                   ` (4 preceding siblings ...)
  2001-06-20 13:15 ` Ted Dennison
@ 2001-06-21  3:09 ` gresset1
  5 siblings, 0 replies; 54+ messages in thread
From: gresset1 @ 2001-06-21  3:09 UTC (permalink / raw)


"M R Goodwin" <mgoodwinSPAMMY@redrocketconsortium.com> wrote:

>Hi!
>
>This is a part practical, and a part 'I wonder' type problem.
>I have a tagged record that is pretty big.  Most, but not all of
>the elements in it are a bounded string type.  Because I don't feel
>like the typing and all I would need to do to assign and later change
>values, I was wondering if there is anyway to loop over all elements in
>the record, checking their type and then taking the right action...
>
>type Big_record is tagged record
>a1 : String_60;
>a2 : String_60;
>n1 : Integer;
>...
>a30 : String_60;
>end record;
>
>And I want to do something like:
>(And yes, I know its not Ada code!)
>For I in ?number of elements? loop
>	if I is Integer then Blah, blah
>	elsif I is String_60 Blah, Blah.
>end;
>
>
>I've been messing around with it, and have not come to any workable
>solution.
>
>Thanks for the help,
>
>Matthew

This looks to me like a case of trying to use a screwdriver for a saw.
In broad concept, you are trying to use an iterator to pass through
the contents of a container and should use something that is a better
fit to that model than a tagged record.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21  2:36     ` DuckE
@ 2001-06-21 10:14       ` M. A. Alves
  2001-06-21 13:24         ` Pat Rogers
  0 siblings, 1 reply; 54+ messages in thread
From: M. A. Alves @ 2001-06-21 10:14 UTC (permalink / raw)
  To: comp.lang.ada

> > Often I also want to merge record and array i.e. have named _and_
> > iteratable "components". Theoretically this comes down to "types as
> > objects", which Ada doesn't have. Practically, a "standard" Ada idiom for
> > this is an heterogenous array indexed on an enumeration e.g. (not tested):
> 
> Could you please elaborate on exactly what you mean by "types as objects"?

Essentialy that you can manipulate types as you do objects.  A language
with less basic semantic devices.  Types would be an elaboration of the
programmer.  A reflexive tower of 2 or 3 levels.  Hardly a software
engineering language.  Roughly approximative model in Ada:

  type Object is ...
  procedure Add_Property(O: Object; Name: String);
  procedure Add_Property(O: Object; Name, Value: String);
  procedure Add_Property(O: Object; Name: String; Value: Object);
  ...

  Record_Type: Object;
  Add_Property(Record_Type, "type", Type_Definition);
  Add_Property(Record_Type, "is a", "list");
  Add_Property(Record_Type, "named components");
  Add_Property(Record_Type, "iteratable");

  A_Record: Object;
  Add_Property(A_Record, "type", Record_Type);

  Field_1, Field_2, Field_3: Object;
  Add_Property(Field_1, "name", "Field_1");
  Add_Property(Field_1, "type", "A");
  Add_Property(Field_1, "name", "Field_2");                                     
  Add_Property(Field_2, "type", "A");
  Add_Property(Field_1, "name", "Field_2");
  Add_Property(Field_3, "type", "B");

  Add_Property(A_Record, "component", Field_1);
  Add_Property(A_Record, "component", Field_2);
  Add_Property(A_Record, "component", Field_3);

Iterating:

  for I in 1 .. Length(A_Record) loop
    Do_Someting(Component(A_Record, I));
  end loop;

Selecting by name:

  Do_Somenthing(Component(A_Record, "Field_1"));

> >
> >   ...
> >   type Field_Ptr is access Field'Class;
> >   type Field_Names is (Field_1, Field_2, Field_3);
> >   type Record_Type is array(Field_Names) of Field_Ptr;
> >   A_Record: Record_Type := (
> >     Field_1 => Field_Constructor_A(...),
> >     Field_2 => Field_Constructor_A(...),
> >     Field_3 => Field_Constructor_B(...));
> >
> > Now we have a record-like object A_Record with "components" Field_1,
> > Field_2 of "type" A and Field_3 of "type" B. This example assumes
> > class-wide programming (including dispatching), with (tagged) type Field
> > being the root of some derivation class. Iterating over A_Record's
> > "components":
> >
> >   for I in A_Record'Range loop
> >     Do_Something(A_Record(I).all); -- dispatching call
> >   end loop;
> >
> > Accessing "components" by name:
> >
> >   Do_Something(A_Record(Field_1).all);

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150 PORTO, Portugal        mob 351+939354002




^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21 10:14       ` M. A. Alves
@ 2001-06-21 13:24         ` Pat Rogers
  0 siblings, 0 replies; 54+ messages in thread
From: Pat Rogers @ 2001-06-21 13:24 UTC (permalink / raw)


"M. A. Alves" <maa@liacc.up.pt> wrote in message
news:mailman.993114925.4754.comp.lang.ada@ada.eu.org...
> > > Often I also want to merge record and array i.e. have named _and_
> > > iteratable "components". Theoretically this comes down to "types as
> > > objects", which Ada doesn't have. Practically, a "standard" Ada idiom
for
> > > this is an heterogenous array indexed on an enumeration e.g. (not
tested):
> >
> > Could you please elaborate on exactly what you mean by "types as
objects"?
>
> Essentialy that you can manipulate types as you do objects.  A language
> with less basic semantic devices.  Types would be an elaboration of the
> programmer.  A reflexive tower of 2 or 3 levels.  Hardly a software
> engineering language.  Roughly approximative model in Ada:
>
>   type Object is ...
>   procedure Add_Property(O: Object; Name: String);
>   procedure Add_Property(O: Object; Name, Value: String);
>   procedure Add_Property(O: Object; Name: String; Value: Object);
>   ...


Reflection is indeed the right approach for doing this in general.  A
working interface looks like this:

package OpenAda.MOP is

  type Class is tagged limited private;
    -- The idea is to represent the abstraction of a class, rather
    -- than just a (tagged) type: a class is a tagged type with
    -- an encapsulating package and primitive operations declared
    -- within that package.

  type Class_Reference is access all Class;

  type Any_Class is access all Class'Class;


-- Introspection
--     Note these should be class-wide or otherwise non-primitive
--     since they are not intended to be overridden.

  Introspection_Failure : exception;


  function Class_For( Package_Name, Type_Name : Wide_String )
    return Class_Reference;
    -- Package_Name is that of a library package declaration.
    -- Type_Name is that of a visibly tagged or extended type
    -- exported by the package indicated by Package_Name.


  -- Note the term 'primitive operation' is that of the Ada RM: the
  -- primitive operations of a type are those subprograms that are
  -- declared with the type in the same package and mention the type
  -- in the parameter and result-type profile.  See the RM Glossary.

  function Visible_Primitives( This : access Class'Class )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of pointers to either procedure or function
declarations
    -- occurring in the visible part of the enclosing package declaration


  function Hidden_Primitives( This : access Class'Class )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of pointers to either procedure or function
declarations
    -- occurring in the private part of the enclosing package declaration


  function All_Primitives( This : access Class'Class )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of pointers to either procedure or function
declarations
    -- occurring anywhere in the enclosing package declaration


  function Visible_Primitives( This  : access Class'Class;
                               Named : Wide_String )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of pointers to either procedure or function
declarations;
    -- one for every primitive named 'Named' declared in the visible part of
    -- the enclosing package declaration


  function Hidden_Primitives( This  : access Class'Class;
                              Named : Wide_String )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of pointers to either procedure or function
declarations;
    -- one for every primitive named 'Named' declared in the private part of
    -- the enclosing package declaration


  function Is_Primitive( This            : access Class'Class;
                         Subprogram_Name : Wide_String )
    return Boolean;
    -- Returns True iff Subprogram_Name exists and is primitive, false
otherwise


  function Is_Primitive( This       : access Class'Class;
                         Subprogram : access
OpenAda.Syntax.Subprogram_Declaration.Node'Class )
    return Boolean;
    -- Returns True iff designated Subprogram is primitive, false otherwise


  function Is_Primitive_Call( This : access Class'Class;
                              Call : access
OpenAda.Syntax.Procedure_Call.Node'Class )
    return Boolean;


  function Declared_Components( This : access Class'Class )
    return OpenAda.Syntax.Sequence.Reference;
    -- Returns a list of Component_Declaration.Reference or
    -- Discriminant_Specification.Reference values, but not for
    -- those components inhertied from ancestors (if any).


  function Declared_Component( This  : access Class'Class;
                               Named : Wide_String )
    return OpenAda.Syntax.Any;
    -- Returns null if no such component, otherwise returns either
    -- a Component_Declaration.Reference or
Discriminant_Specification.Reference


  function Is_Declared_Component( This           : access Class'Class;
                                  Component_Name : Wide_String )
    return Boolean;


  function Direct_Ancestor( This : access Class'Class )
    return OpenAda.Syntax.Name.Any;
    -- Returns null if not a derived type


  function Is_Abstract( This : access Class'Class )
    return Boolean;


  function Is_Declared_Limited( This : access Class'Class )
    return Boolean;
    -- returns True iff the reserved word 'limited' appears in
    -- the declaration of this type.  Hence the type might be
    -- limited if any ancestry is limited but we won't know.


  function Primary_Type_Declaration( This : access Class'Class )
    return OpenAda.Syntax.Type_Declaration.Any;


  function Enclosing_Package( This : access Class'Class )
    return OpenAda.Syntax.Package_Declaration.Any;


  function Enclosing_Compilation_Unit( This : access Class'Class )
    return OpenAda.Syntax.Compilation_Unit.Any;


  function Corresponding_Body( This : access Class'Class )
    return OpenAda.Syntax.Package_Body.Any;


  function Corresponding_Body_Compilation_Unit( This : access Class'Class )
    return OpenAda.Syntax.Compilation_Unit.Any;


  function Corresponding_Body( This      : access Class'Class;
                               Primitive :
OpenAda.Syntax.Subprogram_Declaration.Any )
    return OpenAda.Syntax.Subprogram_Body.Any;


  function Corresponding_Body( This      : access Class'Class;
                               Primitive :
OpenAda.Syntax.Procedure_Declaration.Any )
    return OpenAda.Syntax.Procedure_Body.Any;


  function Corresponding_Body( This      : access Class'Class;
                               Primitive :
OpenAda.Syntax.Function_Declaration.Any )
    return OpenAda.Syntax.Function_Body.Any;


  function Subject_Package_Name( This : access Class'Class )
    return Wide_String;


  function Subject_Type_Name( This : access Class'Class )
    return Wide_String;


  function Pragma_Metaclass_Parameters( This : access Class'Class )
    return OpenAda.Pragma_Metaclass.Any_Content;
    -- Only meaningful (non-null) when 'This' is set during translation.
    -- Returns null if 'This' is loaded manually via function Class_For.


-- Intercession

  Intercession_Failure : exception;

  function Parsed_Input( This : access Class'Class )
    return OpenAda.Syntax.Compilation.Any;
    -- returns the parsed input from the input file, ie the sequence of
compilation items


and so forth....





^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-20 15:01   ` M. A. Alves
  2001-06-21  2:36     ` DuckE
@ 2001-06-21 17:08     ` Charles Hixson
  2001-06-21 18:58       ` tmoran
  2001-06-22  2:18       ` DuckE
  1 sibling, 2 replies; 54+ messages in thread
From: Charles Hixson @ 2001-06-21 17:08 UTC (permalink / raw)


"M. A. Alves" <maa@liacc.up.pt> wrote in
news:mailman.993045741.6638.comp.lang.ada@ada.eu.org: 

>> >. . , I was wondering if there is anyway to loop over all
>> >elements in the record, checking their type and then
>> >taking the right action... 
>> 
>> If you really need to do this, you probably should have put
>> the bounded strings into an array inside the record,
>> instead of just making them flat fields. 
> 
> Often I also want to merge record and array i.e. have named
> _and_ iteratable "components". Theoretically this comes down
> to "types as objects", which Ada doesn't have. Practically,
> a "standard" Ada idiom for this is an heterogenous array
> indexed on an enumeration e.g. (not tested): 
> 
>   ...
>   type Field_Ptr is access Field'Class;
>   type Field_Names is (Field_1, Field_2, Field_3);
>   type Record_Type is array(Field_Names) of Field_Ptr;
>   A_Record: Record_Type := (
>     Field_1 => Field_Constructor_A(...),
>     Field_2 => Field_Constructor_A(...),
>     Field_3 => Field_Constructor_B(...));
> 
> Now we have a record-like object A_Record with "components"
> Field_1, Field_2 of "type" A and Field_3 of "type" B. This
> example assumes class-wide programming (including
> dispatching), with (tagged) type Field being the root of
> some derivation class. Iterating over A_Record's 
> "components": 
> 
>   for I in A_Record'Range loop
>     Do_Something(A_Record(I).all); -- dispatching call
>   end loop;
> 
> Accessing "components" by name:
> 
>   Do_Something(A_Record(Field_1).all);
> 
> This particular approach has a notorious shortcoming: field
> types are not checked (Field_Ptr values can reference _any_
> derived type in the class). The remedy for this is left as
> an exercise ;-) 
> 

It has the further shortcoming that one must know in advance 
what kind of thing one is dealing with, rather than letting it 
identify itself.  (My main interest here.)

Currently what I'm thinking of as an answer it a file of fixed 
size blocks, which are addressed via Ada.Direct_IO, somehow I 
need to make them accessible to reading/writing via IO 
statements.  Perhaps this is AdaSockets?  I haven't figured this 
out yet.  I may end up dropping into C to do this bit.  What I 
basically need to do is examine the incoming data and figure out 
how long it is, and then read it into an appropriate Ada 
structure.  (And, if it's larger than one block, which 
collection of blocks it is composed of.)  Also I need to be able 
to go the other direction.  To take a (nearly) arbitrary data 
structure, and write it out to a block, or collection of blocks, 
perhaps not contiguous.  Together with some identifying 
information, so that when I read it back in I'll be able to 
identify what kind of thing I'm reading.  And I'll need to 
maintain an index, etc., so that I'll be able to find it by key 
value.

This part would be relatively straight-forward in C, but so far 
I haven't figured out how to do it in Ada.  So far it's looking 
like everything is going to need to be descendant from some 
particular tagged type (I'll probably call it persistant), which 
will define a few basic methods (read, write, find, etc.)  But 
the answer that I can currently figure out how to do is to 
implement everything but the inheritance in C.  I'm finding this 
quite distasteful, but I don't know what alternatives are 
better.  And figuring out how I can do this in a way that 
doesn't make me rewrite everything whenever a new class is 
described ... 

This is quite annoying.  Every language seems to have some 
weakness in some part of the process.  So far Python is the 
hands-down winner for the store an object and retrieve it part 
of the job.  But it's relatively slow for all the rest.  (Still, 
it's also pretty easy to connect C to, say, SleepyCat DB, so 
that isn't the determining factor.)

The family of languages that make it easy to read objects in 
from disk, and have them be recognized as objects of the 
appropriate type are all relatively slow (because they all use 
interpreters/pseudo-machines).  Once upon a time there was a 
dialect of FORTH (Neon, by Kyria) that had a better choice.  One 
could specify which objects were bound at compile time, and 
which would be determined dynamically.  And in areas where 
everything could be predetermined, it could be compiled 
efficiently (for FORTH), where as when things were dynamic, 
there was an extra layer of indirection.  Unfortunately, they 
killed themselves when they tried to transfer the program from 
the Mac to the PC.  (Too many comittments, and too few 
resources.)  Now I wouldn't say that FORTH was a particularly 
good language in other ways, but that one flexibility almost 
made up for all the deficiencies.

PyAda sounds like one step in this direction.  I do need to 
check into it.  But it seems that this would essentially be the 
same as calling C code from Ada.  (In fact, I rather suspect 
that it is implemented via Swig, in which case there would end 
up being a quintuple language conversion, Ada-> C-> Python-> C-> 
Ada, and it's hard to see how that could be good.)
-- 
Charles Hixson

Copy software legally, the GNU way!
Use GNU software, and legally make and share copies of software.
See http://www.gnu.org
    http://www.redhat.com
    http://www.linux-mandrake.com
    http://www.calderasystems.com/
    http://www.linuxapps.com/



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21 17:08     ` Charles Hixson
@ 2001-06-21 18:58       ` tmoran
  2001-06-21 23:02         ` Charles Hixson
  2001-06-22  2:18       ` DuckE
  1 sibling, 1 reply; 54+ messages in thread
From: tmoran @ 2001-06-21 18:58 UTC (permalink / raw)


> basically need to do is examine the incoming data and figure out
> how long it is, and then read it into an appropriate Ada
> ...
> This part would be relatively straight-forward in C, but so far
> I haven't figured out how to do it in Ada.
  Look at packages Ada.Streams and Ada.Stream_IO
Stream_IO lets you read an arbitrary number of bytes into a
Stream_Element_Array, and Streams lets you conveniently convert
those raw bytes into an object of type whatever.
  Suppose your data stream has a series of objects.  Each object
is preceded by a single character identifying code.  Then you could
  Character'Read((Stream, ID_Code);
  case ID_Code is
    when 'A' => An_Object_Type'Read(Stream, An_Object);
    when 'B' => A_Different_Type'Read(Stream, A_Different_Object);
    ...
If An_Object_Type is a record, Ada will automatically read it by
a series of 'Read, of the correct type, on each component - or
you could override that and instead supply your own 'Read.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21 18:58       ` tmoran
@ 2001-06-21 23:02         ` Charles Hixson
  2001-06-22 19:04           ` B.Gaffney
  0 siblings, 1 reply; 54+ messages in thread
From: Charles Hixson @ 2001-06-21 23:02 UTC (permalink / raw)


tmoran@acm.org wrote in
news:ltrY6.111132$%i7.79731461@news1.rdc1.sfba.home.com: 

>> basically need to do is examine the incoming data and
>...
>  Look at packages Ada.Streams and Ada.Stream_IO
> Stream_IO lets you read an arbitrary number of bytes into a
> Stream_Element_Array, and Streams lets you conveniently
> convert those raw bytes into an object of type whatever.
>   Suppose your data stream has a series of objects.  Each
>   object 
> is preceded by a single character identifying code.  Then
> you could 
>   Character'Read((Stream, ID_Code);
>   case ID_Code is
>     when 'A' => An_Object_Type'Read(Stream, An_Object);
>     when 'B' => A_Different_Type'Read(Stream,
>     A_Different_Object); ...
> If An_Object_Type is a record, Ada will automatically read
> it by a series of 'Read, of the correct type, on each
> component - or you could override that and instead supply
> your own 'Read. 
> 
That looks quite interesting.  I would definitely need to supply 
my own read, and probably my own write too, since the objects 
will likely need to be stored in non-contiguous areas of the 
file. (If freed space can't be reused, the process would be 
unacceptably inefficient.  And when dealing with small chunks of 
data I would also need to be able to pack then into blocks.)

If I can make that work it will certainly be better than the 
alternatives that had occurred to me. (Address mapped storage, 
e.g., with arbitrary mappings needing to be defined.  Ugh!  Or 
tagged types, with all of the basic types defined for every 
possible offset into the block.  Ugh! again.)

 ...
After looking at the package:  Perhaps I need to rethink things 
to use arbitrary sized blocks rather than fixed size blocks.  
Otherwise it looks like just what I was looking for!


-- 
Charles Hixson

Copy software legally, the GNU way!
Use GNU software, and legally make and share copies of software.
See http://www.gnu.org
    http://www.redhat.com
    http://www.linux-mandrake.com
    http://www.calderasystems.com/
    http://www.linuxapps.com/



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21 17:08     ` Charles Hixson
  2001-06-21 18:58       ` tmoran
@ 2001-06-22  2:18       ` DuckE
  2001-06-22 17:33         ` Charles Hixson
  1 sibling, 1 reply; 54+ messages in thread
From: DuckE @ 2001-06-22  2:18 UTC (permalink / raw)



"Charles Hixson" <charleshixson@earthling.net> wrote in message
 [snip]
>
> This part would be relatively straight-forward in C, but so far
> I haven't figured out how to do it in Ada.  So far it's looking
> like everything is going to need to be descendant from some
> particular tagged type (I'll probably call it persistant), which
> will define a few basic methods (read, write, find, etc.)  But
> the answer that I can currently figure out how to do is to
> implement everything but the inheritance in C.  I'm finding this
> quite distasteful, but I don't know what alternatives are
> better.  And figuring out how I can do this in a way that
> doesn't make me rewrite everything whenever a new class is
> described ...

"...inheritance in C"

  Say what?

Perhaps you're thinking of C++ or Objective C.  The last I know C didn't
have inheritance.

SteveD






^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-22  2:18       ` DuckE
@ 2001-06-22 17:33         ` Charles Hixson
  2001-06-22 18:24           ` tmoran
                             ` (11 more replies)
  0 siblings, 12 replies; 54+ messages in thread
From: Charles Hixson @ 2001-06-22 17:33 UTC (permalink / raw)


"DuckE" <nospam_steved94@home.com> wrote in
news:JVxY6.222013$p33.4452203@news1.sttls1.wa.home.com: 

> 
> "Charles Hixson" <charleshixson@earthling.net> wrote in
> message 
>  [snip]
>>...
>> out how I can do this in a way that doesn't make me rewrite
>> everything whenever a new class is described ... 
> 
> "...inheritance in C"
> 
>   Say what?
> 
> Perhaps you're thinking of C++ or Objective C.  The last I
> know C didn't have inheritance.
> 
> SteveD
> 
> 
Sorry.  I was talking about mixing languages.  Ada and C (and 
not C++).  Not that I have many objections to using C++ as a 
small superset of C.  It's when the templates, etc. start 
showing up that I get upset.

No.  One of the things that C is really good at is replicating 
the utility of the PL/I based variables.  One of the things that 
it's really bad at is the horrendous amount of casting one must 
do.  And preprocessor code and pointer manipulation can make it 
actually less readable than either APL or Forth.

But for small routines, that are basically self contained 
modules, it is even easier than Ada, and if one needs to map the 
same area of memory with several arbitrary structures it appears 
to me to be much better.  (Well, my Ada experience is quite 
limited.)

What I was proposing was that the Ada classes would descend from 
a root, say, persistent, and that they would all implement a 
method to pass type & data information to a C routine that would 
manage the storage/retrieval from a disk file.  This would work, 
but appears a bit clumsy.  (Like LOTS clumsy!).

Ada.Streams_IO, however, seems to be a built in method for doing 
most of what I need.  The only problem is that when I'm reading 
the stuff back in I won't be able to use the file tags to tell 
Ada what kind of data I'm reading.  That won't be known at 
compile time.  So I'll need to build the kind of case switch 
that Tagged object types try to make obsolete.  It will be more 
the way that Ada83 handled tagged records.  What comes out will 
need to be a descendant of Persistant, Persistant will need to 
know about what methods all of it's sub-types can handle, unless 
I find that I need to do a full-fledged Meta Object Protocol 
(MOP), in which case I'll probably decide to use some language 
that has one already built into it.  Those things are beastly to  
implement.  And in that case, I'll want to call Ada routines 
from the overlying layer.  This will probably mean that they 
need to be compiled with C linking conventions. (Which is 
another reason to avoid C++ ... it's way of name munging is not 
portable.)

-- 
Charles Hixson

Copy software legally, the GNU way!
Use GNU software, and legally make and share copies of software.
See http://www.gnu.org
    http://www.redhat.com
    http://www.linux-mandrake.com
    http://www.calderasystems.com/
    http://www.linuxapps.com/



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-22 17:33         ` Charles Hixson
@ 2001-06-22 18:24           ` tmoran
  2001-09-13  0:29           ` Gnat Windows load error tmoran
                             ` (10 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2001-06-22 18:24 UTC (permalink / raw)


Note that doing a 'read or 'write of a record makes the compiler
generate code to sequentially visit each component of that record,
calling a 'read/write routine for each.  You get to supply those
'read/write routines if you want - they don't actually have to
do IO at all, but could do something else entirely.  Is that
what you meant by "looping over a [tagged] record"?

>Ada.Streams_IO, however, seems to be a built in method for doing
>most of what I need.  The only problem is that when I'm reading
>the stuff back in I won't be able to use the file tags to tell
>Ada what kind of data I'm reading.  That won't be known at
>compile time.  So I'll need to build the kind of case switch
  You can use 'Class'Read or 'Class'Input to have dispatching on the
particular type at run time.  You don't need to know about all the
possible descendants of a type when you compile your input routine.
You can later create a new descendant with an overriding input
routine to be called for that new type.  If your input data was
externally supplied, you'll of course have to write code to translate
to an Ada tag from however it decides what "type" an object is,
and any time you add a new input possibility you'll have to update
that code to handle it.  But no language, compiler, or computer can
tell what to do with a brand new, unexpected, type-of-object
indicator, until you tell it.  A case statement or the equivalent
is how you tell it, and the case statement will need a new branch
to understand what to do with a new record type.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-21 23:02         ` Charles Hixson
@ 2001-06-22 19:04           ` B.Gaffney
  2001-06-22 20:36             ` Pascal Obry
  0 siblings, 1 reply; 54+ messages in thread
From: B.Gaffney @ 2001-06-22 19:04 UTC (permalink / raw)


An alternative to 'read and 'write (since in another post you relate
this to tagged types), is to use 'input and 'output.  This came up in
a thread about a month ago.

T'Output first writes the tag, then calls T'Write.  T'Input reads the
tag, determines the appropriate type, then calls the proper T'Read.

The problem I've found, at least with GNAT, is that 'Input/'Output use
the "external representation" of the tag, which for GNAT is the fully
qualified text name of the type (talk about long filenames -- unless
you're careful).  So, unless you have rather large objects or don't
care about storage efficiency, this method has significant overhead.


Charles Hixson <charleshixson@earthling.net> wrote in message news:<Xns90C7A319CCC90charleshixsonearthli@207.217.77.21>...
> tmoran@acm.org wrote in
> news:ltrY6.111132$%i7.79731461@news1.rdc1.sfba.home.com: 
> 
> >> basically need to do is examine the incoming data and
> >...
> >  Look at packages Ada.Streams and Ada.Stream_IO
> > Stream_IO lets you read an arbitrary number of bytes into a
> > Stream_Element_Array, and Streams lets you conveniently
> > convert those raw bytes into an object of type whatever.
> >   Suppose your data stream has a series of objects.  Each
> >   object 
> > is preceded by a single character identifying code.  Then
> > you could 
> >   Character'Read((Stream, ID_Code);
> >   case ID_Code is
> >     when 'A' => An_Object_Type'Read(Stream, An_Object);
> >     when 'B' => A_Different_Type'Read(Stream,
> >     A_Different_Object); ...
> > If An_Object_Type is a record, Ada will automatically read
> > it by a series of 'Read, of the correct type, on each
> > component - or you could override that and instead supply
> > your own 'Read. 
> > 
> That looks quite interesting.  I would definitely need to supply 
> my own read, and probably my own write too, since the objects 
> will likely need to be stored in non-contiguous areas of the 
> file. (If freed space can't be reused, the process would be 
> unacceptably inefficient.  And when dealing with small chunks of 
> data I would also need to be able to pack then into blocks.)
> 
> If I can make that work it will certainly be better than the 
> alternatives that had occurred to me. (Address mapped storage, 
> e.g., with arbitrary mappings needing to be defined.  Ugh!  Or 
> tagged types, with all of the basic types defined for every 
> possible offset into the block.  Ugh! again.)
> 
>  ...
> After looking at the package:  Perhaps I need to rethink things 
> to use arbitrary sized blocks rather than fixed size blocks.  
> Otherwise it looks like just what I was looking for!
> 
> 
> -- 
> Charles Hixson
> 
> Copy software legally, the GNU way!
> Use GNU software, and legally make and share copies of software.
> See http://www.gnu.org
>     http://www.redhat.com
>     http://www.linux-mandrake.com
>     http://www.calderasystems.com/
>     http://www.linuxapps.com/



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Looping over a tagged record?
  2001-06-22 19:04           ` B.Gaffney
@ 2001-06-22 20:36             ` Pascal Obry
  0 siblings, 0 replies; 54+ messages in thread
From: Pascal Obry @ 2001-06-22 20:36 UTC (permalink / raw)



B_Gaffney@My-Deja.com (B.Gaffney) writes:

> The problem I've found, at least with GNAT, is that 'Input/'Output use
> the "external representation" of the tag, which for GNAT is the fully
> qualified text name of the type (talk about long filenames -- unless
> you're careful).  So, unless you have rather large objects or don't
> care about storage efficiency, this method has significant overhead.

This is not a problem since you can change this default. See External_Tag
attribute [RM K.64].

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Gnat Windows load error
  2001-06-22 17:33         ` Charles Hixson
  2001-06-22 18:24           ` tmoran
@ 2001-09-13  0:29           ` tmoran
  2001-09-13 18:15             ` Jerry van Dijk
  2001-09-13  3:58           ` Ada web crawler tmoran
                             ` (9 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2001-09-13  0:29 UTC (permalink / raw)


The command:
gnatmake -gnatR -gnato -O2 testjpg -largs -v -mwindows f:\1tm\jpeg\release\calljpeg.obj jpeg.lib
generates several warnings of the kind:
ld: jpeg.lib(./Release/jdphuff.obj): warning: ignoring duplicate section `.text'
It appears to be related to jpeg.lib being built (MSVC++from multiple routines,
more than one of which contains something like
static void someproc(int someparam)
with the same "someproc" name.  A reference to "someproc" seems to have a
zero as address.  The MS linker gives no warnings, and gives a correct,
non-zero, address to someproc.  What must I do differently?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Ada web crawler
  2001-06-22 17:33         ` Charles Hixson
  2001-06-22 18:24           ` tmoran
  2001-09-13  0:29           ` Gnat Windows load error tmoran
@ 2001-09-13  3:58           ` tmoran
  2001-11-17 21:50           ` ada.strings.bounded slice errors tmoran
                             ` (8 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2001-09-13  3:58 UTC (permalink / raw)


David Botton has kindly posted finder.zip at
  www.adapower.com/os/finder.html
It's source plus (Windows) executable for a program that crawls a site
checking links.  Thus
  finder www.adapower.com
will scan the adapower site, following links to local html files and
noting links to other files.
  finder www.adapower.com/os
will scan just the "os" directory, treating any links outside that
as "foreign", to be noted, but not scanned.
  Speed is of course highly dependent on internet access speed.
  The program is not polished, and still contains some capabilities
that were needed for a specific application, but the source code is
there for your customization.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Gnat Windows load error
  2001-09-13  0:29           ` Gnat Windows load error tmoran
@ 2001-09-13 18:15             ` Jerry van Dijk
  2001-09-13 23:17               ` tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Jerry van Dijk @ 2001-09-13 18:15 UTC (permalink / raw)


tmoran@acm.org writes:

> The command:
> gnatmake -gnatR -gnato -O2 testjpg -largs -v -mwindows f:\1tm\jpeg\release\calljpeg.obj jpeg.lib
> generates several warnings of the kind:
> ld: jpeg.lib(./Release/jdphuff.obj): warning: ignoring duplicate section `.text'
> It appears to be related to jpeg.lib being built (MSVC++from multiple routines,

Hmmm, did you use MSCV 6.0 ? If so, try compiling the library with an earlier
version. The library file format was changed in v6, and you might be running
into this problem again.

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   home.trouwweb.nl/Jerry



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Gnat Windows load error
  2001-09-13 18:15             ` Jerry van Dijk
@ 2001-09-13 23:17               ` tmoran
  0 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2001-09-13 23:17 UTC (permalink / raw)


> > gnatmake -gnatR -gnato -O2 testjpg -largs -v -mwindows f:\1tm\jpeg\release\calljpeg.obj jpeg.lib
> > generates several warnings of the kind:
> > ld: jpeg.lib(./Release/jdphuff.obj): warning: ignoring duplicate section `.text'
> Hmmm, did you use MSCV 6.0 ? If so, try compiling the library with an earlier
No, MS VC++ 5.0



^ permalink raw reply	[flat|nested] 54+ messages in thread

* ada.strings.bounded slice errors
  2001-06-22 17:33         ` Charles Hixson
                             ` (2 preceding siblings ...)
  2001-09-13  3:58           ` Ada web crawler tmoran
@ 2001-11-17 21:50           ` tmoran
  2001-11-18 17:16             ` Florian Weimer
  2002-02-08 20:55           ` How to get a traceback in Gnat 3.14p tmoran
                             ` (7 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2001-11-17 21:50 UTC (permalink / raw)


What should Slice(S, Low, High) do in the various cases:
  S is null
  Low > S'last+1
  High > S'last
I have three different compilers that seem to do three different things,
and the ARM seems to me less than definite.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: ada.strings.bounded slice errors
  2001-11-17 21:50           ` ada.strings.bounded slice errors tmoran
@ 2001-11-18 17:16             ` Florian Weimer
  2001-11-18 19:31               ` tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Florian Weimer @ 2001-11-18 17:16 UTC (permalink / raw)


tmoran@acm.org writes:

> What should Slice(S, Low, High) do in the various cases:

>   S is null

Do you mean S = ""?  Then Length (S) = 0, and you can apply the rules
below.

>   Low > S'last+1

(You mean "Low > Length (S) + 1".)

Index_Error is propagated.

>   High > S'last

Index_Error is propagated, but this was added in TC 1, the original
Ada 95 RM didn't require this.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: ada.strings.bounded slice errors
  2001-11-18 17:16             ` Florian Weimer
@ 2001-11-18 19:31               ` tmoran
  2001-11-19  7:12                 ` Florian Weimer
  0 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2001-11-18 19:31 UTC (permalink / raw)


> >   Low > S'last+1
>
> (You mean "Low > Length (S) + 1".)
>
> Index_Error is propagated.
  So I should be seeing Ada.Strings.Index_Error, and not Constraint_Error.
Hmm.
And
Slice(Null_Bounded_String,1,0) = Slice(Null_Bounded_String,1,1) = ""

> >   High > S'last
>
> Index_Error is propagated, but this was added in TC 1, the original
> Ada 95 RM didn't require this.
  Ah, that explains another part of the problem.
And Slice(Null_Bounded_String,1,2) originally could return "", but now
should raise Ada.Strings.Index_Error.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: ada.strings.bounded slice errors
  2001-11-18 19:31               ` tmoran
@ 2001-11-19  7:12                 ` Florian Weimer
  0 siblings, 0 replies; 54+ messages in thread
From: Florian Weimer @ 2001-11-19  7:12 UTC (permalink / raw)


tmoran@acm.org writes:

>> >   Low > S'last+1
>>
>> (You mean "Low > Length (S) + 1".)
>>
>> Index_Error is propagated.

>   So I should be seeing Ada.Strings.Index_Error, and not Constraint_Error.

Yes, I think so.

> Hmm.  And Slice(Null_Bounded_String,1,0) =
> Slice(Null_Bounded_String,1,1) = ""
                              ^
This should result in Index_Error, too, since 1 > 0.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* How to get a traceback in Gnat 3.14p
  2001-06-22 17:33         ` Charles Hixson
                             ` (3 preceding siblings ...)
  2001-11-17 21:50           ` ada.strings.bounded slice errors tmoran
@ 2002-02-08 20:55           ` tmoran
  2002-02-08 21:24             ` Pascal Obry
  2002-02-11  0:10           ` How to use gnatelim in Gnat 3.14p? tmoran
                             ` (6 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-02-08 20:55 UTC (permalink / raw)


I tried adding a "when oops:others=>
log("oops:" & gnat.traceback.symbolic.symbolic_traceback(oops));"
and recompiling everything with -g.  The result was a giant exe (3x)
but a null string for the traceback.  What needs doing?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: How to get a traceback in Gnat 3.14p
  2002-02-08 20:55           ` How to get a traceback in Gnat 3.14p tmoran
@ 2002-02-08 21:24             ` Pascal Obry
  2002-02-08 22:28               ` tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Pascal Obry @ 2002-02-08 21:24 UTC (permalink / raw)



tmoran@acm.org writes:

> I tried adding a "when oops:others=>
> log("oops:" & gnat.traceback.symbolic.symbolic_traceback(oops));"
> and recompiling everything with -g.  The result was a giant exe (3x)
> but a null string for the traceback.  What needs doing?

Did you use the -E binder argument ?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: How to get a traceback in Gnat 3.14p
  2002-02-08 21:24             ` Pascal Obry
@ 2002-02-08 22:28               ` tmoran
  0 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2002-02-08 22:28 UTC (permalink / raw)


> Did you use the -E binder argument ?
  No.  I (mis)understood the description in gnat_ug to say it was not
needed under Windows.  But that indeed made it produce a traceback.
Thanks.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* How to use gnatelim in Gnat 3.14p?
  2001-06-22 17:33         ` Charles Hixson
                             ` (4 preceding siblings ...)
  2002-02-08 20:55           ` How to get a traceback in Gnat 3.14p tmoran
@ 2002-02-11  0:10           ` tmoran
  2002-02-15 17:23           ` does gnatelim work? tmoran
                             ` (5 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2002-02-11  0:10 UTC (permalink / raw)


When I follow the gnat_ug.htm instructions to generate tree files for
gnatelim, the compiler complains about things that didn't bother it before.
   gnatmake etest
works fine, but
   gnatmke -f -c -gnatc -gnatt etest
results in:

gcc -c -gnatc -gnatt etest.adb
etest.adb:22:17: size for "Copy_Type" too small
etest.adb:24:09: instantiation error at a-unccon.ads:20
etest.adb:24:09: size for "Target" too small
etest.adb:27:03: warning: "dummys" is never assigned a value
gnatmake: "etest.adb" compilation error
   This is on a file etest.adb:
with ada.streams;
with ada.unchecked_conversion;
procedure etest is
        type Color_Intensities is range 0 .. 255;
        for Color_Intensities'size use 8;

        type DIB_Color_Type is record
            Blue,
            Green,
            Red         : Color_Intensities;
            Reserved    : Integer range 0 .. 0 := 0;
        end record;
        for DIB_Color_Type'size use 32;

        for DIB_Color_Type use record
            Blue        at 0 range 0 .. 7;
            Green       at 1 range 0 .. 7;
            Red         at 2 range 0 .. 7;
            Reserved    at 3 range 0 .. 7;
        end record;

        subtype Copy_Type is Ada.Streams.Stream_Element_Array
            (1 .. Ada.Streams.Stream_Element_Count(DIB_Color_Type'size/8));
        function Copy_Of is new Ada.Unchecked_Conversion
            (DIB_Color_Type, Copy_Type);

  dummys : DIB_Color_Type;
  dummyt : Copy_Type;
begin
  dummyt := copy_of(dummys);
end etest;

   What's the trick to using gnatelim?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* does gnatelim work?
  2001-06-22 17:33         ` Charles Hixson
                             ` (5 preceding siblings ...)
  2002-02-11  0:10           ` How to use gnatelim in Gnat 3.14p? tmoran
@ 2002-02-15 17:23           ` tmoran
  2002-02-15 18:18             ` Stephen Leake
  2002-04-15  3:05           ` Announce: .rc files with Gnat tmoran
                             ` (4 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-02-15 17:23 UTC (permalink / raw)


gnatmake -f -c -gnatc -gnatt name
appears from the gnat_ug docs to be the first step in using gnatelim,
but it generates spurious compilation errors and dies.  How does one use
gnatelim successfully?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: does gnatelim work?
  2002-02-15 17:23           ` does gnatelim work? tmoran
@ 2002-02-15 18:18             ` Stephen Leake
  2002-02-15 21:58               ` tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Leake @ 2002-02-15 18:18 UTC (permalink / raw)


tmoran@acm.org writes:

> gnatmake -f -c -gnatc -gnatt name
> appears from the gnat_ug docs to be the first step in using gnatelim,
> but it generates spurious compilation errors and dies.  How does one use
> gnatelim successfully?

Start with your normal, successfule gnatmake command, which will
usually have some -I parameters and other things. Then just add the
-gnatt switch, to save the "tree" file.

What sort of "spurious" errors were you getting?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: does gnatelim work?
  2002-02-15 18:18             ` Stephen Leake
@ 2002-02-15 21:58               ` tmoran
  2002-02-18  1:31                 ` Stephen Leake
  0 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-02-15 21:58 UTC (permalink / raw)


>Then just add the -gnatt switch, to save the "tree" file.

  An apparently successful
gnatmake -f -gnatt progname
  followed by
gnatelim progname > gnat.adc
  results in
gnatelim: Library item corresponding to progname not found.
  and a zero length gnat.adc file.

>What sort of "spurious" errors were you getting?
  Previously, following the gnat_ug.htm instructions, I tried
gnatmake -f -c -gnatc -gnatt progname
  but that gives spurious compilation errors (3.14p) about sizes.
---------- progname.adb
with ada.streams;
with ada.unchecked_conversion;
procedure progname is
        type Color_Intensities is range 0 .. 255;
        for Color_Intensities'size use 8;

        type DIB_Color_Type is record
            Blue,
            Green,
            Red         : Color_Intensities;
            Reserved    : Integer range 0 .. 0 := 0;
        end record;
        for DIB_Color_Type'size use 32;

        for DIB_Color_Type use record
            Blue        at 0 range 0 .. 7;
            Green       at 1 range 0 .. 7;
            Red         at 2 range 0 .. 7;
            Reserved    at 3 range 0 .. 7;
        end record;

        subtype Copy_Type is Ada.Streams.Stream_Element_Array
            (1 .. Ada.Streams.Stream_Element_Count(DIB_Color_Type'size/8));
        function Copy_Of is new Ada.Unchecked_Conversion
            (DIB_Color_Type, Copy_Type);

  dummys : DIB_Color_Type;
  dummyt : Copy_Type;
begin
  dummyt := copy_of(dummys);
end progname;
---------- end progname.adb
That's of course a shrunken version of the rather larger program I was
trying to apply gnatelim to.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: does gnatelim work?
  2002-02-15 21:58               ` tmoran
@ 2002-02-18  1:31                 ` Stephen Leake
  0 siblings, 0 replies; 54+ messages in thread
From: Stephen Leake @ 2002-02-18  1:31 UTC (permalink / raw)


tmoran@acm.org writes:

> >Then just add the -gnatt switch, to save the "tree" file.
> 
>   An apparently successful
> gnatmake -f -gnatt progname
>   followed by
> gnatelim progname > gnat.adc
>   results in
> gnatelim: Library item corresponding to progname not found.
>   and a zero length gnat.adc file.


One part of the gnat user guide says to run:

gnatbind progname

after generating the tree files; another part does not. 
 
> >What sort of "spurious" errors were you getting?
>   Previously, following the gnat_ug.htm instructions, I tried
> gnatmake -f -c -gnatc -gnatt progname
>   but that gives spurious compilation errors (3.14p) about sizes.

Yes, it does! This looks like a GNAT bug; send in a report.

Hmm. I modified your code to eliminate the "size" errors, but
'gnatbind' does not produce any files. Normally you get a
"b~progname.adb" file. After some experimentation, I discovered adding
the "-g" switch produced a "b~progname.adb" file. -g is for debug; I
have no idea why that works! Time for another bug report :). However,
I still get "library item not found" from gnatelim.

Sorry, I've never used gnatelim, so I can't help more.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Announce: .rc files with Gnat
  2001-06-22 17:33         ` Charles Hixson
                             ` (6 preceding siblings ...)
  2002-02-15 17:23           ` does gnatelim work? tmoran
@ 2002-04-15  3:05           ` tmoran
  2002-04-15 14:48             ` Ted Dennison
  2002-05-25  7:06           ` slice'access? tmoran
                             ` (3 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-04-15  3:05 UTC (permalink / raw)


David Botton tells me
www.adapower.com/os/wglink.html
now contains a linker shell I wrote to automatically handle Windows .rc
files with Gnat.  It should make life a little easier for both newbies
and professionals using Gnat with MS Windows.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: Announce: .rc files with Gnat
  2002-04-15  3:05           ` Announce: .rc files with Gnat tmoran
@ 2002-04-15 14:48             ` Ted Dennison
  0 siblings, 0 replies; 54+ messages in thread
From: Ted Dennison @ 2002-04-15 14:48 UTC (permalink / raw)


tmoran@acm.org wrote in message news:<nsru8.151$s15.236848220@newssvr13.news.prodigy.com>...
> David Botton tells me
> www.adapower.com/os/wglink.html
> now contains a linker shell I wrote to automatically handle Windows .rc
> files with Gnat.  It should make life a little easier for both newbies
> and professionals using Gnat with MS Windows.

Cool. 

I've been playing a bit with adding a GUI control panel to the
SETI@Home Service using resouces. I'm sure I'll get good use out of
that.


-- 
T.E.D.
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



^ permalink raw reply	[flat|nested] 54+ messages in thread

* slice'access?
  2001-06-22 17:33         ` Charles Hixson
                             ` (7 preceding siblings ...)
  2002-04-15  3:05           ` Announce: .rc files with Gnat tmoran
@ 2002-05-25  7:06           ` tmoran
  2002-05-25 16:47             ` slice'access? Robert Dewar
  2002-09-30  1:54           ` 'write of bounded string? tmoran
                             ` (2 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-05-25  7:06 UTC (permalink / raw)


Is there a nice way to create an access to a slice? eg
type p is access all string;
s : aliased string:="12345";
ptr : p := s'access; -- OK
ptr : p := s(2 .. 4)'access; -- ??



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: slice'access?
  2002-05-25  7:06           ` slice'access? tmoran
@ 2002-05-25 16:47             ` Robert Dewar
  2002-05-25 18:28               ` slice'access? tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Robert Dewar @ 2002-05-25 16:47 UTC (permalink / raw)


tmoran@acm.org wrote in message news:<1KGH8.384$9_7.69072060@newssvr13.news.prodigy.com>...
> Is there a nice way to create an access to a slice? eg

> type p is access all string;
> s : aliased string:="12345";
> ptr : p := s'access; -- OK
> ptr : p := s(2 .. 4)'access; -- ??


The answer of course is no. The RM does not allow this
and if you think for just a moment it is obvious why. The
usual representation of bounds for an array is to have the
bounds immediately before the data, but of course that
would be incompatible with allowing access of a slice.
So to allow this would be a huge earthquake for most
compilers.

Now in GNAT, fat pointers allow separation of the data
and the bounds, so GNAT can accomodate this. Of course
it cannot allow the clearly illegal construction above,
but if you use 'unrestricted_access then the above code
is valid in GNAT. Of course if you use a compiler that 
does not implement the Unrestricted_Access attribute,
you are out of luck.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: slice'access?
  2002-05-25 16:47             ` slice'access? Robert Dewar
@ 2002-05-25 18:28               ` tmoran
  2002-05-25 20:20                 ` slice'access? Jeffrey Carter
  0 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-05-25 18:28 UTC (permalink / raw)


> > Is there a nice way to create an access to a slice? eg
> The answer of course is no. The RM does not allow this
> and if you think for just a moment it is obvious why. The
> usual representation of bounds for an array is to have the
> bounds immediately before the data, but of course that

  The problem at hand is that a package maintains a private data
structure which contains, among other things, long strings.  I want
(read only) access to one of those strings.  Of course it's
possible to call the data package and have it return a string,
  subtype card is string(1 .. 80);
  function get_card(param) return card;
but speed matters.  It would be faster to get a pointer
  function get_card_pointer(param) return ptr_type;
For instance, getting character(8) of the card could be done with
  get_card(param)(8)
but
  get_card_pointer(param)(8)
is likely to be a lot faster.
  Using a fixed length subtype and system.address_to_access_conversions, a
quick test shows it works fine on two different compilers.  Or I can call
a subprogram and pass the slice, eg
  procedure callback_to_process_the_card(s : in card);
  fetch_card(param, callback_to_process_the_card'access);
and be very surprised if it's passed by copy.  Neither of those techniques
is very nice.  Is there a NICE way to create an access to a slice?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: slice'access?
  2002-05-25 18:28               ` slice'access? tmoran
@ 2002-05-25 20:20                 ` Jeffrey Carter
  2002-05-25 23:39                   ` slice'access? tmoran
  0 siblings, 1 reply; 54+ messages in thread
From: Jeffrey Carter @ 2002-05-25 20:20 UTC (permalink / raw)


tmoran@acm.org wrote:
> 
> Is there a NICE way to create an access to a slice?

There's always something along the lines of

declare
   Slice : aliased String := S (X .. Y);
   Ptr : String_Pointer;
begin
   Ptr := Slice'[Unchecked_]Access;
end;

but I get the feeling this doesn't meet your definition of NICE.

-- 
Jeff Carter
"Oh Lord, bless this thy hand grenade, that with it thou
mayst blow thine enemies to tiny bits, in thy mercy."
Monty Python and the Holy Grail



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: slice'access?
  2002-05-25 20:20                 ` slice'access? Jeffrey Carter
@ 2002-05-25 23:39                   ` tmoran
  2002-05-26 14:22                     ` slice'access? Robert Dewar
  0 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-05-25 23:39 UTC (permalink / raw)


>    Slice : aliased String := S (X .. Y);
>    Ptr : String_Pointer;
> begin
>    Ptr := Slice'[Unchecked_]Access;
  But that's a pointer to a string, not a slice.  The string is
initialized by copying, which is what I'm trying to avoid.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: slice'access?
  2002-05-25 23:39                   ` slice'access? tmoran
@ 2002-05-26 14:22                     ` Robert Dewar
  0 siblings, 0 replies; 54+ messages in thread
From: Robert Dewar @ 2002-05-26 14:22 UTC (permalink / raw)


tmoran@acm.org wrote in message news:<_gVH8.619$9J7.68226356@newssvr14.news.prodigy.com>...
> >    Slice : aliased String := S (X .. Y);
> >    Ptr : String_Pointer;
> > begin
> >    Ptr := Slice'[Unchecked_]Access;
>   But that's a pointer to a string, not a slice.  The 
> string is
> initialized by copying, which is what I'm trying to 
> avoid.

And that is obviously impossible (except by using
unrestricted_access in GNAT, and there you have
to be careful about the scope of the created bounds template.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* 'write of bounded string?
  2001-06-22 17:33         ` Charles Hixson
                             ` (8 preceding siblings ...)
  2002-05-25  7:06           ` slice'access? tmoran
@ 2002-09-30  1:54           ` tmoran
  2002-09-30 16:06             ` Stephen Leake
  2002-10-27 23:01           ` phone# etc bdean
  2002-11-06  3:14           ` A little Ada app tmoran
  11 siblings, 1 reply; 54+ messages in thread
From: tmoran @ 2002-09-30  1:54 UTC (permalink / raw)


What's a reasonable way to define your own 'write routine for something
from a generic, for instance a bounded string?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: 'write of bounded string?
  2002-09-30  1:54           ` 'write of bounded string? tmoran
@ 2002-09-30 16:06             ` Stephen Leake
  0 siblings, 0 replies; 54+ messages in thread
From: Stephen Leake @ 2002-09-30 16:06 UTC (permalink / raw)


tmoran@acm.org writes:

> What's a reasonable way to define your own 'write routine for something
> from a generic, for instance a bounded string?

I haven't done this, but I think you need to define a wrapper type,
and define 'Write for that:

type Bounded_String_Wrapper_Type is record
    bounded_String : bounded_String_Type;
end record;

for Bounded_String_Wrapper_Type'write use foo; 

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 54+ messages in thread

* phone# etc
  2001-06-22 17:33         ` Charles Hixson
                             ` (9 preceding siblings ...)
  2002-09-30  1:54           ` 'write of bounded string? tmoran
@ 2002-10-27 23:01           ` bdean
  2002-10-28  3:04             ` tmoran
  2002-11-06  3:14           ` A little Ada app tmoran
  11 siblings, 1 reply; 54+ messages in thread
From: bdean @ 2002-10-27 23:01 UTC (permalink / raw)


It was nice to see you.  You should try Windy Hill again some time when
the air is clear!  When we get snow on the hills, the police tend to
close the roads, since most people around here don't know how to
drive in even a little snow.  Maybe you can get your Cosmology class
to take a field trip to Lick Observatory. ;)
  Our phone number is 408-741-5053
  On AIM, Gillian is both GMoran01 and cities15.  I am Saratogans.
On Yahoo IM, Gillian is bluetriple2000.  I'm tmoranetal.  Yahoo IM
does audio & video and we have a sorely underutilized webcam.
Tom



^ permalink raw reply	[flat|nested] 54+ messages in thread

* re: phone# etc
  2002-10-27 23:01           ` phone# etc bdean
@ 2002-10-28  3:04             ` tmoran
  0 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2002-10-28  3:04 UTC (permalink / raw)


Pardon my erroneous post of what should have been an e-mail.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* A little Ada app
  2001-06-22 17:33         ` Charles Hixson
                             ` (10 preceding siblings ...)
  2002-10-27 23:01           ` phone# etc bdean
@ 2002-11-06  3:14           ` tmoran
  2002-11-06 11:37             ` Larry Kilgallen
  2002-11-06 15:08             ` Ted Dennison
  11 siblings, 2 replies; 54+ messages in thread
From: tmoran @ 2002-11-06  3:14 UTC (permalink / raw)


This evening local election results will be displayed on Saratoga
Community Access Television by an Ada program.  Saratoga is in Santa Clara
County, California, a.k.a. Silicon Valley.  The Ada program, using Claw
on Windows, will periodically dial in and harvest updated numbers from the
county Registrar of Voters web site.  The races of local interest will be
shown via TV output from the Sony laptop to Saratoga's cable TV subscribers.
If all goes well, it will run completely automatically until midnight.



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: A little Ada app
  2002-11-06  3:14           ` A little Ada app tmoran
@ 2002-11-06 11:37             ` Larry Kilgallen
  2002-11-06 15:08             ` Ted Dennison
  1 sibling, 0 replies; 54+ messages in thread
From: Larry Kilgallen @ 2002-11-06 11:37 UTC (permalink / raw)


In article <NO%x9.27124$ar4.112992@sccrnsc03>, tmoran@acm.org writes:
> This evening local election results will be displayed on Saratoga
> Community Access Television by an Ada program.  Saratoga is in Santa Clara
> County, California, a.k.a. Silicon Valley.  The Ada program, using Claw
> on Windows, will periodically dial in and harvest updated numbers from the
> county Registrar of Voters web site.  The races of local interest will be
> shown via TV output from the Sony laptop to Saratoga's cable TV subscribers.
> If all goes well, it will run completely automatically until midnight.

If things go not so well (e.g., Florida, 2000) that particular Ada
program could run for weeks or months :-)



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: A little Ada app
  2002-11-06  3:14           ` A little Ada app tmoran
  2002-11-06 11:37             ` Larry Kilgallen
@ 2002-11-06 15:08             ` Ted Dennison
  2002-11-06 18:02               ` tmoran
  1 sibling, 1 reply; 54+ messages in thread
From: Ted Dennison @ 2002-11-06 15:08 UTC (permalink / raw)


tmoran@acm.org wrote in message news:<NO%x9.27124$ar4.112992@sccrnsc03>...
> This evening local election results will be displayed on Saratoga
> Community Access Television by an Ada program.  Saratoga is in Santa Clara
...
> If all goes well, it will run completely automatically until midnight.

So how'd it go?



^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: A little Ada app
  2002-11-06 15:08             ` Ted Dennison
@ 2002-11-06 18:02               ` tmoran
  0 siblings, 0 replies; 54+ messages in thread
From: tmoran @ 2002-11-06 18:02 UTC (permalink / raw)


> > This evening local election results will be displayed on Saratoga
> > ...
> > If all goes well, it will run completely automatically until midnight.
>
> So how'd it go?
  The Ada program and the laptop ran fine.  The county Registrar of
Voters, OTOH, varied between molasses slow and just plain down.  So the
Ada program spent a lot of its time patiently trying again and again to
get updated numbers.  The only glitch was !@#$% Pc-cillin popped up at one
point asking if this was a convenient time to download the latest virus
definitions.  Not being entirely trusting of new systems, even when
programmed in Ada, I was nearby and squashed that quickly.



^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2002-11-06 18:02 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-19 20:39 Looping over a tagged record? M R Goodwin
2001-06-19 21:31 ` Pascal Obry
2001-06-19 21:32 ` Pascal Obry
2001-06-19 22:20   ` Samuel T. Harris
2001-06-19 23:45     ` mgoodwinSPAMMY
2001-06-20  1:33 ` Pat Rogers
2001-06-20  3:13   ` Pat Rogers
2001-06-20  2:58 ` DuckE
2001-06-20 13:15 ` Ted Dennison
2001-06-20 15:01   ` M. A. Alves
2001-06-21  2:36     ` DuckE
2001-06-21 10:14       ` M. A. Alves
2001-06-21 13:24         ` Pat Rogers
2001-06-21 17:08     ` Charles Hixson
2001-06-21 18:58       ` tmoran
2001-06-21 23:02         ` Charles Hixson
2001-06-22 19:04           ` B.Gaffney
2001-06-22 20:36             ` Pascal Obry
2001-06-22  2:18       ` DuckE
2001-06-22 17:33         ` Charles Hixson
2001-06-22 18:24           ` tmoran
2001-09-13  0:29           ` Gnat Windows load error tmoran
2001-09-13 18:15             ` Jerry van Dijk
2001-09-13 23:17               ` tmoran
2001-09-13  3:58           ` Ada web crawler tmoran
2001-11-17 21:50           ` ada.strings.bounded slice errors tmoran
2001-11-18 17:16             ` Florian Weimer
2001-11-18 19:31               ` tmoran
2001-11-19  7:12                 ` Florian Weimer
2002-02-08 20:55           ` How to get a traceback in Gnat 3.14p tmoran
2002-02-08 21:24             ` Pascal Obry
2002-02-08 22:28               ` tmoran
2002-02-11  0:10           ` How to use gnatelim in Gnat 3.14p? tmoran
2002-02-15 17:23           ` does gnatelim work? tmoran
2002-02-15 18:18             ` Stephen Leake
2002-02-15 21:58               ` tmoran
2002-02-18  1:31                 ` Stephen Leake
2002-04-15  3:05           ` Announce: .rc files with Gnat tmoran
2002-04-15 14:48             ` Ted Dennison
2002-05-25  7:06           ` slice'access? tmoran
2002-05-25 16:47             ` slice'access? Robert Dewar
2002-05-25 18:28               ` slice'access? tmoran
2002-05-25 20:20                 ` slice'access? Jeffrey Carter
2002-05-25 23:39                   ` slice'access? tmoran
2002-05-26 14:22                     ` slice'access? Robert Dewar
2002-09-30  1:54           ` 'write of bounded string? tmoran
2002-09-30 16:06             ` Stephen Leake
2002-10-27 23:01           ` phone# etc bdean
2002-10-28  3:04             ` tmoran
2002-11-06  3:14           ` A little Ada app tmoran
2002-11-06 11:37             ` Larry Kilgallen
2002-11-06 15:08             ` Ted Dennison
2002-11-06 18:02               ` tmoran
2001-06-21  3:09 ` Looping over a tagged record? gresset1

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