cue-lang / docs-and-content

A place to discuss, plan, and track documentation on cuelang.org
5 stars 1 forks source link

tour: scope section could mention aliases and/or "shadowing" #50

Open jpluscplusm opened 7 months ago

jpluscplusm commented 7 months ago

From a Slack thread where the root cause of a problem was foo: foo scope shadowing:

I first went looking through the tutorials section on the old site (now tour, I think). It made me think that some kind of callout [ to aliases or https://alpha.cuelang.org/docs/concept/alias-and-reference-scopes/ ] may be useful at https://alpha.cuelang.org/docs/tour/references/scopes/ - as a "hey, there is a way to force matching to top-level"

Later in the same thread, a different user says:

In the regards of docs about alias & scope, It would be helpful to see somewhere the word "shadow" or "shadowing", because this is exactly what is happening. The twirk with a: a where the rhs a may be misleading is a consequence that the toplevel a was shadowed by the inner one