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

Comments

    No one has commented yet.