Skip to content
This repository
Browse code

Removed args from Lobby (and therefor Object) and moved all calls to …

…System args
  • Loading branch information...
commit 14cae4e1b4e2ff48b7f8530dba3dae89607d1004 1 parent 1953294
Chris Moyer cdmoyer authored Steve Dekorte committed

Showing 34 changed files with 50 additions and 50 deletions. Show diff stats Hide diff stats

  1. +1 1  addons/DBI/samples/benchmark.io
  2. +1 1  addons/Flux/samples/Slideshow/main.io
  3. +1 1  addons/Font/samples/slides.io
  4. +1 0  addons/Image/samples/scale.io
  5. +1 1  addons/Loki/samples/shootout/fasta.io
  6. +1 1  addons/Loki/samples/shootout/nsieve-bits.io
  7. +1 1  addons/Loki/samples/shootout/nsieve.io
  8. +2 2 addons/Loki/samples/shootout/old_nsieve.io
  9. +2 2 addons/MD5/samples/md5.io
  10. +2 2 addons/OpenGL/samples/game/client.io
  11. +1 1  addons/Socket/samples/Google.io
  12. +2 2 addons/Socket/samples/WebDownload.io
  13. +1 1  addons/Socket/samples/WebServer/test.io
  14. +1 1  addons/SoundTouch/samples/sndplay.io
  15. +1 0  build.io
  16. +0 3  libs/iovm/io/A2_Object.io
  17. +7 7 libs/iovm/io/Z_CLI.io
  18. +1 0  libs/iovm/tests/UnicodeTest-helper/printer.io
  19. +2 2 libs/iovm/tests/run.io
  20. +1 1  samples/misc/CommandLineArgs.io
  21. +1 1  samples/misc/MainFile.io
  22. +1 1  samples/shootout/binarytrees.io
  23. +1 1  samples/shootout/chameneos.io
  24. +6 6 samples/shootout/cheapconcurrency.io
  25. +1 1  samples/shootout/fannkuch.io
  26. +1 1  samples/shootout/fasta.io
  27. +1 1  samples/shootout/mandelbrot.io
  28. +1 1  samples/shootout/nbody.io
  29. +1 1  samples/shootout/nsieve.io
  30. +1 1  samples/shootout/nsievebits.io
  31. +1 1  samples/shootout/partialsums.io
  32. +1 1  samples/shootout/recursive.io
  33. +1 1  samples/shootout/spectral-norm.io
  34. +2 2 tools/io/DocsExtractor.io
2  addons/DBI/samples/benchmark.io
... ... @@ -1,6 +1,6 @@
1 1 #!/usr/bin/env io
2 2
3   -recCount := if(args at(1), args at(1) asNumber, 50000)
  3 +recCount := if(System args at(1), System args at(1) asNumber, 50000)
4 4
5 5 c := DBI with("sqlite3")
6 6 c optionPut("dbname", "test.db")
2  addons/Flux/samples/Slideshow/main.io
@@ -105,7 +105,7 @@ Slideshow := GLApp clone do(
105 105 specialDownKey := method(slideNumber = (slideNumber + 1) min(slides size - 1))
106 106 )
107 107
108   -//Slideshow open(if(args size > 0, args at(1), "slides.txt"))
  108 +//Slideshow open(if(System args size > 0, System args at(1), "slides.txt"))
109 109 path := Path with(launchPath, "slides.txt")
110 110 Slideshow open(path)
111 111
2  addons/Font/samples/slides.io
@@ -104,4 +104,4 @@ Slideshow := GLApp clone do(
104 104 specialDownKey := method(slideNumber = ((slideNumber + 1) min(slides size - 1)))
105 105 )
106 106
107   -Slideshow open(args at(0))
  107 +Slideshow open(System args at(0))
1  addons/Image/samples/scale.io
@@ -3,6 +3,7 @@
3 3
4 4 App := Object clone do(
5 5 display := method(
  6 + args := System args
6 7 e := try(
7 8 inFile := args at(0)
8 9 outFile := args at(1)
2  addons/Loki/samples/shootout/fasta.io
@@ -49,7 +49,7 @@ Fasta := Object clone do(
49 49 )
50 50 )
51 51
52   -n := args at(1) asNumber
  52 +n := System args at(1) asNumber
53 53
54 54 ">ONE Homo sapiens alu" println
55 55 Fasta repeat(2*n, ALU)
2  addons/Loki/samples/shootout/nsieve-bits.io
@@ -25,7 +25,7 @@ sieve := Object clone do(
25 25 )
26 26 )
27 27
28   -n := args at(1) asNumber
  28 +n := System args at(1) asNumber
29 29 sieve show(10000 shiftLeft(n))
30 30 sieve show(10000 shiftLeft(n-1))
31 31 sieve show(10000 shiftLeft(n-2))
2  addons/Loki/samples/shootout/nsieve.io
@@ -26,7 +26,7 @@ nsieve := method(n,
26 26 writeln("Primes up to", n asString alignRight(9, " "), cnt asString alignRight(9, " "))
27 27 )
28 28
29   -n := args at(1) asNumber
  29 +n := System args at(1) asNumber
30 30 nsieve( (2^n)*10000 )
31 31 nsieve( (2^(n-1))*10000 )
32 32 nsieve( (2^(n-2))*10000 )
4 addons/Loki/samples/shootout/old_nsieve.io
@@ -31,7 +31,7 @@ Object clone do(
31 31 )
32 32
33 33 clk := chrono(
34   - //n := args at(1) asNumber
  34 + //n := System args at(1) asNumber
35 35 nsieve( (2**(n))*10000 )
36 36 nsieve( (2**(n-1))*10000 )
37 37 nsieve( (2**(n-2))*10000 )
@@ -39,4 +39,4 @@ Object clone do(
39 39
40 40 "#{clk / (2* (10 **(9)))} sec" interpolate println
41 41 )
42   -"ok."
  42 +"ok."
4 addons/MD5/samples/md5.io
@@ -13,12 +13,12 @@ File md5String := method(
13 13 digest md5String
14 14 )
15 15
16   -if (?args == nil or args size == 0,
  16 +if (System ?args == nil or System args size == 0,
17 17 write("requires a file name as an argument\n")
18 18 exit
19 19 )
20 20
21   -f := File clone setPath(args at(0))
  21 +f := File clone setPath(System args at(0))
22 22 m1 := f md5String
23 23 m2 := f asBuffer md5String
24 24 write("md5 = ", m1, "\n")
4 addons/OpenGL/samples/game/client.io
@@ -123,8 +123,8 @@ GameClient update := method(id, x, y, angle,
123 123 ServerConnection := Object clone
124 124 ServerConnection setDelegate := method(d, self delegate := d; self)
125 125 ServerConnection setup := method(
126   - ip := if(args at(0), args at(0), "67.118.104.220")
127   - port := if(args at(1), args at(1), 8888)
  126 + ip := if(System args at(0), System args at(0), "67.118.104.220")
  127 + port := if(System args at(1), System args at(1), 8888)
128 128 self socket := Socket clone setHost(ip) setPort(port) connect
129 129 if (socket == nil, write("Unable to connect to ", ip, " on port ", port, "\n"); exit)
130 130 )
2  addons/Socket/samples/Google.io
@@ -30,7 +30,7 @@ GoogleSearch := Object clone do(
30 30 )
31 31 )
32 32
33   -GoogleSearch clone find(args at(1)) links foreach(println)
  33 +GoogleSearch clone find(System args at(1)) links foreach(println)
34 34
35 35 while(Coroutine yieldingCoros size > 1, yield)
36 36
4 addons/Socket/samples/WebDownload.io
@@ -4,8 +4,8 @@
4 4 // ./ioServer Sockets/_tests/WebDownload.io http://64.236.34.161:80/stream/1018 GrooveSalad.mp3
5 5
6 6 //doFile(launchPath .. "/URL.io")
7   -url := args at(0)
8   -fileName := args at(1)
  7 +url := System args at(0)
  8 +fileName := System args at(1)
9 9
10 10 //DNSResolver addServerAddress("128.105.2.10")
11 11
2  addons/Socket/samples/WebServer/test.io
@@ -4,7 +4,7 @@
4 4 SocketManager setSelectTimeout(0.0)
5 5 Scheduler setSleepInterval(0)
6 6
7   -requestCount := if(args at(0), args at(0) asNumber, 10000)
  7 +requestCount := if(System args at(0), System args at(0) asNumber, 10000)
8 8
9 9 t1 := Date clone now
10 10 lastChunkTime := Date clone now
2  addons/SoundTouch/samples/sndplay.io
... ... @@ -1,7 +1,7 @@
1 1 #!/usr/bin/env io
2 2
3 3 /*
4   -if (?args == nil,
  4 +if (System ?args == nil,
5 5 write("requires name of sound file as argument")
6 6 )
7 7 */
1  build.io
@@ -8,6 +8,7 @@ Directory fileNamedOrNil := method(path,
8 8 Directory setCurrentWorkingDirectory(launchPath)
9 9
10 10 project := Project clone
  11 +args := System args clone
11 12 if(args at(1) == "-a") then(
12 13 project buildAddon(args at(2))
13 14 ) elseif (args at(1)) then(
3  libs/iovm/io/A2_Object.io
@@ -286,7 +286,6 @@ Object do(
286 286
287 287 launchFile := method(path, args,
288 288 args ifNil(args = List clone)
289   - Lobby args := args
290 289 Lobby launchPath := path pathComponent
291 290 Directory setCurrentWorkingDirectory(Lobby launchPath)
292 291 System launchScript = path
@@ -480,5 +479,3 @@ Object do(
480 479 "Evaluates the File in the context of the receiver. Returns the result. pathString is relative to the file calling doRelativeFile. (Duplicate of doRelativeFile)")
481 480 relativeDoFile := getSlot("doRelativeFile")
482 481 )
483   -
484   -Lobby args := method(System args)
14 libs/iovm/io/Z_CLI.io
@@ -59,23 +59,23 @@ CLI := Object clone do(
59 59
60 60 runIorc
61 61
62   - if(?args first == "-e",
63   - writeln(context doString(args slice(1) map(asUTF8) join(" ")))
  62 + if(System ?args first == "-e",
  63 + writeln(context doString(System args slice(1) map(asUTF8) join(" ")))
64 64 return
65 65 )
66 66
67   - if(?args and args size > 0,
  67 + if(System ?args and System args size > 0,
68 68
69   - if(args first == "-i",
70   - if(args size >= 2,
71   - runFile(args at(1))
  69 + if(System args first == "-i",
  70 + if(System args size >= 2,
  71 + runFile(System args at(1))
72 72 ,
73 73 if(File clone setPath("main.io") exists, runFile("main.io"))
74 74 )
75 75 return interactiveMultiline
76 76 )
77 77
78   - runFile(args first)
  78 + runFile(System args first)
79 79 ,
80 80 if(File clone setPath("main.io") exists,
81 81 runFile("main.io")
1  libs/iovm/tests/UnicodeTest-helper/printer.io
@@ -2,6 +2,7 @@
2 2
3 3 Importer addSearchPath(Path with(method(call message label pathComponent) call, ".."))
4 4
  5 +args := System
5 6 if(args at(1) == "--print",
6 7 UnicodeTest getSlot(args at(2)) print
7 8 exit
4 libs/iovm/tests/run.io
@@ -3,12 +3,12 @@
3 3 //Message useIoShuffle
4 4 //Collector debugOn
5 5
6   -if(args size > 1,
  6 +if(System args size > 1,
7 7 # Run specific tests
8 8 UnitTest verbose := getSlot("writeln")
9 9
10 10 time := Date clone cpuSecondsToRun(
11   - args slice(1) foreach(name,
  11 + System args slice(1) foreach(name,
12 12 writeln(name, ":")
13 13 try(
14 14 if(name endsWithSeq(".io"),
2  samples/misc/CommandLineArgs.io
@@ -3,4 +3,4 @@
3 3 // ./io CommandLineArgs.io a b c d
4 4
5 5 writeln("Command line arguments:")
6   -args foreach(println)
  6 +System args foreach(println)
2  samples/misc/MainFile.io
@@ -7,7 +7,7 @@ if(isLaunchScript,
7 7
8 8 writeln("System launchPath: ", System launchPath)
9 9 writeln("System launchScript: ", System launchScript)
10   - writeln("args: ", args)
  10 + writeln("System args: ", System args)
11 11 ,
12 12 # Loaded using doFile("MainFile.io")
13 13 writeln("Was included from another file")
2  samples/shootout/binarytrees.io
@@ -20,7 +20,7 @@ TreeNode := Object clone do(
20 20 )
21 21
22 22 minDepth := 4
23   -maxDepth := args at(1) asNumber max(minDepth+2)
  23 +maxDepth := System args at(1) asNumber max(minDepth+2)
24 24
25 25 check := TreeNode clone bottomUpTree(0, maxDepth+1) itemCheck
26 26 writeln("stretch tree of depth ", maxDepth+1, "\t check: ", check)
2  samples/shootout/chameneos.io
@@ -5,7 +5,7 @@
5 5
6 6 Contributed by Gavin Harrison */
7 7
8   -n := args at(1) asNumber
  8 +n := System args at(1) asNumber
9 9 meetings := 0
10 10 first := second := Nil
11 11
12 samples/shootout/cheapconcurrency.io
@@ -4,7 +4,7 @@
4 4 http://shootout.alioth.debian.org
5 5 Contributed by Gavin Harrison */
6 6
7   -times := args at(1) asNumber
  7 +times := System args at(1) asNumber
8 8
9 9 Coroutine setStackSize(30000)
10 10
@@ -25,14 +25,14 @@ last := nil
25 25 )
26 26
27 27 first := t
28   -args at(1) asNumber repeat(first @@foo(0))
  28 +System args at(1) asNumber repeat(first @@foo(0))
29 29
30 30 while(Coroutine yieldingCoros size > 0, yield)
31 31
32 32 writeln(sum)
33 33
34 34 /*
35   -times := args at(1) asNumber
  35 +times := System args at(1) asNumber
36 36
37 37 sum := 0
38 38
@@ -71,13 +71,13 @@ mainCoro := Coroutine currentCoroutine
71 71 //Collector setDebug(true)
72 72
73 73 first := t
74   -args at(1) asNumber repeat(first receive(0))
  74 +System args at(1) asNumber repeat(first receive(0))
75 75 writeln(sum)
76 76 */
77 77
78 78
79 79 /*
80   -times := args at(1) asNumber
  80 +times := System args at(1) asNumber
81 81 sum := 0
82 82 n := 0
83 83
@@ -93,7 +93,7 @@ send := method(
93 93 )
94 94 mainCoro := Coroutine currentCoroutine
95 95
96   -iters := args at(1) asNumber
  96 +iters := System args at(1) asNumber
97 97 for(i, 1, iters,
98 98 n = 500
99 99 send
2  samples/shootout/fannkuch.io
@@ -43,6 +43,6 @@ fannkuch := method(n,
43 43 )
44 44 )
45 45
46   -n := args at(1) asNumber
  46 +n := System args at(1) asNumber
47 47 f := fannkuch(n)
48 48 writeln("Pfannkuchen(", n, ") = ", f)
2  samples/shootout/fasta.io
@@ -55,7 +55,7 @@ Fasta := Object clone do(
55 55 )
56 56 )
57 57
58   -n := args at(1) asNumber
  58 +n := System args at(1) asNumber
59 59
60 60 ">ONE Homo sapiens alu" println
61 61 Fasta repeat(2*n, ALU)
2  samples/shootout/mandelbrot.io
@@ -88,5 +88,5 @@ MandelbrotSet := Object clone do(
88 88 )
89 89 )
90 90
91   -MandelbrotSet dim := args at(1) asNumber
  91 +MandelbrotSet dim := System args at(1) asNumber
92 92 MandelbrotSet do( calc; printSet )
2  samples/shootout/nbody.io
@@ -105,6 +105,6 @@ Sim := Object clone do(
105 105 //Collector setDebug(true)
106 106
107 107 Sim energy asString(0,17) println
108   -Sim advance(args at(1) asNumber, 0.01)
  108 +Sim advance(System args at(1) asNumber, 0.01)
109 109 Sim energy asString(0,9) println
110 110
2  samples/shootout/nsieve.io
@@ -28,7 +28,7 @@ nsieve := method(n,
28 28 writeln("Primes up to", n asString alignRight(9, " "), cnt asString alignRight(9, " "))
29 29 )
30 30
31   -n := args at(1) asNumber
  31 +n := System args at(1) asNumber
32 32 nsieve( (2^n)*10000 )
33 33 nsieve( (2^(n-1))*10000 )
34 34 nsieve( (2^(n-2))*10000 )
2  samples/shootout/nsievebits.io
@@ -27,7 +27,7 @@ sieve := Object clone do(
27 27 )
28 28 )
29 29
30   -n := args at(1) asNumber
  30 +n := System args at(1) asNumber
31 31 sieve show(10000 shiftLeft(n))
32 32 sieve show(10000 shiftLeft(n-1))
33 33 sieve show(10000 shiftLeft(n-2))
2  samples/shootout/partialsums.io
@@ -9,7 +9,7 @@
9 9 /* Contributed by Anthony Borla */
10 10 /* ------------------------------------------------------------------ */
11 11
12   -n := args at(1) asNumber
  12 +n := System args at(1) asNumber
13 13
14 14 s0 := 0 ; s1 := 0 ; s2 := 0 ; s3 := 0 ; s4 := 0 ; s5 := 0 ; s6 := 0
15 15 s7 := 0 ; s8 := 0 ; d2 := 0 ; d3 := 0 ; ds := 0 ; dc := 0 ; alt := 1
2  samples/shootout/recursive.io
@@ -47,7 +47,7 @@ tak := method(x, y, z,
47 47
48 48 /* ----------------------------- */
49 49
50   -n := args at(1) asNumber
  50 +n := System args at(1) asNumber
51 51
52 52 // Use interpolation for complex string expressions
53 53 "Ack(3,#io{n}): #io{ack(3, n)}" interpolate println
2  samples/shootout/spectral-norm.io
@@ -29,5 +29,5 @@ SNorm:=Object clone do(
29 29 n repeatTimes(u append(0))
30 30 MAv(n,v,u)
31 31 MAtv(n,u,AtAv)))
32   -n:=args at(1) asNumber
  32 +n:= System args at(1) asNumber
33 33 SNorm App(n) asString(0,9) println
4 tools/io/DocsExtractor.io
@@ -50,8 +50,8 @@ DocsExtractor := Object clone do(
50 50 )
51 51
52 52 de := DocsExtractor clone
53   -de setPath(args at(1))
54   -if(args at(3) == "clean", de clean, de extract)
  53 +de setPath(System args at(1))
  54 +if(System args at(3) == "clean", de clean, de extract)
55 55
56 56
57 57

0 comments on commit 14cae4e

Please sign in to comment.
Something went wrong with that request. Please try again.