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
Document behavior of %(), @(), $() #2113
Comments
|
The problem I see here is that there seems to be no safe way to declare an empty hash. I'll revise that issue for clarification, but it looks hard... |
|
OK, I see. The safe way is using {} |
|
I think |
|
Maybe not a trap, but a document with all that, maybe as part of
language/variables.
|
|
Kind of a side issue - can we not call {} chars brackets - at least curly brackets or, better yet, braces |
|
Please note my latest StackOverflow attempt at formulating the precise {} hash vs block DWIM rule. I'm going on a trip for a week, but if everyone is happy with it I will be happy to integrate it into the doc a couple weeks from now. Imo the right way forward for the docs is to show respect for Larry's DWIM. This is consistent with jnthn's perspective and the majority of existing community usage and, I think, preferences, though I acknowledge some strong opinions against it. (I return to this aspect at the end of this comment.) Perhaps the WAT side of this DWIM belongs on the traps page but I'm unsure. Please read the latest version of my Reddit discussion of this DWIM/WAT that complements my SO answer. Imo the right way forward for the docs contributor style guide is to recommend use of the DWIM in all cases except where documenting the
Imo this should be "Prefer the {} form of declaring hashes".
Imo this is inappropriately "disrespectful" to Larry's DWIM. (I get that the "disrespect" isn't emotive but just trying to be clear.)
Idiom is natural to a native speaker. I'd argue that's much more {} than %().
As we know, it unfortunately introduces confusion with %() which won't go away for a few years. See also my discussion of strange consistency with hash subscripts and ugliness in pair literals in my reddit comment linked above.
Switching guidance to be use of the DWIM will eliminate this exception. I understand that samcv and alex and others got burned over this dwim. I think that was down to poor doc. Perhaps my poor original SO answer didn't help. (Hopefully it's not so bad now.) I understand that what I'm saying almost certainly won't resonate for them. Getting burned a few times before the right mental model clicks leaves a lasting impression, especially if the right mental model still hasn't clicked. But I'm hopeful that Larry's view (which is that the DWIM made sense), and the majority newbie view (which is that the DWIM is fine if no one tells them about it but rather just exposes them to it), and the view of some old hands (jnthn finds the DWIM simple and natural, as do many others including me), and the evident widespread use of this DWIM, and the prospect that improved doc and community understanding will be in place, are persuasive that disrespecting Larry's DWIM isn't the way to go but rather embracing it, at least for now, until we perhaps revisit this in another few years once |
|
Sorry, what is WAT?
|
|
El sáb., 23 jun. 2018 a las 11:00, raiph (<notifications@github.com>)
escribió:
Please note my latest attempt at formulating the {} hash vs block DWIM
rule <https://stackoverflow.com/a/44102980/1077672>.
I'm going on a trip for a week, but if everyone is happy with it I will be
happy to integrate it into the doc a couple weeks from now.
if you want, we can assign it to you. I mostly agree with everything you
say.
|
|
@JJ A WAT is what you get for every DWIM. http://knowyourmeme.com/memes/wat |
|
#2632 related |
See rakudo/rakudo#1946 for a detailed description.
Currently we say:
Except that
%()is not an empty hash :)EDIT: hash, of course
The text was updated successfully, but these errors were encountered: