Closed human154 closed 1 year ago
@rtfeldman is this related to the work on https://github.com/roc-lang/roc/pull/4947 ?
This may have been me when I converted to markdown. I liked the spaces to be honest. But I can see that it isn't consistent and note that the formatter currently removes the spaces. So I have updated the tutorial (I hope I got all of them) at #5008.
My understanding of the "proper" syntax here is based on what Richard Feldman wrote on Zulip:
"in Roc today:
always, what comes before = is a pattern always, an identifier followed by a : is a record field declaration always, an identifier followed by a blank space and then a : is a type declaration "
(the last two lines of that quote being relevant here.)
Yeah, it's correct that these should be changed, as this is the way roc format
will format them - happy to accept a PR for them!
Oh, I see Luke's PR already did it - nice! 😄
Yes and now I also have a pull request for more: #5042
The tutorial (as it appears at https://www.roc-lang.org/tutorial ) shows spaces before colons in multiple places, including in the following:
returnFoo { foo : "hi!", bar : "blah" }
also:
{ x, y } = { x : 5, y : 10 }
also:
... and multiple code snippets after that. (Perhaps this is an auto-formatting glitch?).