DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 1162 (0x48a) Types: TextFile Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
with Text_Io; package body Pile is I : Integer := 1; function Pile_Vide (Une_Pile : in Pile) return Boolean is begin return Une_Pile.I = Une_Pile.Contenu'First; end Pile_Vide; function Pile_Pleine (Une_Pile : in Pile) return Boolean is begin return Une_Pile.I = Une_Pile.Contenu'Last + 1; end Pile_Pleine; procedure Empiler (Une_Pile : in out Pile; Un_Element : in Element) is begin if not Pile_Pleine (Une_Pile) then Une_Pile.Contenu (Une_Pile.I) := Un_Element; Une_Pile.I := Une_Pile.I + 1; else Text_Io.Put_Line ("Pile pleine !!"); end if; end Empiler; procedure Depiler (Une_Pile : in out Pile; Un_Element : out Element) is begin if not Pile_Vide (Une_Pile) then Une_Pile.I := Une_Pile.I - 1; Un_Element := Une_Pile.Contenu (Une_Pile.I); else Text_Io.Put_Line ("Pile vide !! "); end if; end Depiler; end Pile; -- Exemple de programme de gestion de pile -- ou le type d'element contenu dans la pile est generique -- Auteur : Sebastien BROCHET -- Date : 28 Octobre 1993