Skip to content

Add new tag to declare variable without value#613

Merged
GuillaumeGomez merged 3 commits intoaskama-rs:mainfrom
GuillaumeGomez:create
Dec 13, 2025
Merged

Add new tag to declare variable without value#613
GuillaumeGomez merged 3 commits intoaskama-rs:mainfrom
GuillaumeGomez:create

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

First step toward #511.

The name of the tag is very much up-to-debate. declare would be a good alternative for example.

cc @Kijewski @seijikun

@GuillaumeGomez GuillaumeGomez force-pushed the create branch 3 times, most recently from cf800cf to d41c6a9 Compare October 31, 2025 14:10
@seijikun
Copy link
Copy Markdown
Contributor

I would prefer one of declare, def or decl, because create very much sounds like running a ctor - so essentially, the exact opposite of what the syntax achieves.
Other than that: LGTM!
IMHO the best way forward.

@GuillaumeGomez GuillaumeGomez mentioned this pull request Nov 1, 2025
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator Author

I updated to use decl/declare keyword. Since it's a keyword that doesn't exist in jinja, we can always pick another keyword later on (cc @Kijewski). Added the warning for let with empty values and it will allow us to have let blocks after the next release.

@GuillaumeGomez GuillaumeGomez merged commit cff0acc into askama-rs:main Dec 13, 2025
51 checks passed
@GuillaumeGomez GuillaumeGomez deleted the create branch December 13, 2025 21:17
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.

2 participants