Skip to content

Commit

Permalink
Small editorial updates for const blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 8, 2024
1 parent 01c8196 commit efdc9b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/expressions/block-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ loop {
> _ConstBlockExpression_ :\
>    `const` _BlockExpression_
A *const block* is a variant of a block expression which evaluates in the compile time instead of in the run time.
A *const block* is a variant of a block expression which evaluates at compile-time instead of at runtime.

Const blocks allows you to define a constant value without having to define new [constant items], and thus they are also sometimes referred as *inline consts*.
It also supports type inference so there is no need to specify the type, unlike [constant items].

Const blocks have ability to reference generic parameters in scope, unlike [free][free item] constant items.
Const blocks have the ability to reference generic parameters in scope, unlike [free][free item] constant items.
They are desugared to associated constant items with generic parameters in scope.
For example, this code:

Expand Down

0 comments on commit efdc9b6

Please sign in to comment.