You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### [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)
Copy file name to clipboardExpand all lines: docs/New Features/Named Varargs.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ function vfunc(...)
10
10
print(arg)
11
11
end
12
12
end
13
-
vfunc("Hello") -- "Hello"
13
+
vfunc("Hello") --> Hello
14
14
```
15
15
16
16
But, with named varargs, it can be as simple as this:
@@ -21,7 +21,7 @@ function vfunc(...args)
21
21
print(arg)
22
22
end
23
23
end
24
-
vfunc("Hello") -- "Hello"
24
+
vfunc("Hello") --> Hello
25
25
```
26
26
27
27
#### [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)
Copy file name to clipboardExpand all lines: docs/New Features/String Interpolation.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ String interpolation is a simple alternative syntax to concatenation.
6
6
```pluto title="Concatenation"
7
7
local label = "meaning of life"
8
8
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
10
10
```
11
11
12
12
```pluto title="String Interpolation"
13
13
local label = "meaning of life"
14
14
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
16
16
```
17
17
#### [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)
0 commit comments