зеркало из https://github.com/mono/mail-archives.git
159 строки
6.5 KiB
HTML
159 строки
6.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-list] implicit, explicit, and why does C# have these?
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:dlamotta%40email.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
|
|
<LINK REL="Previous" HREF="016482.html">
|
|
<LINK REL="Next" HREF="016486.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-list] implicit, explicit, and why does C# have these?
|
|
</H1>
|
|
<B>David La Motta
|
|
</B>
|
|
<A HREF="mailto:dlamotta%40email.com"
|
|
TITLE="[Mono-list] implicit, explicit, and why does C# have these?">dlamotta@email.com
|
|
</A><BR>
|
|
<I>Fri, 17 Oct 2003 09:56:08 -0400</I>
|
|
<P><UL>
|
|
<LI> Previous message: <A HREF="016482.html">[Mono-list] implicit, explicit, and why does C# have these?
|
|
</A></li>
|
|
<LI> Next message: <A HREF="016486.html">[Mono-list] implicit, explicit, and why does C# have these?
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#16483">[ date ]</a>
|
|
<a href="thread.html#16483">[ thread ]</a>
|
|
<a href="subject.html#16483">[ subject ]</a>
|
|
<a href="author.html#16483">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>This is a multi-part message in MIME format.
|
|
--------------070101010801090009040807
|
|
Content-Type: text/plain; charset=us-ascii; format=flowed
|
|
Content-Transfer-Encoding: 7bit
|
|
|
|
I guess I should expand on my [sort-of] gripe. Implicit casting by the
|
|
language itself is OK where it makes sense, like in your example of int
|
|
and long. But, logically, it can be confusing to use an implicit
|
|
operator to convert between objects that have nothing in common, and
|
|
never will (like Truck and Pear, for instance).
|
|
|
|
// David
|
|
|
|
|
|
Arild Fines wrote:
|
|
|
|
><i>David La Motta wrote:
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>>><i>Thanks for the explanation. I can see how the implicit operator can
|
|
</I>>><i>be useful in the example you describe; still, I think it wasn't
|
|
</I>>><i>necessary for C# to expose them to us. I.e., let us deal with the
|
|
</I>>><i>explicit casts and spare the confusion they may cause. In other
|
|
</I>>><i>words, an implicit cast from a Pear object to a Truck object can seem
|
|
</I>>><i>quite odd, assuming their inheritance tree has nothing in common.
|
|
</I>>><i>
|
|
</I>>><i>
|
|
</I>><i>
|
|
</I>><i>Sure, but would you really want to be required to use an explicit cast when
|
|
</I>><i>converting an int to a long?
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>--
|
|
</I>><i>Arild
|
|
</I>><i>
|
|
</I>><i>AnkhSVN: <A HREF="http://ankhsvn.tigris.org">http://ankhsvn.tigris.org</A>
|
|
</I>><i>Blog: <A HREF="http://ankhsvn.com/blog">http://ankhsvn.com/blog</A>
|
|
</I>><i>RSS: <A HREF="http://ankhsvn.com/blog/Rss.aspx">http://ankhsvn.com/blog/Rss.aspx</A>
|
|
</I>><i>
|
|
</I>><i>King Crimson lives in different bodies at different times and the
|
|
</I>><i>particular form which the group takes changes. When music appears,
|
|
</I>><i>which only King Crimson can play then, sooner or later, King Crimson
|
|
</I>><i>appears to play the music
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>
|
|
--------------070101010801090009040807
|
|
Content-Type: text/html; charset=us-ascii
|
|
Content-Transfer-Encoding: 7bit
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
|
|
<title></title>
|
|
</head>
|
|
<body text="#000000" bgcolor="#ffffff">
|
|
I guess I should expand on my [sort-of] gripe.&nbsp; Implicit casting by the
|
|
language itself is OK where it makes sense, like in your example of int
|
|
and long.&nbsp; But, logically, it can be confusing to use an implicit
|
|
operator to convert between objects that have nothing in common, and
|
|
never will (like Truck and Pear, for instance).<br>
|
|
<br>
|
|
// David<br>
|
|
<br>
|
|
<br>
|
|
Arild Fines wrote:<br>
|
|
<blockquote type="cite"
|
|
cite="<A HREF="mailto:midAJEELJINGEGOMNJPJFKKCEIEDCAA.arild.fines@broadpark.no">midAJEELJINGEGOMNJPJFKKCEIEDCAA.arild.fines@broadpark.no</A>">
|
|
<pre wrap="">David La Motta wrote:
|
|
</pre>
|
|
<blockquote type="cite">
|
|
<pre wrap="">Thanks for the explanation. I can see how the implicit operator can
|
|
be useful in the example you describe; still, I think it wasn't
|
|
necessary for C# to expose them to us. I.e., let us deal with the
|
|
explicit casts and spare the confusion they may cause. In other
|
|
words, an implicit cast from a Pear object to a Truck object can seem
|
|
quite odd, assuming their inheritance tree has nothing in common.
|
|
</pre>
|
|
</blockquote>
|
|
<pre wrap=""><!---->
|
|
Sure, but would you really want to be required to use an explicit cast when
|
|
converting an int to a long?
|
|
|
|
|
|
--
|
|
Arild
|
|
|
|
AnkhSVN: <a class="moz-txt-link-freetext" href="<A HREF="http://ankhsvn.tigris.org"">http://ankhsvn.tigris.org"</A>><A HREF="http://ankhsvn.tigris.org</a">http://ankhsvn.tigris.org</a</A>>
|
|
Blog: <a class="moz-txt-link-freetext" href="<A HREF="http://ankhsvn.com/blog"">http://ankhsvn.com/blog"</A>><A HREF="http://ankhsvn.com/blog</a">http://ankhsvn.com/blog</a</A>>
|
|
RSS: <a class="moz-txt-link-freetext" href="<A HREF="http://ankhsvn.com/blog/Rss.aspx"">http://ankhsvn.com/blog/Rss.aspx"</A>><A HREF="http://ankhsvn.com/blog/Rss.aspx</a">http://ankhsvn.com/blog/Rss.aspx</a</A>>
|
|
|
|
King Crimson lives in different bodies at different times and the
|
|
particular form which the group takes changes. When music appears,
|
|
which only King Crimson can play then, sooner or later, King Crimson
|
|
appears to play the music
|
|
|
|
</pre>
|
|
</blockquote>
|
|
</body>
|
|
</html>
|
|
|
|
--------------070101010801090009040807--
|
|
|
|
|
|
</PRE>
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI> Previous message: <A HREF="016482.html">[Mono-list] implicit, explicit, and why does C# have these?
|
|
</A></li>
|
|
<LI> Next message: <A HREF="016486.html">[Mono-list] implicit, explicit, and why does C# have these?
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#16483">[ date ]</a>
|
|
<a href="thread.html#16483">[ thread ]</a>
|
|
<a href="subject.html#16483">[ subject ]</a>
|
|
<a href="author.html#16483">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
</body></html>
|