Re: Using ref

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Thu, 03 Jul 2008 14:29:06 -0700, Hilton <nospam@xxxxxxxxxx> wrote:

2. The C# code is "pass by reference" even though exactly the same as its C
counterpart, just a different syntax, or

It's not "exactly the same". There are important differences between the
two that you are ignoring.

They both pass an address, they both store 20 to the memory pointed to by
that address. What important differences am I ignoring?

Well, for one, how the parameter can be used in the called method. As Jon points out, when it's passed by value, the method can then change that value locally. When it's passed by reference, the method cannot change the reference; it can only change the thing that is referenced.

[...]
It is a critically important description of how the _language_ works.
Just because you can get the compiled result to accomplish the same thing,
that doesn't mean that the _language_ concepts are the same.

They don't simply accomplish the same thing, they are doing the same thing.

No, they are not. Again, you are arbitrarily ignoring important differences.

Does the fact that you keep going back to the language (and its syntax) mean
that you agree with me that this is all about syntax? Probably not. :)

I don't even see why that's important. In truth, there's a real semantic difference here. But even if it were just about syntax, does that justify you insisting on refusing to accept the standard definitions used by every well-informed, well-educated programmer?

Again, two pieces of code doing the same thing yet one is pass-by-value, the
other is pass-by-reference? (as you confirmed)

The code you posted accomplishes the same thing. That doesn't mean that the two situations are exactly the same.

If we're talking about how it 'looks' (i.e. syntax), then I agree with you
and Jon (as I stated before).

We're not. There are fundamental differences in the way the parameters are used when you have a language that actually supports passing "by reference", as compared to a language that does not.

That said, I'm done trying to help you understand. Every time you think you've come up with an example that illustrates why things are the same, we point out why the example is wrong. You either ignore those points altogether (and why not? why bother to listen to any fact that conflicts with your own view?), or you come up with some new example that is similarly flawed (repeating the cycle).

You obviously aren't interested in learning something new. You reject anything that confronts your own pre-established beliefs, and frankly, I find religious debates pointless.

At least for the time being, this thread has sufficient content to avoid any naïve reader thinking that you actually know what you're talking about, and that's good enough for me. As I said, I don't really care what _you_ believe...I just don't want anyone else thinking you're right. I'm sure that goal has been accomplished.

Pete
.



Relevant Pages

  • Re: More beginner help needed
    ... You are confusing syntax with semantics. ... There must be 10 useful ways to accomplish ... They have the same semantic choices available to them as I do. ... Obviously higher numbers are more logging! ...
    (comp.os.linux.misc)
  • Re: Named regexp variables, an extension proposal.
    ... John Machin wrote: ... reference the literal contents of groups appearing after the variable ... Regex syntax is over-rich already. ... complete parser for Verilog, I want to take an easier 'good enough' ...
    (comp.lang.python)
  • Re: Interesting article: In the Beginning: An RDBMS history
    ... First a frame of reference. ... Human Communication. ... syntax: grammars, forms, interview-style talks. ... To me to book "Pragmatics of Human Communication", ...
    (comp.databases.theory)
  • Re: list.clear() missing?!?
    ... instead of trying helpand getting a syntax error. ... reference to name in name's namespace" feels wrong, ... For lists, it would be natural to have a hypothetical clearmethod ... if obj is None: ...
    (comp.lang.python)
  • Re: Range Object error
    ... Once I explicetly reference the CELLS all is well. ... And this does NOT refer to a Range, but a Worksheet, so all object prefixed ... It is not valid syntax, ...
    (microsoft.public.excel.programming)