diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-02-13 22:13:23 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-02-14 13:29:16 -0800 |
commit | 37f822eb66dc18a2b3bfdaa672081b6f08ef5688 (patch) | |
tree | dc29d030f6d3dc6710d459ede604cbcff2e31c6f /src/compiler/scala/tools/nsc/ScriptRunner.scala | |
parent | d4f5abf9002fd617e871d1f20fdcf531b38b26e1 (diff) | |
download | scala-37f822eb66dc18a2b3bfdaa672081b6f08ef5688.tar.gz scala-37f822eb66dc18a2b3bfdaa672081b6f08ef5688.tar.bz2 scala-37f822eb66dc18a2b3bfdaa672081b6f08ef5688.zip |
SI-7711 Do not emit extra argv in script body
Take away `argv` and make `args` the standard parameter name.
This is a quick fix to avoid "unused local" lint error. All
the examples use `args`; in particular, "Step 4. Write some
Scala scripts" in "Programming in Scala" uses `args`.
I see the footnote there is also where Odersky concatenation is
specified, `"Hello, "+ args(0) +"!"` with no space next to the
literals.
Also removes `argv` from `StdNames`. Was torn whether just to
add `argc`. Maybe start a new project to house Names, emeritus.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ScriptRunner.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ScriptRunner.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala index d553d71bf5..c2d62db558 100644 --- a/src/compiler/scala/tools/nsc/ScriptRunner.scala +++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala @@ -19,7 +19,7 @@ import util.Exceptional.unwrap * exec scala "$0" "$@" * !# * Console.println("Hello, world!") - * argv.toList foreach Console.println + * args.toList foreach Console.println * </pre> * <p>And here is a batch file example on Windows XP:</p> * <pre> @@ -29,7 +29,7 @@ import util.Exceptional.unwrap * goto :eof * ::!# * Console.println("Hello, world!") - * argv.toList foreach Console.println + * args.toList foreach Console.println * </pre> * * @author Lex Spoon |