-
-
Notifications
You must be signed in to change notification settings - Fork 36
Functions: is ':' a sigil (no spaces after), or operator (spaces allowed) #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@markusicu wrote in #230 (comment):
|
Comments migrated from the slidesSlides comment, Mihai Nita (@mihnita), 11:56 AM Apr 21 Space between : and the function name seems arbitrary and inconsistent. Why Slides comment, Eemeli Aro (@eemeli), 12:35 PM Apr 21 Because in practically all prior art, Slides comment, Mihai Nita (@mihnita), 11:10 AM Apr 23 I don't know what prior art you have in mind. Maybe css? If Which has other implications. Might seem minor. But null handling is often called "The Billion Dollar Mistake" for a reason. And a big debate in many languages & libraries. Slides comment, Mihai Nita (@mihnita), 1:34 PM Apr 23 Here is prior art where the space (or lack of space) does matter: https://www.w3schools.com/python/trypython.asp?filename=demo_ref_string_format Try
Slides comment, Markus Scherer (@markusicu), 9:05 AM Apr 25 Be mostly strict about WS -- mostly forbidden or required, not optional. |
Comments migrated from the slides$foo: number minFractionDigits=2 Slides comment, Elango Cheran (@echeran), 11:30 AM Apr 21 The syntax here feels confusingly inconsistent. At the least, make the function invocations consistent. If you want colons for that, or Slides comment, Stanisław Małolepszy (@stasm), 10:50 PM Apr 21 The intent was to make the colon an operator rather than a sigil; in the examples it means "call this function". I suggested attaching it to $foo because it made it look like a typing annotation, which I think is a nice way to think about formatting functions. But it sounds like it created some confusion. Do you think it would be clearer if the coding style was $foo:number, without any whitespace? Slides comment, Elango Cheran (@echeran), 8:30 AM Apr 22 The colon is overloaded for 2 distinct purposes, but also in visually similar locations. I think removing whitespace in one case would only address the visual similarity, at the cost of reducing the visual consistency / readability of function invocations. One option that I was suggesting above to keep it simpler and more consistent by just using the colon (or I'm not particular about colon or @ or other character, but I think here more consistency / simplicity lends itself to readability, and vice versa about the inconsistency. |
The majority of the feedback on #230 was that the idea of the |
Another question is whether the colon (
A reason against using the colon might come from #238. One of the potential solutions could be to introduce a namespacing mechanism for UI/markup elements. It would be nice to be able to follow XML's convention of reserving names with colons for that purpose. |
Change the colon from being an operator which calls functions to a sigil that prefixes function names. Closes unicode-org#242.
I don't feel strongly about I do feel strongly that there should be no space between this prefix and the function name. Don't freely allow spaces everywhere. Make the function and its prefix look like a unit. (Looks like @stasm's commit did that.) Also: https://en.wikipedia.org/wiki/Sigil --> I suggest using the term "prefix" instead :-) |
Change the colon from being an operator which calls functions to a sigil that prefixes function names. Closes unicode-org#242.
Prefix function names with the colon. Change the colon from being an operator which calls functions to a sigil that prefixes function names. Closes #242.
Prefix function names with the colon. Change the colon from being an operator which calls functions to a sigil that prefixes function names. Closes #242.
No description provided.
The text was updated successfully, but these errors were encountered: