Re: OO Style with Ada Containers



On Nov 24, 1:46 am, Pascal Obry <pas...@xxxxxxxx> wrote:
braver a écrit :

Very ineteresting -- Matt, can you pls elucidate these idioms below?

On Nov 19, 5:24 am, Matthew Heaney <matthewjhea...@xxxxxxxxxxxxx>
wrote:

type Scanner (<>) is tagged limited private;

What does (<>) say here -- that the type is unconstrained?

Yes. Scanner has a privately defined discriminant. So the public view of
Scanner must be declared unconstrained.

private

type Handle (S : not null access Scanner) is limited null record;

type Scanner (Last : Natural) is tagged limited record
H : Handle (Scanner'Access);
Line : String (1 .. Last);
Word_First : Positive;
Word_Last : Natural;
end record;

What's the logic behind the definition and usage of the Handle H
throughout?

It is for gaining write access to function in parameter. A simpler
solution is:

type Scanner (Last : Natural) is tagged limited record
Self : access Scanner := Scanner'Unchecked_Access;
Line : String (1 .. Last);
Word_First : Positive;
Word_Last : Natural;
end record;

Ah. Didn't see H assigned -- in this case, Scanner'Access with the
type name means the address of the actual parent type record instance?

So basically to simplify even further, we'd just have procedures with
honest in out parameters?

Cheers,
Alexy
.



Relevant Pages

  • Re: [opensuse] SCSI-scanners on openSUSE 11.1
    ... It's also a SCSI model. ... I don't have the lshal output at hand (but I could get it by next week, ... I do remember that this scanner also identified itself ... info.product = 'SCSI Device' (string) ...
    (SuSE)
  • Re: How complex is this, really?
    ... I don't think Sam was intending to machine-read the images and extract ... container of string data, such as name, address, etc. ... a human being must display the image and read the data in it. ... person places the order in the scanner ...
    (microsoft.public.dotnet.framework.aspnet)
  • Still in while loop hell, Now with refined question!
    ... public static void main (String[] args) { ... Node head = null; ... Node prev = null; ... scanner usually blocks for whatever reason. ...
    (comp.lang.java.programmer)
  • Re: OO Style with Ada Containers
    ... cursors aren't tagged because an operation can only be primitive for a ... Also included is a simple scanner ... while not End_Of_File loop ... (Word: String; ...
    (comp.lang.ada)
  • Re: Still in while loop hell, Now with refined question!
    ... public static void main (String[] args) { ... Node head = null; ... scanner usually blocks for whatever reason. ... anybody have a suggestion for me? ...
    (comp.lang.java.programmer)