Talk:Variable

message: I merged the two versions of the Computer Science section. Hopefully I have included everything and not offended anybody. The Rod 00:31, 28 December 2005 (UTC)
thread_title:  Merge Computer Science split 

message: Class variable redirects here, but the article never defines what it means.  Someone feel up to integrating a description? Night Gyr 18:47, 2 March 2006 (UTC)
thread_title:  [[Class variable]] 

message: The first part of the article is clear in its adoption of a syntactic perspective on variables: 
"a variable is a _symbol_ denoting a quantity..."
The first reference to Computer Science is also consistent with the syntactic view
"in computer science, it _represents_ a place where a quantity can be stored" 
However, in the section "Computer programming", the perspective changes and variables becomes things which are denoted rather than denotations:
"a variable can be thought of as a place to store a value"
so, a variable _represented_ a place and now it _is_ a place. The shift in perspective continues with:
"More precisely, a variable binds (associates) a name (sometimes called an identifier) with the location; a value in turn is stored as a data object in that location so that the object can be accessed later via the variable, much like referring to someone by name"
to have a name, a variable must be in the semantics not the syntax.
So where do variables belong? to the syntax or to the semantics?
Both perspective are possible and defendable, but a single one should be consistently adopted to avoid confusion.
Thanks for the otherwise clear contribution.
fabio
(fabio.simeoni@cis.strath.ac.uk) —The preceding unsigned comment was added by 80.41.247.128 (talk • contribs)  2006-03-08 09:56:18  (UTC)
:Most programming languages do not expose the construct which clears up this confusion. That construct is the symbol. The only languages I know of which expose symbols are Lisp dialects (including Scheme) and to a lesser extent Python (in which symbols can be accessed as hash entries).
:Most languages have the idea of a "symbol table", or a lookup table mapping variable names to locations in memory. In Lisp, program code can directly manipulate entries in its own symbol table. For instance, there is a symbol named PRINT. That symbol is a data structure, that contains (among other things) a pointer to a piece of code: a function that knows how to print things. The string "PRINT" is the symbol-name of the symbol; and the printing function itself is the symbol's symbol-function. The symbol serves as a mapping from one to the other.
:In Lisp, you can refer to the symbol itself, by using the quote operator: <TT>'PRINT</TT> evaluates to the symbol itself, not to the printing function. This is analogous to the notion of quotation in real-world languages: a cow is a beast with four legs that eats grass; but the word "cow" has three letters and is in English. When you evaluate the word "cow", you ask, "What does the word "cow" mean?" and the answer is the beast with four legs that eats grass. Likewise in Lisp, if you execute <TT>(SYMBOL-FUNCTION 'PRINT)</TT> you will get a piece of notation representing the printing-function itself.
:In Python, if you define a global variable named "cow", and then look in the hash table returned by the globals() function, you will see an entry where the string "cow" is mapped to the value of that variable. That's the same sort of thing. At a Python prompt, you can confirm this:
        >>> cow = "I Go Moo"
        >>> globals()["cow"]
        'I Go Moo'
:In other words, the globals() hash-table is a mapping from strings to values; it is the symbol table. Each entry in it, a key-value binding, is a variable.
:A symbol isn't a variable by itself. In Lisp, you can have symbols that are not bound to any value; they are not variables. If you write <TT>'FOO</TT> you are making a symbol with the name "FOO" but no value. If you try to evaluate this symbol -- <TT>(EVAL 'FOO)</TT> -- you get an error. Likewise in Python, if you enter a string that is not the name of any variable (in the global symbol table or the current local one) you get an error.
:So a variable is really a mapping between a name (a symbol in Lisp, a string in Python) and a value. The name by itself is just a symbol (or identifier in C-ish languages). --FOo 03:09, 9 March 2006 (UTC)
thread_title:  Shifting from syntax to semantics 

message: Quote:
:For instance, in the formula: x + 1 = 5, x is a variable which represents an "unknown" number.
It doesn't represent an unknown number, x = 4 Jackliddle 14:58, 30 May 2006 (UTC)
thread_title:  General Overview 

message: The perl example already has two variables ($sName and $sGreet), so there is no need to add a third ($v). The print function is included in the example strictly for display purposes only. Technically it is not relevant to interpolation, at least not in Perl. I will re-edit to make it more clear. Thanks! dr.ef.tymac 14:03, 10 November 2006 (UTC)
thread_title:  interpolation: rv example 

message: Commented out a section that implied variable identifier is the only way to access value (object) in memory. Unless someone wishes to clarify, the content will be removed. Thanks! dr.ef.tymac 17:03, 10 December 2006 (UTC)
thread_title:  pending removal ;; variable name as only way to access value in memory 

message: This article mention of variable extent, and tries to differentiate it from scope, but I think it needs its own section, which at a bare minimum should enumerate the different kinds of extents and their labels in different langauges (i.e., global, static, heap, local, stack, whatever) and how it interacts with the data segment and memory segmentation. --ssd 17:41, 9 March 2007 (UTC)
replies: text: Sub-pages at the end of this article now cover most of what I wanted.  heap is not listed yet.  I suppose I should dig around and find or write something. --ssd 07:06, 21 July 2007 (UTC)
thread_title:  Extent (lifetime) of a variable 

message: Very confused, any insights?  —Preceding unsigned comment added by 75.71.249.209 (talk) 21:20, 24 November 2007 (UTC)
thread_title:  Controlled Variable, Independent Variable, and Whaaa????? 

message: The article speaks of entity. What is an entity (computer science) (currently red link)? Thanks! --Abdull (talk) 12:07, 9 February 2008 (UTC)
thread_title:  Entity 

message: Would it be okay if I changed the Lisp code to C++, seeing as C++ is typically a more widely recognized programming language then Lisp? ShawnStovall (talk) 07:15, 9 April 2008 (UTC)
thread_title:  Changing the Lisp code to C++? 

message: According to a link on "Measurement theory" at the bottom of the level of measurement entry, "Measurement level has nothing to do with discrete vs. continuous variables."  In light of this, I removed the sentence (in the "In applied statistics" section) that said "This [the distinction between discrete and continuous variables] is referred to as the level of measurement."
I also added the "level of measurement" link to the "See also:" links at the bottom of the section.
2rock (talk) 11:29, 17 May 2008 (UTC)
thread_title:  Discrete/continuous not related to level of measurement 

message: The "Computer programming" section was badly written and had some nonsensical or too specific assertions that weren't true for all paradigms. I've tried to generalize and clean it, if you find I've removed something important feel free to discuss. Diego (talk) 12:01, 24 October 2008 (UTC)
thread_title:  Variables in computing 

message: I've been bold and added a lot of unsourced (but I'm quite sure it's not incorrect) information about mathematical variable naming conventions. I hope I haven't gone too far. Leon math (talk) 23:02, 4 January 2009 (UTC)
thread_title:  Naming conventions 

message: I want to propose to fork this article in two, separating the details for variables in maths to those in computer science. The subtleties are too much for all the exceptions to make sense in a single article. There could be a brief section explaining what both concepts have in common, but the general usage is too different in both areas for them to be explained in a single page. Diego (talk) 12:31, 5 January 2009 (UTC)
replies: text: Split, but into three parts: mathematics, statistics and computing. Relevant stuff in statistics has been reduced, probably by someone with little connection to stats. Melcombe (talk) 14:30, 5 January 2009 (UTC)

text: Note added... see Talk:Variable#Add part on variables in physical sciences, engineering? Split, maybe? above.Melcombe (talk) 14:35, 5 January 2009 (UTC)

text: Yes, let's split it up. I think the article now has enough content that a three-way split (mathematics, statistics and computing) makes sense, as suggested by Melcombe. This page should be either a brief overview or a disambigution page. -- Avenue (talk) 22:21, 4 April 2009 (UTC)

text: And, done. Sub-split the math version if 3-way split is still desired. --Cybercobra (talk) 02:06, 5 April 2009 (UTC)
replies: text: Well done, thanks! Some polishing is still desired, e.g. crossreferencing between them, splitting out Constant (programming), etc. Rp (talk) 07:42, 14 April 2009 (UTC)
thread_title:  Split mathematics and CS content in separate articles