Code - Expansion

> Code - (Programming|Computer) Language > Code - (Engine|Runtime)

1 - About

Expansion is just a transformation (replacement, …) applied to a syntax.

An expansion is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure.

The mapping process that transforms the input as into the output is known as expansion.

This is often used in template.

Advertising

3 - Example

3.1 - Expansion of the environment variable

With the following USER environment variable

export USER=Nico
  • The below env file
.env
USER=$USER
  • would become at runtime
.env
USER=Nico