Skip to content

docs: clarify ternary argument evaluation - #502

Open
ViktorBystrov72 wants to merge 1 commit into
Masterminds:masterfrom
ViktorBystrov72:docs/ternary-evaluation
Open

ViktorBystrov72 wants to merge 1 commit into
Masterminds:masterfrom
ViktorBystrov72:docs/ternary-evaluation

Conversation

@ViktorBystrov72

Copy link
Copy Markdown

Clarify that ternary evaluates both candidate values before selecting one, and show an if/else guard for indexing a list. Remove the comparison to C's conditional operator.

Refs #271. Documentation only.

Validation:

  • Reproduced the original index error and executed the documented guard with nil, empty, one-, two-, and three-element lists.
  • go test . -run '^TestTernary$' -count=1
  • Verified that Liquid 4.0.4 preserves the example verbatim with the raw block; the unprotected control produces a Liquid syntax error.
  • git diff --check

Signed-off-by: Виктор Быстров <anatema@bk.ru>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant