Skip to content

Commit 940b0f6

Browse files
committed
Clarify some comments that specify output
1 parent 4fcc06c commit 940b0f6

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

docs/New Features/Default Arguments.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ local function write(text = "No text provided.")
77
print(text)
88
end
99
10-
write() --> "No text provided."
11-
write("Hello!") --> "Hello!"
10+
write() --> No text provided.
11+
write("Hello!") --> Hello!
1212
```
1313
```pluto showLineNumbers title="This code behaves identically."
1414
local function write(text)
@@ -18,8 +18,8 @@ local function write(text)
1818
print(text)
1919
end
2020
21-
write() --> "No text provided."
22-
write("Hello!") --> "Hello!"
21+
write() --> No text provided.
22+
write("Hello!") --> Hello!
2323
```
2424

2525
#### [Try It Yourself](https://pluto-lang.org/web/#code=local%20function%20write(text%20%3D%20%22No%20text%20provided.%22)%0D%0A%20%20%20%20print(text)%0D%0Aend%0D%0A%0D%0Awrite()%20%20%20%20%20%20%20%20%20--%3E%20%22No%20text%20provided.%22%0D%0Awrite(%22Hello!%22)%20--%3E%20%22Hello!%22)

docs/New Features/For-As Loop.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ for t as value do
88
print(value)
99
end
1010
11-
-- 1
12-
-- 2
13-
-- 3
14-
-- hello
15-
-- world
11+
--> 1
12+
--> 2
13+
--> 3
14+
--> hello
15+
--> world
1616
```
1717
That code is identical to this:
1818
```pluto showLineNumbers title="Old Code"

docs/New Features/Named Varargs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function vfunc(...)
1010
print(arg)
1111
end
1212
end
13-
vfunc("Hello") -- "Hello"
13+
vfunc("Hello") --> Hello
1414
```
1515

1616
But, with named varargs, it can be as simple as this:
@@ -21,7 +21,7 @@ function vfunc(...args)
2121
print(arg)
2222
end
2323
end
24-
vfunc("Hello") -- "Hello"
24+
vfunc("Hello") --> Hello
2525
```
2626

2727
#### [Try It Yourself](https://pluto-lang.org/web/#code=function%20vfunc(...args)%0D%0A%20%20%20%20for%20args%20as%20arg%20do%0D%0A%20%20%20%20%20%20%20%20print(arg)%0D%0A%20%20%20%20end%0D%0Aend%0D%0Avfunc(%22Hello%22)%20--%20%22Hello%22)

docs/New Features/String Interpolation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ String interpolation is a simple alternative syntax to concatenation.
66
```pluto title="Concatenation"
77
local label = "meaning of life"
88
local data = { value = 42 }
9-
print("The " .. label .. " is " .. data.value) -- "The meaning of life is 42"
9+
print("The " .. label .. " is " .. data.value) --> The meaning of life is 42
1010
```
1111

1212
```pluto title="String Interpolation"
1313
local label = "meaning of life"
1414
local data = { value = 42 }
15-
print($"The {label} is {data.value}") -- "The meaning of life is 42"
15+
print($"The {label} is {data.value}") --> The meaning of life is 42
1616
```
1717
#### [Try It Yourself](https://pluto-lang.org/web/#code=local%20label%20%3D%20%22meaning%20of%20life%22%0D%0Alocal%20data%20%3D%20%7B%20value%20%3D%2042%20%7D%0D%0Aprint(%24%22The%20%7Blabel%7D%20is%20%7Bdata.value%7D%22)%20--%20%22The%20meaning%20of%20life%20is%2042%22)
1818

0 commit comments

Comments
 (0)