Skip to content

Commit

Permalink
Removed args from Lobby (and therefor Object) and moved all calls to …
Browse files Browse the repository at this point in the history
…System args
  • Loading branch information
cdmoyer authored and Steve Dekorte committed Jan 11, 2008
1 parent 1953294 commit 14cae4e
Show file tree
Hide file tree
Showing 34 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion addons/DBI/samples/benchmark.io
@@ -1,6 +1,6 @@
#!/usr/bin/env io

recCount := if(args at(1), args at(1) asNumber, 50000)
recCount := if(System args at(1), System args at(1) asNumber, 50000)

c := DBI with("sqlite3")
c optionPut("dbname", "test.db")
Expand Down
2 changes: 1 addition & 1 deletion addons/Flux/samples/Slideshow/main.io
Expand Up @@ -105,7 +105,7 @@ Slideshow := GLApp clone do(
specialDownKey := method(slideNumber = (slideNumber + 1) min(slides size - 1))
)

//Slideshow open(if(args size > 0, args at(1), "slides.txt"))
//Slideshow open(if(System args size > 0, System args at(1), "slides.txt"))
path := Path with(launchPath, "slides.txt")
Slideshow open(path)

2 changes: 1 addition & 1 deletion addons/Font/samples/slides.io
Expand Up @@ -104,4 +104,4 @@ Slideshow := GLApp clone do(
specialDownKey := method(slideNumber = ((slideNumber + 1) min(slides size - 1)))
)

Slideshow open(args at(0))
Slideshow open(System args at(0))
1 change: 1 addition & 0 deletions addons/Image/samples/scale.io
Expand Up @@ -3,6 +3,7 @@

App := Object clone do(
display := method(
args := System args
e := try(
inFile := args at(0)
outFile := args at(1)
Expand Down
2 changes: 1 addition & 1 deletion addons/Loki/samples/shootout/fasta.io
Expand Up @@ -49,7 +49,7 @@ Fasta := Object clone do(
)
)

n := args at(1) asNumber
n := System args at(1) asNumber

">ONE Homo sapiens alu" println
Fasta repeat(2*n, ALU)
Expand Down
2 changes: 1 addition & 1 deletion addons/Loki/samples/shootout/nsieve-bits.io
Expand Up @@ -25,7 +25,7 @@ sieve := Object clone do(
)
)

n := args at(1) asNumber
n := System args at(1) asNumber
sieve show(10000 shiftLeft(n))
sieve show(10000 shiftLeft(n-1))
sieve show(10000 shiftLeft(n-2))
2 changes: 1 addition & 1 deletion addons/Loki/samples/shootout/nsieve.io
Expand Up @@ -26,7 +26,7 @@ nsieve := method(n,
writeln("Primes up to", n asString alignRight(9, " "), cnt asString alignRight(9, " "))
)

n := args at(1) asNumber
n := System args at(1) asNumber
nsieve( (2^n)*10000 )
nsieve( (2^(n-1))*10000 )
nsieve( (2^(n-2))*10000 )
4 changes: 2 additions & 2 deletions addons/Loki/samples/shootout/old_nsieve.io
Expand Up @@ -31,12 +31,12 @@ Object clone do(
)

clk := chrono(
//n := args at(1) asNumber
//n := System args at(1) asNumber
nsieve( (2**(n))*10000 )
nsieve( (2**(n-1))*10000 )
nsieve( (2**(n-2))*10000 )
)

"#{clk / (2* (10 **(9)))} sec" interpolate println
)
"ok."
"ok."
4 changes: 2 additions & 2 deletions addons/MD5/samples/md5.io
Expand Up @@ -13,12 +13,12 @@ File md5String := method(
digest md5String
)

if (?args == nil or args size == 0,
if (System ?args == nil or System args size == 0,
write("requires a file name as an argument\n")
exit
)

f := File clone setPath(args at(0))
f := File clone setPath(System args at(0))
m1 := f md5String
m2 := f asBuffer md5String
write("md5 = ", m1, "\n")
Expand Down
4 changes: 2 additions & 2 deletions addons/OpenGL/samples/game/client.io
Expand Up @@ -123,8 +123,8 @@ GameClient update := method(id, x, y, angle,
ServerConnection := Object clone
ServerConnection setDelegate := method(d, self delegate := d; self)
ServerConnection setup := method(
ip := if(args at(0), args at(0), "67.118.104.220")
port := if(args at(1), args at(1), 8888)
ip := if(System args at(0), System args at(0), "67.118.104.220")
port := if(System args at(1), System args at(1), 8888)
self socket := Socket clone setHost(ip) setPort(port) connect
if (socket == nil, write("Unable to connect to ", ip, " on port ", port, "\n"); exit)
)
Expand Down
2 changes: 1 addition & 1 deletion addons/Socket/samples/Google.io
Expand Up @@ -30,7 +30,7 @@ GoogleSearch := Object clone do(
)
)

GoogleSearch clone find(args at(1)) links foreach(println)
GoogleSearch clone find(System args at(1)) links foreach(println)

while(Coroutine yieldingCoros size > 1, yield)

Expand Down
4 changes: 2 additions & 2 deletions addons/Socket/samples/WebDownload.io
Expand Up @@ -4,8 +4,8 @@
// ./ioServer Sockets/_tests/WebDownload.io http://64.236.34.161:80/stream/1018 GrooveSalad.mp3

//doFile(launchPath .. "/URL.io")
url := args at(0)
fileName := args at(1)
url := System args at(0)
fileName := System args at(1)

//DNSResolver addServerAddress("128.105.2.10")

Expand Down
2 changes: 1 addition & 1 deletion addons/Socket/samples/WebServer/test.io
Expand Up @@ -4,7 +4,7 @@
SocketManager setSelectTimeout(0.0)
Scheduler setSleepInterval(0)

requestCount := if(args at(0), args at(0) asNumber, 10000)
requestCount := if(System args at(0), System args at(0) asNumber, 10000)

t1 := Date clone now
lastChunkTime := Date clone now
Expand Down
2 changes: 1 addition & 1 deletion addons/SoundTouch/samples/sndplay.io
@@ -1,7 +1,7 @@
#!/usr/bin/env io

/*
if (?args == nil,
if (System ?args == nil,
write("requires name of sound file as argument")
)
*/
Expand Down
1 change: 1 addition & 0 deletions build.io
Expand Up @@ -8,6 +8,7 @@ Directory fileNamedOrNil := method(path,
Directory setCurrentWorkingDirectory(launchPath)

project := Project clone
args := System args clone
if(args at(1) == "-a") then(
project buildAddon(args at(2))
) elseif (args at(1)) then(
Expand Down
3 changes: 0 additions & 3 deletions libs/iovm/io/A2_Object.io
Expand Up @@ -286,7 +286,6 @@ Object do(

launchFile := method(path, args,
args ifNil(args = List clone)
Lobby args := args
Lobby launchPath := path pathComponent
Directory setCurrentWorkingDirectory(Lobby launchPath)
System launchScript = path
Expand Down Expand Up @@ -480,5 +479,3 @@ Object do(
"Evaluates the File in the context of the receiver. Returns the result. pathString is relative to the file calling doRelativeFile. (Duplicate of doRelativeFile)")
relativeDoFile := getSlot("doRelativeFile")
)

Lobby args := method(System args)
14 changes: 7 additions & 7 deletions libs/iovm/io/Z_CLI.io
Expand Up @@ -59,23 +59,23 @@ CLI := Object clone do(

runIorc

if(?args first == "-e",
writeln(context doString(args slice(1) map(asUTF8) join(" ")))
if(System ?args first == "-e",
writeln(context doString(System args slice(1) map(asUTF8) join(" ")))
return
)

if(?args and args size > 0,
if(System ?args and System args size > 0,

if(args first == "-i",
if(args size >= 2,
runFile(args at(1))
if(System args first == "-i",
if(System args size >= 2,
runFile(System args at(1))
,
if(File clone setPath("main.io") exists, runFile("main.io"))
)
return interactiveMultiline
)

runFile(args first)
runFile(System args first)
,
if(File clone setPath("main.io") exists,
runFile("main.io")
Expand Down
1 change: 1 addition & 0 deletions libs/iovm/tests/UnicodeTest-helper/printer.io
Expand Up @@ -2,6 +2,7 @@

Importer addSearchPath(Path with(method(call message label pathComponent) call, ".."))

args := System
if(args at(1) == "--print",
UnicodeTest getSlot(args at(2)) print
exit
Expand Down
4 changes: 2 additions & 2 deletions libs/iovm/tests/run.io
Expand Up @@ -3,12 +3,12 @@
//Message useIoShuffle
//Collector debugOn

if(args size > 1,
if(System args size > 1,
# Run specific tests
UnitTest verbose := getSlot("writeln")

time := Date clone cpuSecondsToRun(
args slice(1) foreach(name,
System args slice(1) foreach(name,
writeln(name, ":")
try(
if(name endsWithSeq(".io"),
Expand Down
2 changes: 1 addition & 1 deletion samples/misc/CommandLineArgs.io
Expand Up @@ -3,4 +3,4 @@
// ./io CommandLineArgs.io a b c d

writeln("Command line arguments:")
args foreach(println)
System args foreach(println)
2 changes: 1 addition & 1 deletion samples/misc/MainFile.io
Expand Up @@ -7,7 +7,7 @@ if(isLaunchScript,

writeln("System launchPath: ", System launchPath)
writeln("System launchScript: ", System launchScript)
writeln("args: ", args)
writeln("System args: ", System args)
,
# Loaded using doFile("MainFile.io")
writeln("Was included from another file")
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/binarytrees.io
Expand Up @@ -20,7 +20,7 @@ TreeNode := Object clone do(
)

minDepth := 4
maxDepth := args at(1) asNumber max(minDepth+2)
maxDepth := System args at(1) asNumber max(minDepth+2)

check := TreeNode clone bottomUpTree(0, maxDepth+1) itemCheck
writeln("stretch tree of depth ", maxDepth+1, "\t check: ", check)
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/chameneos.io
Expand Up @@ -5,7 +5,7 @@
Contributed by Gavin Harrison */

n := args at(1) asNumber
n := System args at(1) asNumber
meetings := 0
first := second := Nil

Expand Down
12 changes: 6 additions & 6 deletions samples/shootout/cheapconcurrency.io
Expand Up @@ -4,7 +4,7 @@
http://shootout.alioth.debian.org
Contributed by Gavin Harrison */

times := args at(1) asNumber
times := System args at(1) asNumber

Coroutine setStackSize(30000)

Expand All @@ -25,14 +25,14 @@ last := nil
)

first := t
args at(1) asNumber repeat(first @@foo(0))
System args at(1) asNumber repeat(first @@foo(0))

while(Coroutine yieldingCoros size > 0, yield)

writeln(sum)

/*
times := args at(1) asNumber
times := System args at(1) asNumber
sum := 0
Expand Down Expand Up @@ -71,13 +71,13 @@ mainCoro := Coroutine currentCoroutine
//Collector setDebug(true)
first := t
args at(1) asNumber repeat(first receive(0))
System args at(1) asNumber repeat(first receive(0))
writeln(sum)
*/


/*
times := args at(1) asNumber
times := System args at(1) asNumber
sum := 0
n := 0
Expand All @@ -93,7 +93,7 @@ send := method(
)
mainCoro := Coroutine currentCoroutine
iters := args at(1) asNumber
iters := System args at(1) asNumber
for(i, 1, iters,
n = 500
send
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/fannkuch.io
Expand Up @@ -43,6 +43,6 @@ fannkuch := method(n,
)
)

n := args at(1) asNumber
n := System args at(1) asNumber
f := fannkuch(n)
writeln("Pfannkuchen(", n, ") = ", f)
2 changes: 1 addition & 1 deletion samples/shootout/fasta.io
Expand Up @@ -55,7 +55,7 @@ Fasta := Object clone do(
)
)

n := args at(1) asNumber
n := System args at(1) asNumber

">ONE Homo sapiens alu" println
Fasta repeat(2*n, ALU)
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/mandelbrot.io
Expand Up @@ -88,5 +88,5 @@ MandelbrotSet := Object clone do(
)
)

MandelbrotSet dim := args at(1) asNumber
MandelbrotSet dim := System args at(1) asNumber
MandelbrotSet do( calc; printSet )
2 changes: 1 addition & 1 deletion samples/shootout/nbody.io
Expand Up @@ -105,6 +105,6 @@ Sim := Object clone do(
//Collector setDebug(true)

Sim energy asString(0,17) println
Sim advance(args at(1) asNumber, 0.01)
Sim advance(System args at(1) asNumber, 0.01)
Sim energy asString(0,9) println

2 changes: 1 addition & 1 deletion samples/shootout/nsieve.io
Expand Up @@ -28,7 +28,7 @@ nsieve := method(n,
writeln("Primes up to", n asString alignRight(9, " "), cnt asString alignRight(9, " "))
)

n := args at(1) asNumber
n := System args at(1) asNumber
nsieve( (2^n)*10000 )
nsieve( (2^(n-1))*10000 )
nsieve( (2^(n-2))*10000 )
2 changes: 1 addition & 1 deletion samples/shootout/nsievebits.io
Expand Up @@ -27,7 +27,7 @@ sieve := Object clone do(
)
)

n := args at(1) asNumber
n := System args at(1) asNumber
sieve show(10000 shiftLeft(n))
sieve show(10000 shiftLeft(n-1))
sieve show(10000 shiftLeft(n-2))
2 changes: 1 addition & 1 deletion samples/shootout/partialsums.io
Expand Up @@ -9,7 +9,7 @@
/* Contributed by Anthony Borla */
/* ------------------------------------------------------------------ */

n := args at(1) asNumber
n := System args at(1) asNumber

s0 := 0 ; s1 := 0 ; s2 := 0 ; s3 := 0 ; s4 := 0 ; s5 := 0 ; s6 := 0
s7 := 0 ; s8 := 0 ; d2 := 0 ; d3 := 0 ; ds := 0 ; dc := 0 ; alt := 1
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/recursive.io
Expand Up @@ -47,7 +47,7 @@ tak := method(x, y, z,

/* ----------------------------- */

n := args at(1) asNumber
n := System args at(1) asNumber

// Use interpolation for complex string expressions
"Ack(3,#io{n}): #io{ack(3, n)}" interpolate println
Expand Down
2 changes: 1 addition & 1 deletion samples/shootout/spectral-norm.io
Expand Up @@ -29,5 +29,5 @@ SNorm:=Object clone do(
n repeatTimes(u append(0))
MAv(n,v,u)
MAtv(n,u,AtAv)))
n:=args at(1) asNumber
n:= System args at(1) asNumber
SNorm App(n) asString(0,9) println
4 changes: 2 additions & 2 deletions tools/io/DocsExtractor.io
Expand Up @@ -50,8 +50,8 @@ DocsExtractor := Object clone do(
)

de := DocsExtractor clone
de setPath(args at(1))
if(args at(3) == "clean", de clean, de extract)
de setPath(System args at(1))
if(System args at(3) == "clean", de clean, de extract)



0 comments on commit 14cae4e

Please sign in to comment.