Feature #7599
Newline should behave as comma for record separator
| Status: | Rejected | Start date: | 05/20/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | - | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | puppetcamp-eu-2011 | |||
| Votes: | -5 |
Description
This (or something very like it) should work:
file { foo:
ensure => present
mode => 0644
}
Note the lack of commas after key/value pairs.
—
This ticket is a request for comment, coming out of a discussion at Puppet Camp EU, 2011. No promises whatever about implementation, but there were enough people interested to open a public discussion.
History
Updated by Daniel Pittman about 1 year ago
This seems like the modern fad of optimizing for the wrong thing to me: skipping the comma, or semi-colon, where we can guess what was meant makes our parser more complex, in return for very little saving. Is there some deeper value to this that I am missing, other than the ability to skip the comma in one of the forms of the list? …or is this a mechanism to sneak in Python-like whitespace sensitivity into the language?
That said, it isn’t like we have a super-complex syntax. Someone could try this out by writing a preprocessor for Puppet that added those syntax elements where they were inferred; this could run from a prerun command in the master configuration and update the live directory appropriately during normal operation. No changes on our part would be specifically required.
Updated by Felix Frank 12 months ago
Agreed.
Puppet (not exactly aiming at developers) can be difficult to grasp for programming novices. Allowing the omission of commas can (in my opinion) make manifests even more incomprehensible to the untrained eye.
Updated by James Turnbull 12 months ago
- Status changed from Unreviewed to Needs Decision
- Assignee set to Nigel Kersten
Updated by Thomas Bellman 11 months ago
Negative vote from me as well.
Some languages (like e.g. Python, Bourne Shell or .ini files) do have newlines being significant, and that works fine. The difference is that those languages have that as a well-defined, integrated part of their syntax, not as a kind of DWIM bolted onto the side. A simple, regular syntax with no or few ad-hoc special-cases makes reading and writing the language easier.
Updated by Nigel Kersten 11 months ago
- Assignee changed from Nigel Kersten to Randall Hansen
This was filed as it was part of the feedback on improving the DSL at Puppet Camp EU.
I’m not in favor of it either for what it’s worth.
My vote is to reject this request, passing to Randall to make any counter arguments.
Updated by Nigel Kersten 8 months ago
Randall, I’m still strongly on the side of rejecting this.
Updated by Werner Bahlke 4 months ago
- Status changed from Needs Decision to Rejected
After getting James’s approval, this is rejected.