Tcl / Objective-C Interface Library
***********************************

The Tcl / Objective-C Interface Library, version 0.1, is now
available. 

Where can you get it?  How can you compile it?
==============================================

   The library is available by anonymous ftp at
     cs.rochester.edu:pub/libcoll/libtclobjc-0.1.tar.gz

   The library requires gcc-2.5.2 or higher (It will not work with
NeXT's cc), tcl-7.3, tk-3.6, libcoll-931026, libreadline and GNU make.
Gcc, libreadline and GNU make are available at any of the GNU archive
sites; tcl and tk are available at ftp.cs.berkeley.edu; libcoll is
available at cs.rochester.edu:pub/libcoll/. GNU archive sites include:
     gatekeeper.dec.com:pub/GNU/
     prep.ai.mit.edu:pub/gnu/

   The `.tar' file is compressed with GNU gzip.  It can be obtained by
anonymous ftp at any of the GNU archive sites.

   For info about FTP via email, send email to `ftpmail@decwrl.dec.com'
with no subject line, and two-line body with line one `help' and line
two `quit'.

What is the Tcl / Objective-C Interface Library ?
=================================================

   It's a library of Objective-C objects and support functions for
communicating between Objective-C and Tcl/Tk.  From Tcl you can send
messages to Objective-C objects and get textual representations of
what's returned.  Thus it provides a way to interactively type
messages and see the results, all inside the rich structure of the Tcl
scripting language---pretty much an Objective-C interpretter.  The
library also provides an object that will forward all of it's messages
to the Tcl interpretter in textual format.

The library does NOT provide:
* Handling arguments of non-atomic C types (structures, unions, etc).
* Tk widgets based NeXTSTEP AppKit objects.
* The ability to create new Objective-C classes or methods from Tcl.

WARNING: This code is provided on an as-is basis.  It currently works
great in my environment (I've been using extensively for the past 4
months), but unfortunately I don't have time right now to make it work
for everyone.

I'm happy to accept patches for bug fixes, but please don't bother me
for help with your individual libtclobjc problems.  I'm sorry to be so
hard-nosed about this.  Perhaps in the future I'll have time clean
this up and support it.

Examples
========

Here's an example minimal main.m:

> #include "Tk.h"
> 
> int main (int argc, char *argv[])
> {
>   id tk = [[Tk alloc] initWithArgc:argc argv:argv];
>   [tk promptAndEval];
>   exit(0);
> }

Compile it like this:
	gcc main.m -ltclobjc -lcoll -lobjc -lreadline -ltermcap \
		-ltk -ltcl -lX11 -lm

Once my program is running, I can interactively do things like this:
(assuming that the Array class from libcoll is also linked in).

  wish: set myarray [[Array alloc] init]
  Array@0x161328
  wish: $myarray isClass
  0
  wish: $myarray isInstance
  1
  wish: $myarray name
  Array
  wish: $myarray addObject: [[Object alloc] init]
  Array@0x161328
  wish: $myarray addObject: [[Object alloc] init]
  Array@0x161328
  wish: set myobject [[Object alloc] init]
  Object@0x161600
  wish: $myarray insertObject: $myobject atIndex: 1
  Array@0x161328
  wish: $myarray objectAtIndex: 1
  Object@0x161600
  wish: 

Installation
============

0. libtclobjc must get at ObjC's class hash table.  Unfortunately,
the relevant variable is defined static in the gcc distrubution.
Therefore, you'll have to change one line of gcc-2.5.7/objc/class.c,
and recompile/reinstall libobjc.a.
	Change the line:
		static cache_ptr __objc_class_hash = 0;
	to:
		cache_ptr __objc_class_hash = 0;

1. Read the Makefile and fix it for your site.  Sorry it's so messy.
If I get more time to clean things up, this will be the first thing I
fix.  If anyone wants to GNUify the Makefile and add autoconf support,
I'll be happy to accept the changes.  Above I said that you would need
GNU make; you might not actually need GNU make after to modify the
Makefile. 

2. You'll need to install libreadline and libcoll (my Objective-C
collection library) before libtclobjc can be compiled.  libreadline is
available as part of the gdb distribution.  Here's part of the
collection library's README:

> The GNU Objective-C Collection Class Library, `libcoll' version
> 931026, is now available.
> 
> Where can you get it?  How can you compile it?
> ==============================================
> 
>    The library is available by anonymous ftp at
>      cs.rochester.edu:pub/libcoll/libcoll-931026.tar.gz
> 
> What is the Collection library?
> ===============================
> 
>    It's a library of Objective-C objects with similar functionality to
> Smalltalk's Collection objects.  It includes: Set, Bag, Array,
> CircularArray, GapArray, Queue, Stack, Heap, LinkedList, BinaryTree,
> SplayTree, RBTree, Dictionary, MappedCollector, EltNodeCollector and
> DelegateList.

3. Type `make'

4. Type `make install'


-----------------------------------------------------------------
R. Andrew McCallum            EMAIL: mccallum@cs.rochester.edu
Computer Science Department   VOX:  (716) 275-2527
University of Rochester       FAX:  (716) 461-2018
Rochester, NY  14627-0226     FEET:  CSB  Rm. 625
