script4.stx
author Claus Gittinger <cg@exept.de>
Tue, 18 Jun 2019 21:36:29 +0200
changeset 1597 e6215fb6ec7c
parent 1510 328cf54d3850
permissions -rwxr-xr-x
fix for english mac kbd

#!stx --script
"/
"/ on any system:
"/      "stx --script script1.stx
"/ or:
"/      "stx --f script.stx"
"/ or:
"/      "stx script1.stx"
"/
"/ on Unix:
"/      make this file executable,
"/      ensure that stx is in your path,
"/      then type ./script1.stx
"/
"/ will just print some numbers
"/

"/ Stderr showCR:Workspace workspaceVariableNames.
"/ Stderr showCR:Workspace workspaceVariables.

_$n == 1 ifFalse:[
    Stderr showCR:('usage: ',_$0,' <n>').
    Smalltalk exit:1.
].

1 to:(_$1 asInteger) do:[:i |
   ('the factorial of %1 is %2'
	bindWith:i with:i factorial) printCR
].