Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on Smalltalk (except Squeak).
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/smalltalk.e>
#           or at <http://angg.twu.net/e/smalltalk.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######





# «.gnu-smalltalk»	(to "gnu-smalltalk")
# «.a-new-class»	(to "a-new-class")
# «.gnu-smalltalk-old»	(to "gnu-smalltalk-old")
# «.gnu-smalltalk-2»	(to "gnu-smalltalk-2")
# «.designpatterns»	(to "designpatterns")
# «.visualworks»	(to "visualworks")
# «.ingalls-nonobvious»	(to "ingalls-nonobvious")

# (find-es "squeak")




#####
#
# GNU SmallTalk
# 2012feb26
#
#####

# «gnu-smalltalk»  (to ".gnu-smalltalk")
# (find-angg ".emacs" "smalltalk")
# (find-other-debian-links "smalltalk")
# (find-zsh "grep-available -i smalltalk")
# (eev "apti gnu-smalltalk gnu-smalltalk-doc gnu-smalltalk-el")
# (find-status   "gnu-smalltalk")
# (find-vldifile "gnu-smalltalk.list")
# (find-udfile   "gnu-smalltalk/")
# (find-status   "gnu-smalltalk-doc")
# (find-vldifile "gnu-smalltalk-doc.list")
# (find-udfile   "gnu-smalltalk-doc/")
# (find-status   "gnu-smalltalk-common")
# (find-vldifile "gnu-smalltalk-common.list")
# (find-udfile   "gnu-smalltalk-common/")
# (find-status   "gnu-smalltalk-el")
# (find-vldifile "gnu-smalltalk-el.list")
# (find-udfile   "gnu-smalltalk-el/")

# (find-gstfile "")
# (find-gstfile "examples/")
# (find-gstfile "examples/README")
# (find-gstfile "examples/Queens.st")
# (find-gstnode "")
# (find-gstnode "Invocation")
# (find-gstnode "Syntax")
# (find-gstnode "Namespaces")
# (find-gstnode "Disk file-IO")
# (find-gstnode "Disk file-IO" "fileIn:")
# (find-gstnode "Blox")
# (find-gstnode "Seaside")
# (find-gstnode "SUnit")
# (find-gstnode "Editing")
# (find-gstnode "Interactor")
# (find-gstnode "Tutorial")
# (find-gstnode "Files")
# (find-gstnode "Arrays")
# (find-gstnode "Dictionaries")
# (find-gstlibsnode "BLOX package")
# (find-gstbasenode "Array")
# (find-gstbasenode "String")
# (find-gstbasenode "Symbol")

# (find-gstnode "Packages" "fileInPackage:")

# http://smalltalk.gnu.org/
# http://smalltalk.gnu.org/wiki/IRC

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
gst
Smalltalk at: #f put: nil !
"Smalltalk at: #p put: #printNl !"
f := [:i | i printNl ] !
1 to: 5 do: f !
f value: 2 !
f argumentCount printNl !


* (eepitch-gst)
* (eepitch-kill)
* (eepitch-gst)
2 * 3 + 4.
2 + 3 * 4.

* (eepitch-gst)
* (eepitch-kill)
* (eepitch-gst)
file := FileStream open: '/tmp/README'.
[file atEnd] whileFalse:
[line := file nextLine. line printNl. "Process the line"]

* (eepitch-gst)
* (eepitch-kill)
* (eepitch-gst)
FileStream fileIn: 'Queens.st'
FileStream fileIn: '/usr/share/gnu-smalltalk/examples/Queens.st'




#####
#
# Creating a new class
# 2012jun01
#
#####

# «a-new-class»  (to ".a-new-class")
# (find-gstnode "A new class")





#####
#
# GNU SmallTalk 2.1.7
# 2004mar12
#
#####

# «gnu-smalltalk-2»  (to ".gnu-smalltalk-2")
# (code-c-d "gst" "~/usrc/smalltalk-2.1.7/" "~/usrc/smalltalk-2.1.7/doc/gst")
# (code-c-d "gstlibs" "" "~/usrc/smalltalk-2.1.7/doc/gst-libs")
# (code-c-d "gstbase" "" "~/usrc/smalltalk-2.1.7/doc/gst-base")
# (find-gstfile "")
#*
rm -Rv ~/usrc/smalltalk-2.1.7/
cd ~/usrc/
tar -xvzf $S/http/ftp.gnu.org/gnu/smalltalk/smalltalk-2.1.7.tar.gz
cd ~/usrc/smalltalk-2.1.7/
# (find-gstnode "Compiling")
# (find-gstfile "")
# (find-gstfile "smalltalk-mode.el")
# (find-gstfile "smalltalk-mode.el.in" "@lispdir@/gst-mode.elc")
# (find-gstfile "gst-mode.el")
# (find-gstfile "gst-mode.el.in" "@bindir@/gst")
#./configure --enable-modules=Blox,TCP	|& tee oc
#./configure		|& tee oc

CC=gcc-3.0 ./configure		|& tee oc
make				|& tee om

#*
# (find-gstnode "")
# (find-gstnode "Autoloading")
# (find-gstnode "Packages" "gst -qsK Load.st -a Browser Blox")
# (find-gstnode "Invocation")
# (find-gstlibsnode "")
# (find-gstbasenode "")
# (find-gstbasenode "Object")

# (find-gstfile "")
# (find-gstfile "oc")
# (find-gstfile "blox-tk/")

#*
cd ~/usrc/smalltalk-2.1.7/
gst -qsK Load.st -a Browser Blox
gst
#*
cd ~/usrc/smalltalk-2.1.7/
rm -v gst.im
gst
#*
cd ~/usrc/smalltalk-2.1.7/
gst
#*

# (find-gstfile "examples/")
#*
# (find-gstnode "Smalltalk dictionary")
# (find-gstnode "Invocation")
# (find-gstbasenode "")
# (find-gstbasenode "BlockClosure")
# (find-gstbasenode "BlockClosure-built ins")
# (find-gstbasenode "BlockClosure-accessing")
# (find-gstnode "Conditions")
# (find-gstnode "The output stream")
eev-cd gst
cat > $EEG <<'---'
Smalltalk at: #f put: nil !
"Smalltalk at: #p put: #printNl !"
f := [:i | i printNl ] !
1 to: 5 do: f !
f value: 2 !
f argumentCount printNl !
---
eeg gst -q

#*
# (find-gstbasenode "Object")
# (find-gstbasenode "Object-built ins")
# (find-gstbasenode "Object-printing")
# (find-gstbasenode "Behavior-accessing the methodDictionary")

22 class allSelectors printNl !
Integer inspect !




#####
#
# readFile (very old notes???)
#
#####

readFile
  | file contents |
  file := FileStream oldFileNamed: '/home/edrx/eev/test.txt'.
  contents := file contents.
  file close.
  ^contents





#####
#
# GNU SmallTalk 2.1.7
# 2004mar12
#
#####

# «gnu-smalltalk-2»  (to ".gnu-smalltalk-2")
# http://ftp.gnu.org/gnu/smalltalk/smalltalk-2.1.9.tar.gz
#*
rm -Rv ~/usrc/smalltalk-2.1.9/
tar -C ~/usrc/ -xvzf $S/http/ftp.gnu.org/gnu/smalltalk/smalltalk-2.1.9.tar.gz

#*
cd ~/usrc/smalltalk-2.1.9/
# ./configure |& tee oc
./configure  --disable-gtk |& tee oc
make  |& tee om

#*
* (eechannel-xterm "A")
cd ~/usrc/smalltalk-2.1.9/
gst
1 + 2 !

#*
# (find-gstfile "")
# (find-gstnode "")

# (add-to-list 'Info-additional-directory-list "~/usrc/smalltalk-2.1.9/doc/")
# (code-c-d "gst" "~/usrc/smalltalk-2.1.9/" "gst")
# (find-gstfile "doc/")
# (find-gstfile "om")
# (find-gstfile "configure" "Optional Features:")
# (find-gstfile "")
(ee-gstfile "")

# (find-node "(gst)")
# (find-node "(gst-libs)")
# (find-node "(gst-base)")
# (find-node "(gst-base)BindingDictionary-accessing" "doesNotUnderstand:")
# (find-node "(gst-base)Method index" "* methodDictionary:")


# (code-c-d "gst" "~/usrc/smalltalk-2.1.7/" "~/usrc/smalltalk-2.1.7/doc/gst")
# (code-c-d "gstlibs" "" "~/usrc/smalltalk-2.1.7/doc/gst-libs")
# (code-c-d "gstbase" "" "~/usrc/smalltalk-2.1.7/doc/gst-base")
# (find-gstfile "")
# http://ftp.gnu.org/gnu/smalltalk/
#*
rm -Rv ~/usrc/smalltalk-2.1.7/
cd ~/usrc/
tar -xvzf $S/http/ftp.gnu.org/gnu/smalltalk/smalltalk-2.1.7.tar.gz
cd ~/usrc/smalltalk-2.1.7/
# (find-gstnode "Compiling")
# (find-gstfile "")
# (find-gstfile "smalltalk-mode.el")
# (find-gstfile "smalltalk-mode.el.in" "@lispdir@/gst-mode.elc")
# (find-gstfile "gst-mode.el")
# (find-gstfile "gst-mode.el.in" "@bindir@/gst")
#./configure --enable-modules=Blox,TCP	|& tee oc
#./configure		|& tee oc

CC=gcc-3.0 ./configure		|& tee oc
make				|& tee om

#*
# (find-gstnode "")
# (find-gstnode "Autoloading")
# (find-gstnode "Packages" "gst -qsK Load.st -a Browser Blox")
# (find-gstnode "Invocation")
# (find-gstlibsnode "")
# (find-gstbasenode "")
# (find-gstbasenode "Object")

# (find-gstfile "")
# (find-gstfile "oc")
# (find-gstfile "blox-tk/")

#*
cd ~/usrc/smalltalk-2.1.7/
gst -qsK Load.st -a Browser Blox
gst
#*
cd ~/usrc/smalltalk-2.1.7/
rm -v gst.im
gst
#*
cd ~/usrc/smalltalk-2.1.7/
gst
#*

# (find-gstfile "examples/")
#*
# (find-gstnode "Smalltalk dictionary")
# (find-gstnode "Invocation")
# (find-gstbasenode "")
# (find-gstbasenode "BlockClosure")
# (find-gstbasenode "BlockClosure-built ins")
# (find-gstbasenode "BlockClosure-accessing")
# (find-gstnode "Conditions")
# (find-gstnode "The output stream")
eev-cd gst
cat > $EEG <<'---'

* (eepitch-gst)
* (eepitch-kill)
* (eepitch-gst)
Smalltalk at: #f put: nil !
"Smalltalk at: #p put: #printNl !"
f := [:i | i printNl ] !
1 to: 5 do: f !
f value: 2 !
f argumentCount printNl !

# (find-gstbasenode "Object")
# (find-gstbasenode "Object-built ins")
# (find-gstbasenode "Object-printing")
# (find-gstbasenode "Behavior-accessing the methodDictionary")
# (find-gstbasenode "Behavior-accessing the methodDictionary" "allSelectors")

22 class allSelectors printNl !
Integer inspect !









#####
#
# GNU SmallTalk 1.95.3
# 2001mar02
#
#####

# «gnu-smalltalk-old»  (to ".gnu-smalltalk-old")
#*
rm -Rv ~/usrc/smalltalk-1.95.3/
cd ~/usrc/
tar -xvzf $S/ftp/ftp.gnu.org/gnu/smalltalk/smalltalk-1.95.3.tar.gz
cd ~/usrc/smalltalk-1.95.3/
# (find-gstnode "Compiling")
# (find-gstfile "")
./configure --enable-modules=Blox,TCP	|& tee oc
#./configure		|& tee oc
(cd lib-src/; make)	|& tee omls
make			|& tee om

#*
# (find-es "dpkg" "install-info")
#*
# (find-gstnode "Blox")
# Weird, not working... What have I done wrong? (Aha:)
#apti tk8.2-dev
# Detection of Tcl/Tk 8.3 needs extra parameters to "./configure"...
# (find-gstnode "Packages")
# (find-gstfile "blox/")
# (find-gstfile "blox/tk/")
# (find-gstfile "blox/tk/Makefile.am")

# But this demo is boring, better go on to the CLI stuff.
cd ~/usrc/smalltalk-1.95.3/
gst -qK blox/Run.st

# And this messes up the other demos, so it is better for now to
# compile gst without Tcl/Tk...
#apti tk8.3-dev

#*
# (find-gstnode "Saying hello" "statistics")
# (find-gstnode "Math in Smalltalk")
cd ~/usrc/smalltalk-1.95.3/
cat > $EEG <<'---'


* (eepitch-gst)
* (eepitch-kill)
* (eepitch-gst)
'Hello, world' printNl !
(9 + 7) printNl !
(8 * (4 / 2)) printNl !
(8 - (4 + 1)) printNl !
(5 + 4) printNl !
(2/3 + 7) printNl !
(2 + 3 * 4) printNl !
(2 + (3 * 4)) printNl !

*; (find-gstnode "Some classes")
Smalltalk at: #x put: 0 !
x := Array new: 20 !
(x at: 1) printNl !
x at: 1 put: 99 !
(x at: 1) printNl !

6 at: 1 !
x at: 21 !

((x at: 1) + 1) printNl !

x := Set new !
x printNl !
x add: 5 !
x add: 7 !
x add: 'foo' !
x add: 5; add: 7; add: 'foo' !
x printNl !
x add:5; add: 5; add: 5; add: 5 !
x printNl !
x remove: 5 !
x printNl !
(x includes: 7) printNl !
(x includes: 5) printNl !

x := Dictionary new.
x at: 'One' put: 1 !
x at: 'Two' put: 2 !
x at: 1 put: 'One' !
x at: 2 put: 'Two' !

(x at: 1) printNl !
(x at: 'Two') printNl !
x printNl !

*; (find-gstnode "Smalltalk dictionary")
Smalltalk at: #x put: 0 !
y := 0 !
Smalltalk at: #y put: 0 !
y := 1 !

*; (find-gstnode "A new class")
*; Problem: multi-line
Object subclass: #Account
    instanceVariableNames: 'balance'
    classVariableNames: ''
    poolDictionaries: ''
    category: nil !

Account comment: 'I represent a place to deposit and withdraw money' !
(Account comment) printNl !
(Integer comment) printNl !

!Account class methodsFor: 'instance creation'!
new
    | r |
    r := super new.
    r init.
    ^r
! !

!Account methodsFor: 'instance initialization'!
init
    balance := 0
! !

Smalltalk at: #a put: (Account new) !
a printNl !

!Account methodsFor: 'printing'!
printOn: stream
    super printOn: stream.
    stream nextPutAll: ' with balance: '.
    balance printOn: stream
! !
a printNl !

!Account methodsFor: 'moving money'!
spend: amount
    balance := balance - amount
!
deposit: amount
    balance := balance + amount
! !

a deposit: 125!
a deposit: 20!
a printNl!
a spend: 10!
a printNl!

Account subclass: #Savings
    instanceVariableNames: 'interest'
    classVariableNames: ''
    poolDictionaries: ''
    category: nil !

!Savings methodsFor: 'initialization'!
init
    interest := 0.
    ^ super init
! !

!Savings methodsFor: 'interest'!
interest: amount
    interest := interest + amount.
    self deposit: amount
!
clearInterest
    | oldinterest |

    oldinterest := interest.
    interest := 0.
    ^oldinterest
! !

Account subclass: #Checking
     instanceVariableNames: 'checknum checksleft'
     classVariableNames: ''
     poolDictionaries: ''
     category: nil !

!Checking methodsFor: 'Initialization'!
init
    checksleft := 0.
    ^super init
! !

!Checking methodsFor: 'spending'!
newChecks: number count: checkcount
    checknum := number.
    checksleft := checkcount
!

writeCheck: amount
    | num |

    num := checknum.
    checknum := checknum + 1.
    checksleft := checksleft - 1.
    self spend: amount.
    ^ num
! !

Smalltalk at: #c put: (Checking new) !
c printNl !
c deposit: 250 !
c printNl !
c newChecks: 100 count: 50 !
c printNl !
(c writeCheck: 32) printNl !
c printNl !

!Checking methodsFor: 'spending'!
writeCheck: amount
    | num |

    (checksleft < 1)
        ifTrue: [ ^self error: 'Out of checks' ].
    num := checknum.
    checknum := checknum + 1.
    checksleft := checksleft - 1.
    self spend: amount.
    ^ num
! !

true ifTrue: [ 'Hello, world!' printNl ] !
false ifTrue: [ 'Hello, world!' printNl ] !
true ifFalse: [ 'Hello, world!' printNl ] !
false ifFalse: [ 'Hello, world!' printNl ] !

*; Note that there is a missing "." here (I fixed it in my script):
*; (find-gstnode "Conditions" "self spend: amount")





#####
#
# Design Patterns (book - some code in SmallTalk and C++)
# 2008jan21
#
#####

# «designpatterns»  (to ".designpatterns")
# http://www.flazx.com/
#*
rm -Rv /tmp/designpatterns/
mkdir  /tmp/designpatterns/
cd     /tmp/designpatterns/
extract_chmLib ~/books/design-patters.chm /tmp/designpatterns/

#*
# (code-c-d "designpatterns" "/tmp/designpatterns/" :ffox)
# (find-designpatternsfile "")
# (find-designpatternsw3m "chap1.htm")
# (find-designpatternsffox "chap1.htm")




#####
#
# Cincom Visualworks
# 2011nov18
#
#####

# «visualworks»  (to ".visualworks")
# (find-angg ".emacs" "visualworks")
# http://www.cincomsmalltalk.com/main/2011/11/a-short-report-on-smalltalks-2011/
# http://www.cincomsmalltalk.com/main/2011/11/cincom-smalltalk-release-cycles-fall-release-and-future-releases/
# http://www.cincomsmalltalk.com/main/2011/11/smalltalk-digest-november-2011-edition/
# http://www.cincomsmalltalk.com/main/2011/11/version-9-2-of-petrovr-2011-offers-new-capabilities-and-numerous-enhancements/
# http://www.cincomsmalltalk.com/main/developer-community/trying-cincom-smalltalk/thank-you/
# http://www.cincomsmalltalk.com/main/developer-community/trying-cincom-smalltalk/try-cincom-smalltalk/
# http://www.cincomsmalltalk.com/main/products/visualworks/

# (find-fline "/sda7/torrents/")
# (find-fline "/sda7/torrents/" "CST11NC_mar11.4pu.iso")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/visualworks-iso/
sudo mount -o loop,ro /sda7/torrents/CST11NC_mar11.4pu.iso /tmp/visualworks-iso/

# (find-fline "/tmp/visualworks-iso/")
# (find-fline "/tmp/visualworks-iso/Install.txt")
# (find-fline "/tmp/visualworks-iso/Install.txt" "Disk and Memory Requirements")

# (find-angg "vw7.8nc/")
# (find-fline "~/vw7.8nc/")
# (find-fline "~/vw7.8nc/userActions.txt")
# (find-fline "/sda7/visualworks/")

export VISUALWORKS=/home/edrx/vw7.8nc
bin/linux86/visual image/visualnc.im


echo exec "$OE" $@ "$image_file" -installMap "$map_file"
exec vw7.8nc/bin/linux86/visual vw7.8nc/image/install.im -installMap /tmp/visualworks-iso/install.map



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/visualworks-iso/installUnix")
# (find-fline "/tmp/visualworks-iso/installUnix" "exec")
cd /tmp/visualworks-iso/
vw7.8nc/bin/linux86/visual \
  vw7.8nc/image/install.im -installMap /tmp/visualworks-iso/install.map

# (find-fline "~/vw7.8nc/")
# (find-fline "~/vw7.8nc/install.log")
# (find-fline "~/vw7.8nc/userActions.txt")
export VISUALWORKS=$HOME/vw7.8nc
~/vw7.8nc/bin/linux86/visual

# (find-fline "~/vw7.8nc/bin/linux86/" "visual")
# (find-fline "~/vw7.8nc/bin/linux86/visual")
# (find-fline "~/vw7.8nc/VisualWorks Projects")

# (find-fline "~/vw7.8nc/doc/" "WalkThrough.pdf")




#####
#
# Dan Ingalls's quote on nonobvious ideas
# 2012mar12
#
#####

# «ingalls-nonobvious»  (to ".ingalls-nonobvious")
# http://lua-users.org/lists/lua-l/2012-03/msg00019.html
# http://tkbr.ccsp.sfu.ca/dynabook/book/chapter-4-translating-smalltalk/
# http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltalk_TOC.html
# http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltalk_IV.html
# http://www.smalltalk.org/versions/LittleSmalltalk.html

It started to hit home in the Spring of '74 after I taught Smalltalk
to 20 PARC nonprogrammer adults. They were able to get through the
initial material faster than the children, but just as it looked like
an overwhelming success was at hand, they started to crash on problems
that didn't look to me to be much harder than the ones they had just
been doing well on. One of them was a project thought up by one of the
adults, which was to make a little database system that could act like
a card file or rolodex. They couldn't even come close to programming
it. I was very surprised because I "klnew" that such a project was
well below the mythical "two pages" for end-users we were working
within. That night I worote it out, and the next day I showed all of
them how to do it. Still, none of them were able to do it by
themsleves. Later, I sat in the room poindering the board from my
talk. Finally, I counted the number of nonobvious ideas in this little
program. They came to 17. And some of them were like the concept of
the arch in building design: very hard to discover, if you don't
already know them.
                                                                                                         
The connection to literacy was painfully clear. It isn't enough to
just learn to read and write. There is also a literature that renders
ideas. Language is used to read and write about them, but at some
point the organization of ideas starts to dominate mre language
abilities. And it help greatly to have some powerful ideas under one's
belt to better acquire more powerful ideas [Papert 70s]. So, we
decided we should teach design. And Adele came up with another
brillian stroke to deal with this. She decided that what was needed
was in intermediary between the vague ideas about the problem and the
very detailed writing and debugging that had to be done to get it to
run in Smalltalk. She called the intermediary forms design templates.







cd /tmp/visualworks-iso/









irc.squeakfoundation.org #smalltalk
irc.parcplace.net        #smalltalk
irc.4096.sk              #smalltalk




# (find-gstfile "")
# (find-gstfile "examples/modules/")

# (find-gstnode "Top")
# (find-gstnode "Syntax")
# (find-gstnode "Saying hello")

# (add-to-list 'Info-additional-directory-list "~/usrc/smalltalk-2.1.9/doc/")
# (code-c-d "gst" "~/usrc/smalltalk-2.1.9/" "gst")
# (find-node "(gst)")
# (find-node "(gst-libs)")
# (find-node "(gst-base)")
# (find-node "(gst-base)BindingDictionary-accessing" "doesNotUnderstand:")
# (find-node "(gst-base)Method index" "* methodDictionary:")
# (find-node "(gst)Defining methods")
# (find-node "(gst)The syntax" "\"!\" id [\"class\"] \"methodsFor:\"")

# (find-angg ".emacs.papers" "smalltalk")

http://smalltalk.gnu.org/
http://strongtalk.org/
http://olua.sourceforge.net/






#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: