IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-04-02 18:00:08
Channels: 41
Logged Lines: 6229042
Size: 1810.17 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-06-15
[00:00]<vynvyv>+Arild: uh, are you sure you're right about everything you said yesterday?
[00:00]<vynvyv>+about multiple interfaces with the same method
[00:01]<vynvyv>+i thought you said that this shouldn't compile
[00:01]<vynvyv>+http://pastebin.com/709402
[00:01]<vynvyv>+but it does
[00:01]<vynvyv>+i thought you said i have to specify A.oneMethod or B.oneMethod
[00:03]<rxrcr>-as far as the class Program is concerned, there is only oneMethod to execute
[00:04]<vynvyv>+let me give you the context of this conversation
[00:04]<vynvyv>+well actually that could waste time
[00:05]<vynvyv>+chaka: do you mean if another class calls this method the compiler will get confused?
[00:06]<rxrcr>-no. There is no ambiguity with having 2 interfaces provide the same method signature.
[00:06]<mygmfrn>-night i go to bed o/
[00:06]<vynvyv>+exactly what i thought
[00:06]<vynvyv>+but i think Arild was saying in this situation I have to implement A's oneMethod and B's oneMethod separately
[00:07]<vynvyv>+in context, the way my testcase works is exactly how I thought it would work
[00:07]<vynvyv>+but, unless i misunderstood, Arild was saying it would work differently yesterday
[00:08]<rxrcr>-er the only possible reason you would need to identify which method you're implementing is in the case of multiple inheritance
[00:08]<rxrcr>-which isn't possible in C#
[00:08]<rxrcr>-so if you had 2 abstract classes instead of interfaces, er and you were using C++
[00:09]<vynvyv>+right, maybe he was talking about C++ and i thought he was talking about C#
[00:09]<-- svgvsdyzgjvr xrs>/dev/null")
[00:09]<mdsvyrmrg>-hi, I am looking for a control similar to this one http://www.codeproject.com/cs/miscctrl/treelistview.asp , that is too buggy, commercial controls are okay too
[00:09]<kjr>+tieTYT: do you ever use a properties object in your apps?
[00:10]<vynvyv>+Kog: in c#?
[00:10]<gzrmsxrmn>-if i give a function pointer (AsyncCallback) as a parameter to another function will the callback know what object it is associated with? (the 'this' pointer)
[00:10]<kjr>+tieTYT: no, Java
[00:10]<vynvyv>+yes all the time
[00:10]<vynvyv>+it's the easiest way to use metadata
[00:11]<fyfuym-syfggag>+StaZ[work]
[00:11]<vynvyv>+but i've never used the xml version of a properties object
[00:11]<y-gz>-tieTYT: in the pasted code both methods will have one implementation of the method
[00:11]<fyfuym-syfggag>+what if you have control with a button
[00:11]<fyfuym-syfggag>+ie on button click it has to validate
[00:11]<vynvyv>+i-nZ: you were in that conversation yesterday. Do you understand why i thought he said differently?
[00:12]<y-gz>-tieTYT: if you want to have 2 implementations for the 2 methods you will need to implement the interfaces explicitly, but then you will need to tell the runtime which implementation you want to call by casting (concerning the object - there is no method implementation if you don't cast)
[00:12]<wrvve>+sorry to bother, but has anyone here ever used ScintillaNET?
[00:13]<kjr>+wattz: what would be the point?
[00:13]<wrvve>+wanting to use it for syntax highlighting
[00:13]<y-gz>-tieTYT: are you still confused about something ?
[00:14]<y-gz>-Kog: holla. What happened with the channel website ?
[00:14]<kjr>+i-nZ: gotta think about it
[00:14]<kjr>+domain's about 14 bucks... shouldn't be a problem
[00:14]<kjr>+gotta renew my personal one anyway
[00:15]<vynvyv>+i-nZ: yes
[00:15]<vynvyv>+i-nZ: what is it called to implement 2 implementations for the 2 methods?
[00:15]<vynvyv>+does that have a name?
[00:15]<kjr>+i-nZ: he's confused by a great many things ;)
[00:15]<vynvyv>+that doesn't exist in java unless you're talking about 2 classes
[00:15]<gzrmsxrmn>+polymorphism, tieTYT?
[00:15]<kjr>+tieTYT: with exactly the same sig?
[00:15]<vynvyv>+no that's not polymorphism
[00:15]<vynvyv>+Kog: yes
[00:15]<kjr>+implementation
[00:16]<vynvyv>+that's not simple implementation
[00:16]<kjr>+sure it is
[00:16]<kjr>+the sigs are exact
[00:16]<vynvyv>+he's saying you have One concrete class
[00:16]<vynvyv>+that implements 2 interfaces, both with the same exact method signature
[00:16]<kjr>+tieTYT: then the interfaces overlap
[00:16]<wyfaj>-GrayShade: no, unless its passed as part of the state in the eventargs object
[00:16]<vynvyv>+and there's some way to say, "I'm going to implement the first interface method this way, and the second interface another way"
[00:16]<kjr>+tieTYT: but it can't be done in different ways
[00:16]<kjr>+it must be the same method
[00:16]<gzrmsxrmn>+wilco: it seems to work, at least in the debugger
[00:17]<vynvyv>+Kog: ok then to me it seems like what he just said is wrong
[00:17]<vynvyv>+<i-nZ> tieTYT: if you want to have 2 implementations for the 2 methods you will need to implement the interfaces explicitly, but then you will need to tell the runtime which implementation you want to call by casting (concerning the object - there is no method implementation if you don't cast)
[00:17]<vynvyv>+isn't he saying there is a way for it to be done in different ways?
[00:18]<vynvyv>+that's also what Arild was saying yesterday (i think)
[00:18]<kjr>+wait... let me see if I'm on the same page
[00:18]<kjr>+you have a class that implements two interfaces
[00:18]<kjr>+both interface specify the class must have a method with the exact same sig
[00:18]<vynvyv>+yep
[00:18]<kjr>+then it seems to me that the interfaces overlap
[00:18]<vynvyv>+i would agree
[00:18]<kjr>+you can't do multi-dispatch in C#
[00:19]<vynvyv>+well read i-nZ's comment
[00:19]<vynvyv>+isn't he saying you can?
[00:19]<mnzncs>+with the browser control, is it possible to open all links in a normal browser (deteremined by the default browser in windows)?
[00:19]<kjr>+although you can (sorta) in Java
[00:19]<wyfaj>-you can implement both methods in each interface
[00:19]<wyfaj>-explicitly
[00:19]<vynvyv>+ok let's take a pause
[00:19]<kjr>+wilco: so... your class has public void interface.method(params) ?
[00:19]<wyfaj>-so your type basically has 2 methods with the same signature... except they're explicitly implemented, which means you have to cast to the appropriate interface type to use them
[00:19]<vynvyv>+wilco, are you in disagreement with Kog?
[00:20]<wyfaj>-Kog: void InterfaceName1.Method(params) and void InterfaceName2.Method(params)
[00:20]<kjr>+wilco: ah, that was the part I was missing
[00:20]<kjr>+yes, in that case what wilco and i-nZ say is true
[00:20]<wyfaj>-tieTYT: I haven't followed the conversation so I'm not disagreeing/agreeing with anyone
[00:20]<kjr>+wilco: I thought the method was just being implemented
[00:20]<kjr>+THAT would be an overlap
[00:20]<kjr>+tieTYT: sorry, was on a different page... yeah, I'm with Wilco
[00:21]<kjr>+wasn't sure what "explicitly implemented" entailed
[00:21]<wyfaj>-im not sure how many languages support explicit interface implementation
[00:21]<vynvyv>+ok now i understand
[00:21]<vynvyv>+now that is just fucking weird
[00:21]<vynvyv>+java does not support this as far as i know
[00:21]<wyfaj>-it doesnt
[00:21]<vynvyv>+is this ability actually useful?
[00:21]<wyfaj>-yes







