DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦69bf9ddef⟧ TextFile

    Length: 2711 (0xa97)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦2398b9edc⟧ 
            └─⟦this⟧ 

TextFile


with physicalObject;
package body monkey is

   package behaviour is new classBehavior(object,"MONKEY    ");

   procedure make  (is_at         : coordinate;
		    on		  : physical_object := (others=>' ');
		    holds	  : physical_object := (others=>' ')) is
      the_monkey : monkey.object;
   begin
      the_monkey.is_at := is_at;
      the_monkey.on    := on;
      the_monkey.holds := holds;

      if the_monkey.on /= floor then
	 declare
	    obj : reference;

            function same_at_value(an_object : reference) return boolean is
            begin
               return 
                  physicalObject.name(an_object) = the_monkey.on	and then
		  physicalObject.is_at(an_object) = the_monkey.is_at;
            end same_at_value;

            function find_an_object is new collection.findOne(same_at_value);
	 begin
  	    obj := find_an_object(physicalObject.instances);
	    if collection.isNull(obj) then
	       raise illegal_make;
	    end if;
         end;
      end if;

      behaviour.allocate(the_monkey);
   end make;

   function is_at  (the_reference : in expertSystem.reference)
                 return coordinate is
   begin
      return behaviour.get(the_reference).is_at;
   end is_at;

   function is_on  (the_reference : in expertSystem.reference)
		 return physical_object is
   begin
      return behaviour.get(the_reference).on;
   end is_on;

   function holds  (the_reference : in expertSystem.reference)
                 return physical_object is
   begin
      return behaviour.get(the_reference).holds;
   end holds;

   procedure modify_coordinate  (the_reference  : in expertSystem.reference;
				 new_coordinate : in coordinate) is
      the_object : object;
   begin
      the_object := behaviour.get(the_reference);
      the_object.is_at := new_coordinate;
      behaviour.set(the_reference, the_object);
   end modify_coordinate;

   procedure modify_is_on       (the_reference  : in expertSystem.reference;
				 new_object     : in physical_object) is
      the_object : object;
   begin
      the_object := behaviour.get(the_reference);
      the_object.on := new_object;
      behaviour.set(the_reference, the_object);
   end modify_is_on;

   procedure modify_object_held (the_reference  : in expertSystem.reference;
				 new_object     : in physical_object) is
      the_object : object;
   begin
      the_object := behaviour.get(the_reference);
      the_object.holds := new_object;
      behaviour.set(the_reference, the_object);
   end modify_object_held;

   function instances return collection.object is
   begin
      return behaviour.instances;
   end instances;

   procedure clear is
   begin
      behaviour.clear;
   end clear;

end monkey;