[self-interest] Getting code out of Self

Chris Double chris.double at double.co.nz
Mon Nov 16 08:08:57 UTC 2015


On Mon, Nov 16, 2015 at 5:26 PM, Daniel Dyba daniel.dyba at gmail.com
[self-interest] <self-interest at yahoogroups.com> wrote:
> How do you get code out of Self? What if I want to share it for others to download, say on Github? Do I share the entire VM or can I extract only what I need? If I can extract what I need, how do I load the shared code into a new VM?

This is what the transporter is for. There's a paper on it here:

http://bluishcoder.co.nz/self/transporter.pdf

It's also discussed in the handbook:

http://handbook.selflanguage.org/4.5/howtoprg.html#the-transporter

If you middle click on an object (eg. the bankaccount object) you'll
see a 'set module' option. Clicking that lets you enter a name for the
module for the code and objects in bank account. Do this for all the
new objects and slots created

Middle clicking on the desktop should show a "Changed Modules" option.
Clicking that brings up a list of all modules that have changed -
whether the bank account or changed slots in other objects. You can
click 'W' to write the changes to disk.

These changes are written to source code files which can be committed
to git or other source code repository. This is how I wrote out the
changes to the VNC viewer objects:
https://github.com/doublec/self-vncviewer

There are a bunch of things you can tweak that set whether objects are
written as is, created anew on loading, stored as expressions, etc.
The paper and handbook above describe these. It'll probably take some
playing around with it to get a feel for it.

Russell added the ability to transport code to directories outside of
the current Self directory structure:
https://groups.yahoo.com/neo/groups/self-interest/conversations/messages/3187

-- 
http://bluishcoder.co.nz



More information about the Self-interest mailing list