Talk:Named parameters: Difference between revisions

 
(3 intermediate revisions by 3 users not shown)
Line 16:
==REXX examples==
Do the REXX examples actually complete the task? Is it idiomatic REXX? do the docs for "normal" function calls in the language mention any of those solutions? Might it be better to just omit REXX? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:26, 2 July 2014 (UTC)
 
: Yes, the REXX examples actually complete the task, although ''named parameters'' aren't normally used in REXX as it's a somewhat bulky method to do in the manner specified.   Most often, because of the manner the (original) host (operating system) passes arguments (parameters) to a REXX program, lends itself to specifying options (parameters) followed by a value (with no intervening equal sign, and the order of the arguments isn't important. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:59, 2 July 2014 (UTC)
 
: Yes, it is idiomatic REXX.   (That begs a question, must every solution have to idiomatic?)   REXX is a minimalistic language and many techniques aren't necessarily documented as solutions.   Being so minimalistic, there are often numerous ways to skin a cat (as the various language versions attest to).   Named parameters is a specific method of passing parameters in REXX (but hardly used as the manner of this Rosetta Code task).   Of what I've observed of the many REXX publications (from different vendors/authors), it isn't in the nature to mention specific types of solutions in function calling (invocation).   However, there are some excellent publications on various techniques in using the REXX language to address all manners of problems. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:59, 2 July 2014 (UTC)
 
: No, the REXX documentation(s) for function calls don't give solutions;   the various docs (that I've seen) for REXX show the syntactical format of functions (the built-in ones) and their various arguments, what the functions do, which arguments are optional (and can be omitted), and if any of the arguments have a default value.   Note that some BIF functions in REXX perform different things based on the number of arguments, or most often, specific options;   this is in its philosophy of a minimalistic language.   It isn't the nature of the REXX manuals that I've read to give solutions in how to use any particular function (BIF or user written), but to explain the language (syntax) of the (BIF) function and its arguments.   Also, I don't know what "normal" function calls are in this context, unless you mean BIFs instead of user written functions.   I wouldn't know what an abnormal function call would look like.   There are only two ways to call a function, explicitly via a '''call''' verb, or as a function.   Well, there is a third way, to perform/invoke/execute the function as if it was a "system/user command", and have the host (operating system) invoke the function/program as if it was a regular program (that returns a value, like a function).   I hope we won't be tripping up on the definition of routine versus a function, at least as far a REXX is concerned). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:59, 2 July 2014 (UTC)
 
: I don't see why it would be better to (just) omit REXX, especially as there are two solutions posted.   I thought the whole point of Rosetta Code is to show how other languages solve a particular task, even if the solutions may not be understood, idiomatic, or look pretty. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:59, 2 July 2014 (UTC)
 
::Hi Gerard. Thanks for taking the time to give me your answers. I asked because I was unsure if most REXX users seeing the solutions would consider them "too far from the mainstream" to consider using. Your explanation of the kind of documentation, and what programmers might routinely have to consider when reading/writing REXX have put put me straight on that. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:31, 3 July 2014 (UTC)
 
== Algol68 ==
 
The example does not compile on Algol 68 Genie 2.8:
<pre>
a68g Named_parameters.a68
28 print pet(())
1
a68g: error: 1: this vacuum cannot have row elements (use a REF [] UNION (OWNER, OPTBREED, OPTSPECIES,
OPTNAME) generator) (detected in collateral-clause starting at "(" in this line).
</pre>
But it works if the offending line is removed.
I cannot decide if this is a feature of algol 68 or a bug of the compiler.
 
: Curious. It looks like a bug in the compiler to me, not least because other changes I made to the source to see what may be going on also gave unexpected results. I'll contact Marcel.
 
: BTW, it doesn't "work" if the line is removed because although it compiles and runs, it doesn't print the defaults.
: --[[User:Brnikat|Brnikat]] ([[User talk:Brnikat|talk]]) 08:58, 11 August 2015 (UTC)
Anonymous user