parent_class (instance|class)
This function returns the closest (immediate) parent (base) class of the class or instance provided.
Gamma> class RegPolygon{sides; length;} (defclass RegPolygon nil [][length sides]) Gamma> class Square RegPolygon {sides = 4;} (defclass Square RegPolygon [][length (sides . 4)]) Gamma> class BigSquare Square {length = 30;}; (defclass BigSquare Square [][(length . 30) (sides . 4)]) Gamma> polyA = new(RegPolygon); {RegPolygon (length) (sides)} Gamma> sqC = new(Square); {Square (length) (sides . 4)} Gamma> bigD = new(BigSquare); {BigSquare (length . 30) (sides . 4)} Gamma> parent_class(polyA); nil Gamma> parent_class(sqC); (defclass RegPolygon nil [][length sides]) Gamma> parent_class(bigD); (defclass Square RegPolygon [][length (sides . 4)]) Gamma> parent_class(Square); (defclass RegPolygon nil [][length sides]) Gamma> parent_class(BigSquare); (defclass Square RegPolygon [][length (sides . 4)]) Gamma>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.