[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
glue example: INSTRUCTIONS
- To: self-interest@myself.stanford.edu (Self mailing list)
- Subject: glue example: INSTRUCTIONS
- From: hernan@cc.gatech.edu (Hernan Astudillo R.)
- Date: Fri, 12 Feb 93 19:14:19 EST
- Resent-date: Fri, 12 Feb 93 16:15:27 PST
- Resent-from: Urs Hoelzle <urs@otis>
- Resent-message-id: <9302130015.AA01217@otis.Stanford.Edu>
- Resent-to: real-self-interest
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@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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%