Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesForced Objects


April 1997 / Reviews / Hand-Held Development Options / Forced Objects

Psion's C development package and Geoworks GEOS SDK attempt a difficult trick: implementing an object-oriented environment atop the nonobject-oriented C language. Both systems require that a project include class-definition files -- category files on the Psion, GOC (GEOS C) files in GEOS. After preprocessing, these definition files are merged (either before or after linking, depending on the platform) with C source code files that implement the classes' behavior.

GEOS uses prepended keywords to identify classes, messages, objects, and instance data. For instance, you define a class and its messages with the following statements:


@class <classname>, <superclass >;

@message void <message1>;

@message void <message2>;

@endc <classname>, <classattributes>;

Psion's overloading scheme allows a subclass to override its parent's methods. You can't specify this within the C language, which has no concept of class or overriding. The preprocessor recognizes the method keyword preceding a function. In that case, the programmer must give the function's name the form <classname>_<methodname> , which associates method with class (the class having been defined in the category file) while satisfying C's requirement that each function name be unique.


Up to the Reviews section contentsGo to previous article: Forced ObjectsGo to next article: Java Development Kit, Take TwoSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network