[CLI] Is the $-joined path shown for variables inside imported modules intended? #26
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram#26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version:
@gram-lang/cli1.2.1 (current npmlatest), on macOS.Summary
When a recipe imports a module, any intermediate variable referenced inside that module renders as a
$-joined path rather than its name. The depth of the import chain determines how many segments appear.I could not find anything in the reference describing how these should display, so this may well be deliberate disambiguation rather than a defect — flagging it as a question. What made me doubt is that
$is not a documented syntax character anywhere, which made it read like an internal identifier surfacing in human-facing output.Reproduction
Three files in one project.
a.gram:b.gram:c.gram:gram checkreports all three valid.gram view c.gram --skip-db --no-pagerrenders:Actual vs expected
tofu$marinated$pressedpressedtofu$marinatedmarinatedtofutofu— correctOnly the reference written in the importing file renders correctly. Every reference that lives inside an imported module shows its path.
Note
Everything else about module composition works well:
gram checkpasses, the retro-planning offset on the@usepropagates into the recipe total, and the shopping list consolidates ingredients shared across modules correctly — an ingredient used once in each of two modules aggregates into a single line with the summed quantity, as documented. It is only the rendered label, which — going by the pipeline in CONTRIBUTING — suggestspackages/rendererrather thanpackages/modules, since resolution itself clearly works.Drafted with AI assistance, verified by hand: every reproduction above was run locally against 1.2.1 and its output pasted verbatim.
Again, thanks for your report, and no, that wasn't intended. The $ path is an internal name we use to keep modules from clashing, and it shouldn't have shown up in the output. It's fixed in #39, so labels now show the name you wrote (pressed, marinated). It'll ship in the next release.