Binary Classes and User Classes

Gamma: Version 4.0
Prev | Chapter 8. Object Oriented Programming | Next

# 8.8. Binary Classes and User Classes

Binary classes are classes that are built into the specific version of Gamma that you are using. User classes are those classes defined by the programmer in the process of developing an application.

To test the number of built-in classes in the version of Gamma you are using, start a fresh instance and use the `apropos` function interactively to find all available classes:

        andrew:/home/andrew > gamma
        Gamma;(TM) Advanced Programming Language
        Copyright (C) Cogent Real-Time Systems Inc., 1996.  All rights
        reserved.
        Version 2.4 Build 139 at Jul 6 1999 10:48:51
        Gamma> apropos("*",class_p);
        (Osinfo)

As we can see, gamma does not have built-in binary classes. Now let us try to run phgamma:

        andrew:/home/andrew > phgamma
        Gamma(TM) Advanced Programming Language
        Copyright (C) Cogent Real-Time Systems Inc., 1996.  All rights
        reserved.
        Version 2.4 Build 139 at July 6 1999 14:21:45
        Gamma> apropos("*",class_p);
        (Osinfo PhArea PhBlitEvent PhBoundaryEvent PhDim PhDragEvent
        PhDrawEvent PhEvent PhEventRegion PhExtent PhImage PhKeyEvent
        PhLpoint PhPoint PhPointerEvent PhPrect PhRect PhRegion PhRgb
        PhWindowEvent PtArc PtBarGraph PtBasic PtBasicCallback PtBezier
        PtBitmap PtBkgd PtButton PtCallbackInfo PtComboBox
        PtComboBoxListCallback PtComboBoxTextCallback PtContainer
        PtDivider PtEllipse PtEventData PtFontSel PtGauge PtGenList
        PtGenTree PtGraphic PtGrid PtGroup PtHtml PtIcon PtLabel PtLine
        PtList PtListCallback PtMenu PtMenuBar PtMenuButton PtMenuLabel
        PtMessage PtMeter PtMultiText PtOnOffButton PtPane PtPixel
        PtPolygon PtRaw PtRect PtRegion PtScrollArea PtScrollbar
        PtScrollbarCallback PtSeparator PtSlider PtTerminal PtText
        PtTextCallback PtToggleButton PtTree PtTrend PtTty PtWidget
        PtWindow RtTrend)

There is a significant difference in supported classes between the gamma and phgamma executables. The reason is that Photon widgets are mapped into phgamma as classes. The standard Gamma executable does not have support for Photon graphics and does not have these built-in binary classes.

User classes are found in the same manner. After user classes are defined they will match the `class_p` predicate in the `apropos` function and be added to the list:

        andrew:/home/andrew> gamma
        Gamma(TM) Advanced Programming Language
        Copyright (C) Cogent Real-Time Systems Inc., 1996.  All rights
        reserved.
        Version 2.4 Build 139 at Jul 6 1999 10:48:51
        Gamma> class test
        {
            a;
            b;
            c;
        }
        (defclass test nil [][a b c])
        Gamma> apropos("*",class_p);
        (Osinfo test)

Prev | Home | Next
Polymorphism | Up | Tutorial III

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.