DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦c59588ab4⟧ TextFile

    Length: 5206 (0x1456)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;
with Object;
with Error_Broadcaster;
with Bounded_String;
with String_Utilities;
package body Boolean_Class is  
    type Binary_Message is (Et, Ou);
    type Unary_Message is (Entexte, Non);

    function Send (To_Object : Object.Reference; The_Message : Object.Message)
                  return String is
        Message : Unary_Message;
        Obj : Object.Reference;
    begin
        Message := Unary_Message'Value (Bounded_String.Image (The_Message));
        Obj := To_Object;
        case Message is
            when Non =>

                return ("");

            when Entexte =>  
                if To_Object.Identity = 0 then
                    return ("faux");
                else
                    if To_Object.Identity = 1 then
                        return ("vrai");
                    end if;
                end if;
        end case;

    end Send;


    function Send (To_Object : Object.Reference; The_Message : Object.Message)
                  return Object.Reference is
        Message : Unary_Message;
        Obj : Object.Reference;
    begin
        Message := Unary_Message'Value (Bounded_String.Image (The_Message));
        Obj := To_Object;
        case Message is
            when Non =>
                Obj.Identity := (To_Object.Identity + 1) mod 2;
            when Entexte =>  
                if To_Object.Identity = 0 then
                    Text_Io.Put ("faux");
                else
                    if To_Object.Identity = 1 then
                        Text_Io.Put ("vrai");
                    end if;
                end if;
        end case;
        return Obj;
    exception
        when Constraint_Error =>
            raise Error_Broadcaster.Unknown_Unary_Message;
    end Send;

    function Send (To_Object : Object.Reference;
                   The_Message : Object.Message;
                   The_Argument : Object.Reference) return Object.Reference is
        Message : Binary_Message;
        Obj : Object.Reference;
    begin
        Message := Binary_Message'Value (Bounded_String.Image (The_Message));
        case Message is
            when Et =>
                Obj.Identity := (To_Object.Identity * The_Argument.Identity);
                Obj.Class := Object.Tiny_Boolean;
            when Ou =>

                Obj.Identity :=
                   (To_Object.Identity + The_Argument.Identity) / 2 +
                      (To_Object.Identity + The_Argument.Identity) mod 2;
                Obj.Class := Object.Tiny_Boolean;
        end case;
        return Obj;
    exception
        when Constraint_Error =>
            raise Error_Broadcaster.Boolean_Bad_Type;
    end Send;

    function Send (To_Object : Object.Reference;
                   The_Argument : Object.Parameters.List)
                  return Object.Reference is

        Obj : Object.Reference;
        Local_Argument : Object.Parameters.List := The_Argument;
        The_Message : Object.Message;
    begin
        Bounded_String.Copy (The_Message, "valeur");
        if (String_Utilities.Equal
               (Bounded_String.Image
                   (Object.Parameters.Selector (Local_Argument)),
                "siVrai:", True)) then
            if (To_Object.Identity = 1) then
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));
            else
                return Object.Void_Reference;
            end if;

        elsif (String_Utilities.Equal
                  (Bounded_String.Image
                      (Object.Parameters.Selector (Local_Argument)),
                   "siFaux:", True)) then
            if (To_Object.Identity = 0) then
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));
            else
                return Object.Void_Reference;
            end if;

        elsif String_Utilities.Equal
                 (Bounded_String.Image
                     (Object.Parameters.Selector (Local_Argument)),
                  "siVrai:siFaux:", True) then  
            if (To_Object.Identity = 1) then
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));
            elsif (To_Object.Identity = 0) then
                Object.Parameters.Get (Local_Argument, Obj);
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));


            end if;

        elsif String_Utilities.Equal
                 (Bounded_String.Image
                     (Object.Parameters.Selector (Local_Argument)),
                  "siFaux:siVrai:", True) then
            if (To_Object.Identity = 0) then
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));
            elsif (To_Object.Identity = 1) then
                Object.Parameters.Get (Local_Argument, Obj);
                Object.Parameters.Get (Local_Argument, Obj);
                return (Object.Send (Obj, The_Message));
            end if;
        else
            raise Error_Broadcaster.Unknown_Keyword_Message;
        end if;

    end Send;

end Boolean_Class;