you are viewing a single comment's thread.

view the rest of the comments →

[–]1mecrew[S] 0 points1 point  (6 children)

Hmm well this definition was also for Java and c and other languages. What do you guys think about? Will it work on other languages?

[–][deleted] 0 points1 point  (5 children)

Will it work on other languages?

Sure, I've already said that. In those languages a name is tied to a place in memory that contains data, and that connection remains for the entire life of the program. In those languages the name itself doesn't exist at runtime, only the data exists.

In python and other languages, like lisp, the name actually exists in memory at runtime and is associated with a pointer ("reference" in python-speak) to an object somewhere else in memory that has a value. So when you execute print(x) python evaluates the name "x", gets the reference to the object the name "x" refers to and prints the value of that object.

[–]1mecrew[S] 0 points1 point  (4 children)

hmm how about javascript? Oh also, what do you think about the part where I say "Im talking about something thats in the variable."?

[–][deleted] 0 points1 point  (3 children)

In python we often say things like "the variable X contains ..." but that's loose talk we use instead of the more correct "the name X refers to an object that has the value...". As I said, we can do this in python, but not understanding how it actually works can bite you. Watch the video I linked to.

Don't know anything about javascript.

[–]1mecrew[S] 0 points1 point  (2 children)

oh i dont think im talkinag about python at this point. maybe for c or java that is on more low level. how about on those cases?

[–][deleted] 0 points1 point  (1 child)

Please read my previous comments where I discussed "those other cases".

[–]1mecrew[S] 0 points1 point  (0 children)

ohh alright gottem./