File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -974,9 +974,19 @@ kw"..."
974
974
;
975
975
976
976
`;` has a similar role in Julia as in many C-like languages, and is used to delimit the
977
- end of the previous statement. `;` is not necessary after new lines, but can be used to
977
+ end of the previous statement.
978
+
979
+ `;` is not necessary at the end of a line, but can be used to
978
980
separate statements on a single line or to join statements into a single expression.
979
- `;` is also used to suppress output printing in the REPL and similar interfaces.
981
+
982
+ Adding `;` at the end of a line in the REPL will suppress printing the result of that expression.
983
+
984
+ In function declarations, and optionally in calls, `;` separates regular arguments from keywords.
985
+
986
+ While constructing arrays, if the arguments inside the square brackets are separated by `;`
987
+ then their contents are vertically concatenated together.
988
+
989
+ In the standard REPL, typing `;` on an empty line will switch to shell mode.
980
990
981
991
# Examples
982
992
```julia
@@ -993,6 +1003,19 @@ julia> foo();
993
1003
994
1004
julia> bar()
995
1005
"Hello, Mars!"
1006
+
1007
+ julia> function plot(x, y; style="solid", width=1, color="black")
1008
+ ###
1009
+ end
1010
+
1011
+ julia> [1 2; 3 4]
1012
+ 2×2 Matrix{Int64}:
1013
+ 1 2
1014
+ 3 4
1015
+
1016
+ julia> ; # upon typing ;, the prompt changes (in place) to: shell>
1017
+ shell> echo hello
1018
+ hello
996
1019
```
997
1020
"""
998
1021
kw " ;"
You can’t perform that action at this time.
0 commit comments