Should you require any more information or have encountered a problem, please call the support helpdesk on (07) 5456 6000.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

GELLO is Object Oriented. Lets set up a package for a subatomic particle and then make an instance, and declare a statement that is either true or false as the result.


Here's how to do a package. We will keep it in the one GELLO file but often these packages form a library of functions that can be imported. These would be saved  with the extension .gello_model (see earlier tutes)

Package SubatomicParticle
imports iso_21090_datatypes

    class Quark
      name: String
      electricCharge: String
      mass: PQ
      spin: String

EndPackage


This example uses useful ISO21090 datatypes, in this case highlighting a PQ which is a Physical Quantity.

Lets create an instance:

Let aQuark: Quark = Quark {name = 'Up',
                           electricCharge = '2/3',
                           mass = PQ{value = 2.2 , unit = 'MeV/c^2'},
                           spin = '1/2'
                          }

..and have a final declarative 'outer expression':

aQuark.mass > PQ{value=1.00, unit='MeV/c^2'}


When we run this, here are the variables and the result:






  • No labels