Skip to content

Commit

Permalink
converted julia-repl to jldoctest in variables.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xyz-harshal committed Jan 8, 2025
1 parent b58dcc5 commit e7f86f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/src/manual/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A variable, in Julia, is a name associated (or bound) to a value. It's useful when you want to
store a value (that you obtained after some math, for example) for later use. For example:

```julia-repl
```jldoctest
# Assign the value 10 to the variable x
julia> x = 10
10
Expand Down Expand Up @@ -119,7 +119,7 @@ it from `+ ᵃx` where `ᵃx` is the variable name.

A particular class of variable names is one that contains only underscores. These identifiers are write-only. I.e. they can only be assigned values, which are immediately discarded, and their values cannot be used in any way.

```julia-repl
```jldoctest
julia> x, ___ = size([2 2; 1 1])
(2, 2)
Expand All @@ -132,7 +132,7 @@ ERROR: syntax: all-underscore identifiers are write-only and their values cannot

The only explicitly disallowed names for variables are the names of the built-in [Keywords](@ref Keywords):

```julia-repl
```jldoctest
julia> else = false
ERROR: syntax: unexpected "else"
Expand Down

0 comments on commit e7f86f8

Please sign in to comment.