3 ms·
What words would you pick? say This function is loosely similar to `print` in the sense it sends a version of its arguments to an output handle (STDOUT by
by raiph 11y ago
What words would you pick?
say
This function is loosely similar to `print` in the sense it sends a version of its arguments to an output handle (STDOUT by default).
But `say` is emphatically casual and human oriented in stark contrast to the formal and computer oriented `print`. For example, `say` uses human friendly gists of its arguments and truncates arguments that are absurdly long. I think `say` fits perfectly.
hyper
Er, yeah. Reasons. Onward:
race
A race delivers the first of several competing concurrent computations to successfully complete (or the last to fail if none succeed). What would be clearer?
start
`start` starts something that will complete later. Again, what word would you pick?
I agree with kbenson about `my` and `our` and note that those were stolen from Perl 5 because they're considered to be spot on.
- ttepasse 11y agoSee my reply to kbenson for my uneasyness with casualness and human orientation of names. :) But following my gut feeling for completeness in bikeshedding: say → Two things irk me, also in other languages. First is the where of writing out. Which is missing here. So I'd always use it as a method of the corresponding handle, here STDOUT. What to name the method? .write would be used for generalized writing (print in Perl6, I think). .writeLine for writing with Newline. And yes, say seem to write a custom representation of the written objects. STDOUT.writeRepresentation would be to long even for me. ;) So .. Stdout.writeRepr(), maybe. .hyper, .race → If I understand .race correctly after some googling (the Perl6 docs seem to be very sparse), it doesn't returns the result of a race, e.g. a winner or an ordering from winner to loser. Instead it transforms an Iterable into a parallel processing pipeline with custom map/filter/... methods which do their work on parallel workers. Iterable::inParallel / Iterable::inOrderedParallel would be my compromise. start → I don't have a Problem with Promise.start but with the corresponding global routine. Start seems so be a too often used concept for different things, most of them custom defined by the user of the language. But I don't know how pervasive usage of promises is in Perl 6, so maybe it is warranted.
- raiph 11y ago`start`ing Promises, `race`ing pipelines, and `say`ing are all frequently used Perl 6 features. So we want nice simple short words for them. I think the ones we've got are well chosen but it's clearly a taste thing. You could always define aliases... :)