Talk:Parameter (computer science)
From Wikipedia, the free encyclopedia
Contents |
[edit] Error
Parameter and argument are considered as same in this article. It's wrong and sloppy. Arguments are values binded to the parameters. For example in function definition define max(a,b) : if a < b then b else a;
has two parameters, a and b. When we make a function call max(1,2), the numbers 1 and 2 are function arguments. This is common use of these terms in computer sciense/engineering. Somehow wikipedia has mixed these two together. Please correct this.
- I made quite a lot of changes to address this. Should be clear now. --Alan 23:18, 18 January 2006 (UTC)
-
- Looks good, though there was a bit of confusion reintroduced regarding call-by-name/call-by-value (which are actually orthogonal to calling conventions -- an evaluation strategy for parameter passing is a property of the language, whereas a calling convention is a property of a particular compiler, platform, and/or build). --bmills 02:40, 19 January 2006 (UTC)
[edit] call-by
What is the difference between call-by-result and call-by-copy-restore? They seem to be defined identically. Derrick Coetzee 20:53, 6 Oct 2004 (UTC)
call-by-result is call-by-copy-restore with an uninitialzed variable. There are some factual errors in the "calling conventions" section of this article, which will hopefully be corrected in the migration to evaluation strategy. --bmills 21:09, 23 October 2005 (UTC)
[edit] Cleanup
This article is not very encyclopedic. It would be great for a programming tutorial, but not for an encyclopedia. – flamurai (t) 02:52, Feb 12, 2005 (UTC)
- I'm working on a cleanup and rewrite this week. I'm going to move a cleaned-up version of the "calling conventions" (which are really evaluation strategies) into a forthcoming article I've stubbed (evaluation strategy); I think the rest of the article is pretty much redundant with subroutine (which is much larger and therefore likely to be better maintained), so I'm going to recommend that the rest of the article be dropped and redirected to subroutine. --bmills 07:10, 23 October 2005 (UTC)
I rewrote the article somewhat. I removed the {{mergeto}} notice based on the number of individual articles that could be considered sub-articles of this, or that could be merged into this. They include function argument (I just merged it to here), default argument, and named parameter. There are also four foreign-language pages for this specific article. I also moved the overloading section to subroutine, as, IMHO, it doesn't have anything to do with specific arguments per-se, as in strongly-typed languages, it's implemented by creating a second copy of the subroutine. --Interiot 21:29, 10 November 2005 (UTC)
- Looks like a positive change — the article as now phrased is surprisingly not redundant with subroutine, and the level of quality is much higher! --bmills 19:54, 12 November 2005 (UTC)
It might be worth pointing out that in some languages (C++ at least), in formal usage, there's a distinction between the meaning of 'argument' and 'parameter', as per [1]. --samdutton 08:30, 21 December 2005 (UTC)
- These are covered somewhat at Parameter#Computer_science in case anyone wants to incorporate some of that text here. I don't quite grok the distinction myself though. Is it just like the difference between a function prototype, and instances of calling a function? Or is there more to it than that?
- Also, regarding things like Macro#Macro_languages... it would be nice if someone who is an expert in functional languages could expand the article to include some of the formal concepts from functional programming. --Interiot 18:22, 21 December 2005 (UTC)
[edit] In Parameters and Out Parameters.
What do you mean by in parameter and out parameter? Does in parameter means call by value and out parameter means call by reference? This is respect to C programming language. (TC).