glue example: INSTRUCTIONS

Hernan Astudillo R. hernan at cc.gatech.edu
Sat Feb 13 00:14:19 UTC 1993


greetings,
	this is the INSTRUCTIONS file for building a C++ class and Self
interface to it.  the class is useless, as you will notice even if you only
peek for a second, but it is useful to try the features.

	so, if you want to try this (NO WARRANTY OF FITTNESS FOR ANY PARTICULAR PURPOSE etc etc), here are some simple instructions.  have fun.

--hernan
--			|
Hernan Astudillo R.	| "Life is short.  Play hard."
hernan at cc.gatech.edu	|		-- Reebok
College of Computing, Georgia Tech, Atlanta GA 30332 / (404) 853-9390

%%%%%%%%%%%%%%%%%%%%%% INSTRUCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

*** A FEW STEPS TO TEST THE C++-CLASS INVOCATIOn CAPABILITIES OF Self ***
*** (assuming that Self has been installed as 'snapshot')

*** to generate Self and C++ stubs for glue:
% export SELF_WORKING_DIR=<your_work_dir>	(named .../self)
% snapshot					(run Self)
Self> cc greetingGlueTemplates			(generate stubs)

*** to compile the C++ function into a .so file:
% export GLUE_DEFS="${HOME}/self/local/glueDefs"	(or wherever)
% g++ -I${GLUE_DEFS} -c greeting.cc			(gotta use g++)
% ld -Bstatic -o libgreetingGlue.so.0 greeting.o -lg++ -lgcc
     ^^^^^^^^(kjx)					(link library)

*** to run and test the glued function from Self, do:
% snapshot
Self> cc greeting		(this script includes the machine stubs too)
Self> _AddSlots: (| tmp. |)			(add a tmp slot to lobby)
Self> tmp: (createGreeting: 'yo selfer')	(invoke constructor)
Self> tmp					(it's aaalive!!)
Self> tmp sayIt: 2				(test the member)
Self> tmp delete				(test the destructor)
Self> tmp					(it's dead jim!!)

*** voila`!!  you should be the proud owner of a brain-damaged Self-run
*** C++-written greeting class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





More information about the Self-interest mailing list