Re: Nested Relations / RVAs / NFNF

From: Neo <neo55592_at_hotmail.com>
Date: 29 Oct 2004 19:32:46 -0700
Message-ID: <4b45d3ad.0410291832.47baf807_at_posting.google.com>


> ...how would you represent "two kilograms" in a program ?

With XDb2:

// Create necessary classes

CREATE2 *qty.cls = thing;
CREATE2 *unit.cls = thing;
CREATE2 *mass.cls = thing;

// Create 2kg
CREATE2 *;

CREATE2 it.cls = mass;
CREATE2 it.qty = +2;
CREATE2 it.unit = +kg;

"it" is 2kg. One view of above in a tree is shown below:

thing
  inst: mass
    inst: 2 kg

      qty: 2
      unit: kg

// Create a person who's mass is 2kg
CREATE2 *person.cls = thing;
CREATE2 *john.cls = person;
CREATE2 john.mass = (%.cls=mass & %.qty=2 & %.unit=kg);

thing
  inst: person
    inst: john

      mass: 2 kg
        qty: 2
        unit: kg
Received on Sat Oct 30 2004 - 04:32:46 CEST

Original text of this message