README 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. GNU Objective C notes
  2. *********************
  3. This document is to explain what has been done, and a little about how
  4. specific features differ from other implementations. The runtime has
  5. been completely rewritten in gcc 2.4. The earlier runtime had several
  6. severe bugs and was rather incomplete. The compiler has had several
  7. new features added as well.
  8. This is not documentation for Objective C, it is usable to someone
  9. who knows Objective C from somewhere else.
  10. Runtime API functions
  11. =====================
  12. The runtime is modeled after the NeXT Objective C runtime. That is,
  13. most functions have semantics as it is known from the NeXT. The
  14. names, however, have changed. All runtime API functions have names
  15. of lowercase letters and underscores as opposed to the
  16. `traditional' mixed case names.
  17. The runtime api functions are not documented as of now.
  18. Someone offered to write it, and did it, but we were not allowed to
  19. use it by his university (Very sad story). We have started writing
  20. the documentation over again. This will be announced in appropriate
  21. places when it becomes available.
  22. Protocols
  23. =========
  24. Protocols are now fully supported. The semantics is exactly as on the
  25. NeXT. There is a flag to specify how protocols should be typechecked
  26. when adopted to classes. The normal typechecker requires that all
  27. methods in a given protocol must be implemented in the class that
  28. adopts it -- it is not enough to inherit them. The flag
  29. `-Wno-protocol' causes it to allow inherited methods, while
  30. `-Wprotocols' is the default which requires them defined.
  31. +load
  32. ===========
  33. This method, if defined, is called for each class and category
  34. implementation when the class is loaded into the runtime. This method
  35. is not inherited, and is thus not called for a subclass that doesn't
  36. define it itself. Thus, each +load method is called exactly once by
  37. the runtime. The runtime invocation of this method is thread safe.
  38. +initialize
  39. ===========
  40. This method, if defined, is called before any other instance or class
  41. methods of that particular class. For the GNU runtime, this method is
  42. not inherited, and is thus not called as initializer for a subclass that
  43. doesn't define it itself. Thus, each +initialize method is called exactly
  44. once by the runtime (or never if no methods of that particular class is
  45. never called). It is wise to guard against multiple invocations anyway
  46. to remain portable with the NeXT runtime. The runtime invocation of
  47. this method is thread safe.
  48. Passivation/Activation/Typedstreams
  49. ===================================
  50. This is supported in the style of NeXT TypedStream's. Consult the
  51. headerfile Typedstreams.h for api functions. I (Kresten) have
  52. rewritten it in Objective C, but this implementation is not part of
  53. 2.4, it is available from the GNU Objective C prerelease archive.
  54. There is one difference worth noting concerning objects stored with
  55. objc_write_object_reference (aka NXWriteObjectReference). When these
  56. are read back in, their object is not guaranteed to be available until
  57. the `-awake' method is called in the object that requests that object.
  58. To objc_read_object you must pass a pointer to an id, which is valid
  59. after exit from the function calling it (like e.g. an instance
  60. variable). In general, you should not use objects read in until the
  61. -awake method is called.
  62. Acknowledgements
  63. ================
  64. The GNU Objective C team: Geoffrey Knauth <gsk@marble.com> (manager),
  65. Tom Wood <wood@next.com> (compiler) and Kresten Krab Thorup
  66. <krab@iesd.auc.dk> (runtime) would like to thank a some people for
  67. participating in the development of the present GNU Objective C.
  68. Paul Burchard <burchard@geom.umn.edu> and Andrew McCallum
  69. <mccallum@cs.rochester.edu> has been very helpful debugging the
  70. runtime. Eric Herring <herring@iesd.auc.dk> has been very helpful
  71. cleaning up after the documentation-copyright disaster and is now
  72. helping with the new documentation.
  73. Steve Naroff <snaroff@next.com> and Richard Stallman
  74. <rms@gnu.ai.mit.edu> has been very helpful with implementation details
  75. in the compiler.
  76. Bug Reports
  77. ===========
  78. Please read the section `Submitting Bugreports' of the gcc manual
  79. before you submit any bugs.