Liste des Groupes | Revenir à cl c |
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:On 01.03.2025 23:20, Lawrence D'Oliveiro wrote:>On Sat, 1 Mar 2025 21:32:59 +0100, Janis Papanagnou wrote:>My guess is that this form is just an informal syntax mimicking Perl's>
function parameter passing ...
The idea of passing arguments by keyword predates Perl.
That wouldn't surprise me. - I know it from Perl. - Which other
(earlier) languages do you have in mind? - What's its origin?
For example, it exists in Ada since 1983. [...]
>
The syntax is IMHO much nicer than using /*...*/ comments in C.
[...]
>
Perl doesn't have keyword arguments as a language feature, but it can be
mimicked by passing hash or hash reference.
>
If I wanted to annotate arguments with parameter names, I'd probably use
aligned // comments with the name at the end of the line:
>
confection = prepare_carefully_according_to_detailed_recipe(
flat, // pan
clarified_butter, // line_with
something_yummy, // filling
lotsa_pastry, // cover_with
90 * MINUTES // bake_for
);
>
In practice, I seldom do so unless there's direct language support.
Les messages affichés proviennent d'usenet.