IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Wow!
Compile-time recursion! I'll be damned.

The need for this arose from unit testing a template class. I have a scheduler class, and it takes the type of thing it will schedule as its template argument. So, naturally, I wanted to write a unit test class for that scheduler. One of the things that unit test needs is a sample schedulable entity, something that would record when it gets attention so that I can check the accuracy of scheduling at the end of test.

So far so good. However, the scheduled thing in my case needed a back lilnk to scheduler. Don't ask why, it's not really important. As long as I only had one type of scheduler, things were fine. But then I expanded the code to have 2 differnt types of scheduler (will have 3 in the future). And I wanted to reuse unit tests. But now we have a problem. The scheduled entity needed to be told the class of the scheduler (for the back pointer). And the scheduler needs to be told the class of scheduled entity. Circular dependencies.

Then it struck me that if I could pass scheduler template name (as opposed to an instanciation of template) to the scheduled entity, I would be OK. The scheduled entity will instantiate the template with itself, and, lo and behold - dependency solved. So I took a look at C++ standard, and sure enough, a template argument can take a form of not only

class X

but also

template <class P> class X

And I used it. See the code at the beginning of the thread as to how.
--

We have only 2 things to worry about: That
things will never get back to normal, and that they already have.
New Grammar police
Then it struck me that if I could pass scheduler template name (as opposed to an instanciation of template)

I believe you mean an instance. This strikes me as being similar to someone saying they "administrate" a box, rather than "administer" it.

[Edit was typo police in the subject]
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
Expand Edited by drewk Oct. 23, 2002, 10:30:54 AM EDT
New No
Computerese, esp C++ese, really has these abominable words. However it's spelled "instantiation".
-drl
New Spelling police
Classes have instances. I think (not hunderd percent sure) that templates have instantiations (can't have a partial instance, but a partial instantiation is possible). The spelling was indeed wrong (thanks, deS).
--

We have only 2 things to worry about: That
things will never get back to normal, and that they already have.
New Arrrgh!
That's just so damn wrong! Leave it to people writing their own new "language" to decide to modify existing ones while they're at it.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Instantiation has been in use for a long time...
[link|http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=instantiation|"instantiation"]

One of the hallmarks of the English language is its malleability. Deal with it. ;-)

Or would you prefer the French Language Inquisition to set up shop here as well?
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Careful, keep this up and you'll be agreeing with ...
No, I can't type it out loud.

Anyway, I'm not saying language can't/shouldn't change, but in this case "instance" is most nearly the root of that group of words. "Instantiate" is a suffixed form, "instantiation" would be a multiply-suffixed form that is syntactically equivalent to the root. It's just bad grammar.

And furthermore ... you didn't just suggest that "people have been getting it wrong for a long time" is a valid defense of it, did you?
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Re: Careful, keep this up and you'll be agreeing with ...
"People have been getting it wrong for a long time" is exactly how things change in languages.

Instance sounds static. Instantiation implies the act of instantiation as well. Subtle connotation difference, but it's there.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Then I hereby nominate ... objectification
This is sarcasm...
Object sounds static. Objectification implies the act of objectification as well. :-p
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Re: Then I hereby nominate ... objectification
[link|http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=objectification|"objectification"]

The act of objectifying something.

Date: circa 1837

This one is over 100 years older than instantiation. ;-) Thanks for playing, drive through.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New He meant "objectifaction"
defn: Making a rotten object (from "object putrefaction").
-drl
New Re: He meant "objectifaction"
[link|http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=objectifaction|"objectifaction"]

That one actually works as a joke. ;-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Not as a noun, though
You're using "instantiation" as a noun. Then "objectification" would have to be a noun also. As in, "The input to this function is an objectification."

Thank you for playing.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Objectification IS a noun, you knob.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Umm, well, yeah, but ... uhhh
CrrrrrrrAP!

I'm even forced to admit that it's possible "instantiation" might have been correct in the first instance.
===
Microsoft offers them the one thing most business people will pay any price for - the ability to say "we had no choice - everyone's doing it that way." -- [link|http://z.iwethey.org/forums/render/content/show?contentid=38978|Andrew Grygus]
New Welll...
WTF did you think I linked to Merriam Webster for...?
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New You've been using that a lot lately.
"knob", that is. It sounds so British. Do you know where you picked it up from?

Wade

"Ah. One of the difficult questions."

New Well I know where *I* got it from
Larry Wall. [link|http://interviews.slashdot.org/article.pl?sid=02/09/06/1343222&mode=thread&tid=145|Perl 6 will give you the big knob.]

Cheers,
Ben
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New My (obvious) guess: Peter.
You know, [link|/forums/render/user?username=pwhysall|pwhysall].



(Wow -- these WeirdCode thingies seem to be *working*! :-)
   Christian R. Conrad
Microsoft is a true reflection of Bill Gates' personality - the sleaziest, most unethical, ugliest little rat's ass the world has seen unto this time.
-- [link|http://z.iwethey.org/forums/render/content/show?contentid=42971|Andrew Grygus]
New Dunno.
Just one of those things I picked up somewhere.

I tend to use an eclectic collection of phrases, given how many shady characters from around the world I associate with. ;-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I'm not saying its good.
But rather than templates - why don't you just provide an abstract class for the back pointer and use that. Why must it be the specific implementation class?
I am out of the country for the duration of the Bush administration.
Please leave a message and I'll get back to you when democracy returns.
New Was trying to avoid virtual functions
This stuff is potentially in a tight loop.
--

We have only 2 things to worry about: That
things will never get back to normal, and that they already have.
New ROFL - "This prog might actually do something needing speed"
-drl
New Write the program you want
then optimize it.

Not the other way around.

The number of people who need to write performance critical code is at least 3 orders of magnitude smaller than the people who think they need to write performance critical code.

I am out of the country for the duration of the Bush administration.
Please leave a message and I'll get back to you when democracy returns.
New I know, I know.
I have always heard that theory that templates are as powerful for generic programming as virtual functions. I decided to test that statement. In the end, templates worked out just fine, the code is no less elegant than it would be if I used an interface. And the code is not _really_ in a tight loop at the moment. In my defense I can only say that the code that's being replaced with the scheduler used to take 80% of CPU time, so I wanted the replacement to be very, very tight. May be tighter than it needs to be.
--

We have only 2 things to worry about: That
things will never get back to normal, and that they already have.
     I've learned something new in C++ today! - (Arkadiy) - (36)
         Criminy - (deSitter) - (2)
             No, just what I needed :) -NT - (Arkadiy) - (1)
                 No Way! - (deSitter)
         Re: I've learned something new in C++ today! - (wharris2) - (1)
             Crawl? Run, run! -NT - (Arkadiy)
         Don't forget your extra space - (tuberculosis) - (30)
             Re: Don't forget your extra space - (Arkadiy) - (29)
                 Fear the syntax error messages... -NT - (admin)
                 No, wait, I need more context. - (tuberculosis) - (25)
                     Wow! - (Arkadiy) - (24)
                         Grammar police - (drewk) - (18)
                             No - (deSitter)
                             Spelling police - (Arkadiy) - (16)
                                 Arrrgh! - (drewk) - (15)
                                     Instantiation has been in use for a long time... - (admin) - (14)
                                         Careful, keep this up and you'll be agreeing with ... - (drewk) - (13)
                                             Re: Careful, keep this up and you'll be agreeing with ... - (admin) - (12)
                                                 Then I hereby nominate ... objectification - (drewk) - (11)
                                                     Re: Then I hereby nominate ... objectification - (admin) - (10)
                                                         He meant "objectifaction" - (deSitter) - (1)
                                                             Re: He meant "objectifaction" - (admin)
                                                         Not as a noun, though - (drewk) - (7)
                                                             Objectification IS a noun, you knob. -NT - (admin) - (6)
                                                                 Umm, well, yeah, but ... uhhh - (drewk) - (1)
                                                                     Welll... - (admin)
                                                                 You've been using that a lot lately. - (static) - (3)
                                                                     Well I know where *I* got it from - (ben_tilly)
                                                                     My (obvious) guess: Peter. - (CRConrad)
                                                                     Dunno. - (admin)
                         I'm not saying its good. - (tuberculosis) - (4)
                             Was trying to avoid virtual functions - (Arkadiy) - (3)
                                 ROFL - "This prog might actually do something needing speed" -NT - (deSitter)
                                 Write the program you want - (tuberculosis) - (1)
                                     I know, I know. - (Arkadiy)
                 Ow ow ow ow ow ow - (static) - (1)
                     Run away! run Away! - (boxley)

We're sorry. Your LRPD has been back-ordered, and will ship when stocks have been replenished.
129 ms