Re: String Reference Type
- From: RN1 <rn5a@xxxxxxxxxxxxxx>
- Date: Sat, 9 Feb 2008 17:31:24 -0800 (PST)
On Feb 10, 4:38 am, "Jonathan Wood" <jw...@xxxxxxxxxxxxxxxx> wrote:
Lars,
No, Strings in Pascal (and ADA as I reacll) are tru types.
This appears to be to me but I don't know what "no" refers to, or what "tru
types" are.
I could be wrong but it seems to me you are confusing terms. I'm not that
familiar with Delphi but a reference in C++ is different from a .NET
reference type. I don't know the exact criteria used to determine value or
reference type, but to me a reference type is a pointer, and so any type
that requires a pointer seems it would be a good candidate. And as far as
I'm concerned, all strings require pointers, whether they are made available
to the language that uses them or not. (Certainly, it wouldn't make sense to
ever store a string in a register or even on the stack.)
Don't know about C# but I hope the compiler takes care of this. By
references or not is not of interest. What is of interest is if you have
the option to use call by value for strings or if all parameters are
treated as references. Can you use call by value in C# how do you use call
by value?
According tohttp://www.knowdotnet.com/articles/referencetypes2.html, "One
of the most common mistakes developers make when learning .NET is confusing
Reference and Value Types with Passing values by Reference or Value." Again,
I think you are confusing terms.
--
Jonathan Wood
SoftCircuits Programminghttp://www.softcircuits.com
OK...now suppose I have the following code:
<script runat="server">
Class MyInt
Public MyValue As Integer
End Class
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim x As New MyInt
...................
...................
...................
End Sub
</script>
If I am not wrong, the Dim line in the Page_Load sub "creates space in
the heap & returns a pointer (say, 0x000001)". To whom does the Dim
line return the pointer?
Please correct me if I am wrong.
.
- Follow-Ups:
- Re: String Reference Type
- From: Anthony Jones
- Re: String Reference Type
- From: bruce barker
- Re: String Reference Type
- From: Lars
- Re: String Reference Type
- From: Jonathan Wood
- Re: String Reference Type
- References:
- String Reference Type
- From: RN1
- Re: String Reference Type
- From: Jonathan Wood
- Re: String Reference Type
- From: Lars
- Re: String Reference Type
- From: Jonathan Wood
- String Reference Type
- Prev by Date: Re: Thoughts on Passing Information to Another Page
- Next by Date: Re: binding format
- Previous by thread: Re: String Reference Type
- Next by thread: Re: String Reference Type
- Index(es):
Relevant Pages
|