home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / sampl254.zip / gcc2 / samples / sample4 / printable.m < prev    next >
Text File  |  1993-10-31  |  428b  |  37 lines

  1. #include <stdio.h>
  2. #include "printable.h"
  3.  
  4. @implementation PrintableInt
  5. - setInt: (int)aValue
  6. {
  7.   value = aValue;
  8.   return self;
  9. }
  10. - print
  11. {
  12.   printf("%d", value);
  13. }
  14. @end
  15.  
  16.  
  17. @implementation PrintableString
  18. - setStr: (char *)aValue
  19. {
  20.   value = aValue;
  21.   return self;
  22. }
  23. - print
  24. {
  25.   printf("%s", value);
  26. }
  27. @end
  28.  
  29.  
  30. @implementation EOL
  31. - init
  32. {
  33.   self = [super init];
  34.   [super setStr: "\n"];
  35. }
  36. @end
  37.