Implicit overloads, non static

  • Thread starter Thread starter Chad Z. Hower aka Kudzu
  • Start date Start date
Jon Skeet said:
It's even easier with "yield" in 2.0:

:( Im disappointed (its cool, but not what Id hoped) and delighted (my code
is still useful. :) ) that its only an extension to an iterator... And not
full fiber support.

Guess I'll have to port fibers over from Delphi to C#.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
 
Chad Z. Hower aka Kudzu said:
Neat - that looks like a fiber. Are they implemented using fibers?

That depends what you mean by fibers :) Not Windows fibers, certainly.

I believe a class which holds all the necessary state is created behind
the developer's back, basically.
 
Chad Z. Hower aka Kudzu said:
I didnt necessarily want to do it - the code I posted was just to show
"What" it would do. Im using the copy constructor behaviour and am just
fine with that.

Well, you said you'd *like* to do it in your first post - I was going
on that.
It's easy - 1 to 5, 0, to 4, goofing up of the condition mostly.

No, I mean I wonder what the cause of the discrepancy is - you seeing
it lots, and me seeing it very rarely.
Aah - sorry I should have clarified that. I prefer they use while loops
*when* its not a simple for i = 1 to 5 condition. Certainly not for that
condition. :)

Right, okay.
I find a lot of things hard in Java. Ack what they call properties... They
are methods! There's no property about it - its a blooddy pattern I could
do in VB... reminds me of OOP in SAS.

No-one's claiming it's anything more than a pattern in Java.
Here is where we will strongly disagree then for sure.

Making code self-explanatory is a big thing for me. Implicit
conversions can definitely be confusing - I've seen *that* lots on the
newsgroups. Again, it's something Java doesn't have and which I don't
miss when I go back to Java.
But you *do* know the value. Becuase its a new value type.

BCD x = 4;

decimal i = x;

i equals 4.

It *is* a new value type - and thus its value is 4. There are many other
non value type uses for implicits too.

I wasn't talking about implicit conversions in general - I'm talking
about the idea from your first post where you did:

MyStruct x;
x.SomethingElse = 5;
x = 4;

and you'd want the value of x *not* to be completely determined by the
RHS (which is just 4). You'd want it to be determined by both the RHS
and the previous value of x. That's counterintuitive.

That's what I was saying was a bad idea on principle, regardless of
implementation.
Yes - true. Its not a copy constructor, its similar behavioru. I introduced
the term when I was describing some behaviour, and its gone out of context
since then.

Sure. So long as I know what you mean, it doesn't really matter.
 
Jon Skeet said:
That depends what you mean by fibers :) Not Windows fibers, certainly.

I believe a class which holds all the necessary state is created behind
the developer's back, basically.

Yes, the compiler generates a state machine class(although it might be a
struct for performance reasons) and returns that. It isn't exactly full
fledged co-routine system which is what you'd use fibers for I think.
 
Daniel O'Connell said:
Yes, the compiler generates a state machine class(although it might be a
struct for performance reasons) and returns that. It isn't exactly full
fledged co-routine system which is what you'd use fibers for I think.

Still a nice advancement none the less.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
 
Chad Z. Hower aka Kudzu said:
Still a nice advancement none the less.

Yes, and more flexible than I originally thought it would be. I think it
could be turned into something much closer to coroutines if a language chose
to support it that way.
 
Back
Top