From 0a736e1acbcf57ca9f45fa070c69025a0972e395 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Wed, 18 Jun 2025 12:07:32 -0400 Subject: [PATCH 1/2] Fix markdown bullet list in variables-and-scoping.md --- doc/src/manual/variables-and-scoping.md | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/src/manual/variables-and-scoping.md b/doc/src/manual/variables-and-scoping.md index ab0dbdb845d8e..336b52515a36d 100644 --- a/doc/src/manual/variables-and-scoping.md +++ b/doc/src/manual/variables-and-scoping.md @@ -733,21 +733,24 @@ object (such as an array), and that object may still be modified. Additionally w to assign a value to a variable that is declared constant the following scenarios are possible: * Attempting to replace a constant without the const `keyword` is disallowed: -```jldoctest -julia> const x = 1.0 -1.0 -julia> x = 1 -ERROR: invalid assignment to constant x. This redefinition may be permitted using the `const` keyword. -``` + ```jldoctest + julia> const x = 1.0 + 1.0 + + julia> x = 1 + ERROR: invalid assignment to constant x. This redefinition may be permitted using the `const` keyword. + ``` + * All other defefinitions of constants are permitted, but may cause significant re-compilation: -```jldoctest -julia> const y = 1.0 -1.0 -julia> const y = 2.0 -2.0 -``` + ```jldoctest + julia> const y = 1.0 + 1.0 + + julia> const y = 2.0 + 2.0 + ``` !!! compat "Julia 1.12" Prior to julia 1.12, redefinition of constants was poorly supported. It was restricted to From 37151c0fd5d5357dcb8b1ea9ee735f70a2b4676a Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Wed, 18 Jun 2025 13:22:26 -0400 Subject: [PATCH 2/2] Fix typo in variables-and-scoping.md --- doc/src/manual/variables-and-scoping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/manual/variables-and-scoping.md b/doc/src/manual/variables-and-scoping.md index 336b52515a36d..0a9180ecd9479 100644 --- a/doc/src/manual/variables-and-scoping.md +++ b/doc/src/manual/variables-and-scoping.md @@ -742,7 +742,7 @@ to assign a value to a variable that is declared constant the following scenario ERROR: invalid assignment to constant x. This redefinition may be permitted using the `const` keyword. ``` -* All other defefinitions of constants are permitted, but may cause significant re-compilation: +* All other definitions of constants are permitted, but may cause significant re-compilation: ```jldoctest julia> const y = 1.0