On Wed, Oct 23, 2019 at 06:01:06PM +0100, Rhodri James wrote:
%w[red green blue]
says that this is something, good luck figuring out what.
You don't need *luck* to figure out what it does, you need five seconds in the REPL.
One of the most annoying tendencies on this mailing list is for people who dislike a feature to play dumb.
If you could learn that [...] means a list display or a list comp depending on the contents, you can learn this. As I said before, I'm not wedded to this particular syntax, but its an obvious mnemonic:
w is for *words*
[ ] are *list delimiters*
Put them together and you get a list of words.
Wherever possible, we should let the interpreter or compiler do the repetitive stuff.
I prefer to let my editor do the work, actually.
and then write a quick editor macro to add the quotes and comma
Great. And how about those who cannot just "write a quick editor macro" which works perfectly first time?
If writing out a list of words in Python source code is so painful that you prefer to write a macro, that's a fantastic argument in favour of this new syntax!