1
0
forked from Mirror/wren

Some minor doc cleanups and tweaks.

This commit is contained in:
Bob Nystrom
2015-07-01 08:11:10 -07:00
parent 70cc371379
commit a44e07deba
5 changed files with 11 additions and 10 deletions

View File

@ -111,7 +111,7 @@ Other methods do change the object, and it's helpful to draw attention to that:
Since the parentheses are part of the method's signature, the callsite and Since the parentheses are part of the method's signature, the callsite and
definition have to agree. These don't work: definition have to agree. These don't work:
::: :::dart
"string".count() "string".count()
list.clear list.clear

View File

@ -5,7 +5,7 @@ The IO class can be used to read and write to and from the console.
## Static Methods ## Static Methods
### IO.print(obj[, obj2, obj3...]) ### IO.**print**(objects...)
Prints any number of things to the console and then prints a newline Prints any number of things to the console and then prints a newline
character. If you don't pass it a string, it will be converted to a string for character. If you don't pass it a string, it will be converted to a string for
@ -16,21 +16,21 @@ you. When passed multiple things, Wren outputs one after another.
I like bananas I like bananas
> IO.print("Oranges", 10) > IO.print("Oranges", 10)
Oranges10 Oranges10
> >
### IO.write(obj) ### IO.**write**(object)
Prints a single thing to the console, but does not print a newline character Prints a single thing to the console, but does not print a newline character
afterwards. If you pass it something that isn't a string, it will convert it to afterwards. If you pass it something that isn't a string, it will convert it to
a string. a string.
> IO.write(4+5) > IO.write(4 + 5)
9> 9>
In the above example, the result of `4+5` is printed, and then the prompt is In the above example, the result of `4 + 5` is printed, and then the prompt is
printed on the same line because no newline character was printed afterwards. printed on the same line because no newline character was printed afterwards.
### IO.read(prompt) ### IO.**read**(prompt)
Reads in and returns a line of text from the console. Takes a single string to Reads in and returns a line of text from the console. Takes a single string to
be used as a prompt. Pass an empty string for no prompt. Note that the returned be used as a prompt. Pass an empty string for no prompt. Note that the returned
@ -41,4 +41,4 @@ line of text includes the newline character at the end.
> IO.print("Hello " + name + "!") > IO.print("Hello " + name + "!")
Hello John Hello John
! !
> >

View File

@ -101,6 +101,7 @@ gap:
The `removeAt` method returns the removed item: The `removeAt` method returns the removed item:
:::dart
IO.print(letters.removeAt(1)) // "c" IO.print(letters.removeAt(1)) // "c"
If you want to remove everything from the list, you can clear it: If you want to remove everything from the list, you can clear it:

View File

@ -201,7 +201,7 @@ code {
pre { pre {
margin: 10px 0; margin: 10px 0;
line-height: 18px; line-height: 20px;
padding: 10px; padding: 10px;
// Scroll horizontally if not wide enough. // Scroll horizontally if not wide enough.

View File

@ -50,7 +50,7 @@
<footer> <footer>
<div class="page"> <div class="page">
<div class="main-column"> <div class="main-column">
<p>Wren lives <a href="https://github.com/munificent/wren">on GitHub</a> &mdash; Made with &#x2764; by <a href="http://journal.stuffwithstuff.com/">Bob Nystrom</a>.</p> <p>Wren lives <a href="https://github.com/munificent/wren">on GitHub</a> &mdash; Made with &#x2764; by <a href="http://journal.stuffwithstuff.com/">Bob Nystrom</a> and <a href="https://github.com/munificent/wren/blob/master/AUTHORS">friends</a>.</p>
<div class="main-column"> <div class="main-column">
</div> </div>
</footer> </footer>