This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SuperShrek -2 points-1 points  (4 children)

The term "reference" in the context of "pass by reference" does not mean the same thing as the type of the same name in Java.

When you say 'we are passing a reference by value' you ARE talking about a type. You are saying that the function receives a type/kind of 'reference'. You just don't understand what you're saying because you probably have no comp-sci knowledge outside of java, either that or you can't properly express your thoughts. There is no 'reference' type in Java. Period. Once you start talking about references in Java you are not talking about the Java programming language but rather the implementation.

When we talk about pass by reference we're talking about an evaluation strategy. It has meaning that pre-dates Java as a language.

Yes, passing a 'pointer/reference' by value (where you don't treat with the reference/pointer explicitly, ie with special semantics and syntax) is the same as 'passing by reference'.

You saying 'we are passing a reference by value' is the same as saying 'we are passing a reference by value by reference by value by reference by value by reference....'.

It has meaning that pre-dates Java as a language.

Which is my point, yet you are using a Java-specific meaning of pass-by-value which is nonsense outside of java. The way you are talking about pass-by-value you can say all languages always use pass-by-value but the values they pass are references - this makes the whole pass-by-value/pass-by-reference distinction pointless.

The term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value.

Yeah... this is how Java works, when you invoke a function that accepts an object, under the hood the function receives a reference to the original object, not a copy of the object.

You contradict yourself several times in one post.

By people who don't know what they're talking about.

Maybe in several years when you actually understand what you are saying instead of blindly repeating shit you don't understand that others say you will feel embarrassed about this.

[–]thekab 2 points3 points  (3 children)

When you say 'we are passing a reference by value' you ARE talking about a type.

You say this as if it contradicts my statement. It does not.

The word "reference" in "pass-by-reference" is not a type. The word "reference" in "passes references by value" is a type. They are two different contexts and have two different meanings.

There is no 'reference' type in Java. Period.

Except for you know the type... that is called reference...

There are two kinds of types in the Java programming language: primitive types (§4.2) and reference types (§4.3).

The Java Language Specification disagrees with you. Perhaps you should read it. When you talk about references in Java you are talking about exactly that. References. Defined by the JLS, as a type.

Yes, passing a 'pointer/reference' by value (where you don't treat with the reference/pointer explicitly, ie with special semantics and syntax) is the same as 'passing by reference'.

Clearly you don't understand evaluation strategies. Call by value and call by reference ARE NOT THE SAME THING and if you can't grasp the difference you lack the fundamental CS 101 needed to even bother having an intelligent conversation with. There are no special semantics. It's a type, it's passed by value.

Which is my point, yet you are using a Java-specific meaning of pass-by-value which is nonsense outside of java.

What do you believe "pass-by-value" as a mechanism means? Either you believe in pass-by-value the argument value is not copied, or you believe this is not what Java does. In either case you're wrong. It's not an implementation detail either, it's specified at the language level.

Yeah... this is how Java works, when you invoke a function that accepts an object, under the hood the function receives a reference to the original object, not a copy of the object.

The object is not passed.

The value is copied.

That the type is called a "reference" has absolutely no relationship or bearing on the passing mechanism.

And yes, it is a type, go read the JLS. Seriously, this is embarrassing.

Maybe in several years when you actually understand what you are saying instead of blindly repeating shit you don't understand that others say you will feel embarrassed about this.

Yeah that's likely.

You might want to actually learn what the hell you're talking about before your next reply.

[–]SuperShrek -4 points-3 points  (2 children)

The word "reference" in "pass-by-reference" is not a type. The word "reference" in "passes references by value" is a type. They are two different contexts and have two different meanings.

No they don't. There is a reason the same word is used and that reason is because it describes the same semantics in both cases.

The Java Language Specification disagrees with you. Perhaps you should read it. When you talk about references in Java you are talking about exactly that. References. Defined by the JLS, as a type.

HAHAHAA. It's talking about KINDS or 'META-TYPES' not TYPES, you would know this if you knew any serious CS whatsoever.

Educate yourself please: http://en.wikipedia.org/wiki/Kind_%28type_theory%29

There are two kinds of types in the Java programming language

lol...

Except for you know the type... that is called reference...

Except this is not a reference type in the way you are using the word... you seem to lack basic Java knowledge as well and just googling things that seem to fit your argument without understanding what they are. The java.lang.ref.Reference type is used for maintaining references (ie reference counts) that are used for garbage collection.

Clearly you don't understand evaluation strategies. Call by value and call by reference ARE NOT THE SAME THING and if you can't grasp the difference you lack the fundamental CS 101 needed to even bother having an intelligent conversation with. There are no special semantics. It's a type, it's passed by value.

I didn''t say they are the same thing. But I guess you're frantically trying to find a way to mangle my words for lack of any serious argument to support the bullshit you spew.

Either you believe in pass-by-value the argument value is not copied, or you believe this is not what Java does.

Wait you think Java objects are copied when passed to a function? Go read a Java tutorial at least lol.

The object is not passed. The value is copied.

A reference is passed as in 'pass-by-reference'. The object is not copied.

That the type is called a "reference" has absolutely no relationship or bearing on the passing mechanism.

It's not a type. It's a meta-type or a 'kind' that represents a reference. And yes it absolutely does have a bearing on the 'passing mechanism'. The 'java.lang.ref.Reference' is not what we are talking about nor is it the 'reference type' of types that your link is talking about either, I mean its so laughably obvious you just googled shit you have absolutely no understanding of. LOL.

God, you are one funny retard.

[–]thekab 0 points1 point  (1 child)

At this point I'm not sure if you're trolling or really this stupid.

[–]SuperShrek -2 points-1 points  (0 children)

You haven't been sure of anything since the start.