[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: Starting with smalltalk
From: |
Paolo Bonzini |
Subject: |
[Help-smalltalk] Re: Starting with smalltalk |
Date: |
Mon, 03 Jul 2006 15:35:01 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (Macintosh/20060530) |
(First of all, you may want to subscribe to address@hidden -- it
is moderated for non-subscribers, so no spam).
I've been reading the GNU smalltalk manual, but the following I havn't
been able to find on the web yet:
- A GNU smalltalk compatible, functional program
You mean a program written with gst? Unfortunately I don't know of any
:-( Mike Anderson has some on his blog, but they're small.
- A way of seperating smalltalk source over multiple files
You write the source code in multiple files, and then provide a loading
script that loads them all (optionally saving everything to an image
file, see later).
- A way of editing smalltalk files without the use of a commercial IDE
GNU Smalltalk has an Emacs mode.
- A way of running smalltalk probrams like other programs (from the
commandline) without the need of a wrapper script (The normal
'#!/usr/bin/env doesn't work, nor could i find ways of creating
bytecode/packages/binaries)
You can use (with GNU Smalltalk 2.2)
#! /usr/bin/env gst -f
or
#! /bin/sh
"exec" "gst" "-f" "$0" "$@"
GNU Smalltalk special cases the #! at the beginning of a file as a
one-line command. Comments are quote-delimited in Smalltalk, so the
second line is eaten by GNU Smalltalk's parser in the second example.
In addition, GNU Smalltalk can save a snapshot of its status in an image
(.im) file that can be made executable with chmod. Making something run
automatically when the image file is reloaded is feasible. Just create
a class-side method named #update: including some code like
update: aspect
"Flush instances of the receiver when an image is loaded."
aspect == #returnFromSnapshot ifTrue: [ self restart ]!
and then evaluate code like
ObjectMemory
addDependent: NameOfTheClassWithTheUpdateMethod;
snapshot: 'myprogram.im'
Then, running gst with "gst -I myprogram.im" (or just making
myprogram.im executable) will invoke the #restart method on the class
NameOfTheClassWithTheUpdateMethod.
Paolo
- [Help-smalltalk] Re: Starting with smalltalk,
Paolo Bonzini <=
- Re: [Help-smalltalk] Re: Starting with smalltalk, Mike Anderson, 2006/07/05
- Re: [Help-smalltalk] Re: Starting with smalltalk, Bram Neijt, 2006/07/05
- Re: [Help-smalltalk] Re: Starting with smalltalk, Paolo Bonzini, 2006/07/06
- Message not available
- Re: [Help-smalltalk] Re: Starting with smalltalk, Paolo Bonzini, 2006/07/06
- [Help-smalltalk] [Q] Unicode String?, Chun Sungjin, 2006/07/06
- Re: [Help-smalltalk] [Q] Unicode String?, Paolo Bonzini, 2006/07/07
- Re: [Help-smalltalk] [Q] Unicode String?, Chun Sungjin, 2006/07/07
- Re: {Spam?} Re: [Help-smalltalk] [Q] Unicode String?, Paolo Bonzini, 2006/07/07
- Why string should be collection of single byte characters? (WAS: Re: [Help-smalltalk] [Q] Unicode String?), Sungjin Chun, 2006/07/07
- Re: {Spam?} Why string should be collection of single byte characters? (WAS: Re: [Help-smalltalk] [Q] Unicode String?), Paolo Bonzini, 2006/07/07