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

⟦bb5c79fdb⟧ TextFile

    Length: 1709 (0x6ad)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 

TextFile

package body System_Operators is


    -- subtype Predicate_Operators  is Operators range Is_Equal_Op .. Is_Any_Op;
    -- subtype Arithmetic_Operators is Operators range '+' .. Abs_Op;

    function Match (Using_Operator : Operators;
                    Value          : Integer;
                    Against        : Integer) return Boolean is
    begin
        case Using_Operator is
            when Is_Equal_Op =>
                return Value = Against;
            when Is_Less_Op =>
                return Value < Against;
            when Is_Less_Or_Equal_Op =>
                return Value <= Against;
            when Is_Greater_Op =>
                return Value > Against;
            when Is_Greater_Or_Equal_Op =>
                return Value >= Against;
            when Is_Different_Op =>
                return Value /= Against;
            when Is_Any_Op =>
                return True;
                -- when Arithmetic_Operators =>
            when '+' .. Abs_Op =>
                raise Illegal_Operation;
        end case;
    end Match;

    function Evaluate (Using_Operator : Operators; Left, Right : Integer)
                      return Integer is
    begin
        case Using_Operator is
            -- when Predicate_Operators =>
            when Is_Equal_Op .. Is_Any_Op =>
                raise Illegal_Operation;
            when '+' =>
                return Left + Right;
            when '-' =>
                return Left - Right;
            when '*' =>
                return Left * Right;
            when '/' =>
                return Left / Right;  
            when Abs_Op =>
                return abs Left;
        end case;
    end Evaluate;

end System_Operators;