tag:blogger.com,1999:blog-2428374771421713311.post1878531865592910917..comments2024-03-10T12:04:17.661-07:00Comments on The Oracle at Delphi: A Generic Playground, an intro to parameterized types in Delphi for .NETAnonymoushttp://www.blogger.com/profile/10119008505905401707noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-2428374771421713311.post-67492979165920952892007-09-13T02:34:49.000-07:002007-09-13T02:34:49.000-07:00A compact Example and fine satire.A compact Example and fine satire.shankarnoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-77008043783018179102007-09-13T08:12:31.000-07:002007-09-13T08:12:31.000-07:00You know thats just fabulous, not keep it the hell...You know thats just fabulous, not keep it the hell out of ALL the other versions of Delphi. This is pretty much gonna screw up most everything. What are you guys trying to do, turn pascal into basic?<br><br>Pascal is a *strictly typed language* and it was done that way for good reasons.<br><br>Why not just go the whole route, drop types all together and just have everything determined by the compilers best guess?<br><br>I should slap you upside the head for doing such an stupid thing to a language that was great until people like you came along.WIlliam Sappingtonnoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-25842851956517593872007-09-13T08:32:31.000-07:002007-09-13T08:32:31.000-07:00Ah, no I understand. Generics enable us to write ...Ah, no I understand. Generics enable us to write neat, tidy code in one place that we can then use using ugly and cumbersome invocation mechanisms throughout our code.<br><br>If you are writing "ReverseIntegerArray()" over and over again then you need to look at your software development process and management tools.<br><br>You should of course have written this once, long ago, and now simply be using it all the time by simply calling:<br><br> ReverseIntegerArray( someIntArray );<br><br>If your existing practices didn't allow this sort of simple, elegant and efficient re-use then I humbly suggest that you will quickly find yourself in an even deeper mess with generics.<br><br>r maybe it was just a bad example - funny how so many generics examples are bad examples.....<br><br>;)Jolyon Smithhttp://www.deltics.co.nznoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-47587611307993463522007-09-13T16:51:14.000-07:002007-09-13T16:51:14.000-07:00I think the syntax should befunction InList<T&g...I think the syntax should be<br>function InList<T>(Value: T; const Arr: Array Of T): Boolean;<br>:-)<br><br>Uli.Ulrich Gerhardtnoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-57870914550934461972007-09-13T17:49:05.000-07:002007-09-13T17:49:05.000-07:00C Johnson:> I doubt something like this would w...C Johnson:<br>> I doubt something like this would work currently<br><br>Of course you can. <br><br>In the current version you have to wrap the (possibly static) method inside a class. The syntax would be:<br><br>function TUtility.InList(Value : T; const Arr : Array Of T) : Boolean;Hallvard Vassbotnhttp://hallvards.blogspot.com/noreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-13073826201334508552007-09-14T00:22:58.000-07:002007-09-14T00:22:58.000-07:00William, What specifically are you complaining ab...William,<br><br> What specifically are you complaining about? About how to generics compromise the strict typing of Object Pascal? In fact, parameterized types *increase* the type safety of the language. Can you cite some examples where this type safety is compromised?<br><br>Thanks,<br>Allen.Allen Bauerhttp://blogs.codegear.com/abauer/noreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-74130015312268682632007-09-14T04:07:31.000-07:002007-09-14T04:07:31.000-07:00Fantastic.I have a question:Am I right that compil...Fantastic.<br><br>I have a question:<br>Am I right that compiled code in Native mode will be bigger? And is it compiled smartly, meaning only the types used in code will be generated?K Anoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-19682572396588072942007-09-14T04:53:45.000-07:002007-09-14T04:53:45.000-07:00K A,Unless a parameterized type is actually instan...K A,<br>Unless a parameterized type is actually instantiated and referenced, code for it will never be generated nor linked in. It will also be smart enough to know that anyplace it generates a, for instance, "TMyType<Integer>" instantiation, only one copy will be linked in.<br>Parameterized types *can* lead to larger code size, however in many cases it actually can reduce the overall size.<br>Allen.Allen Bauerhttp://blogs.codegear.com/abauer/noreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-40715202322356613092007-09-14T18:59:29.000-07:002007-09-14T18:59:29.000-07:00Thanks for the info, Allen. Nice example. Btw, by ...Thanks for the info, Allen. Nice example. Btw, by mentioning Barry and ChuckJ this means, of course, that Barry will start to blog more often and ChuckJ will return ASAP, isn't? Well, now you're bound by 'future looking statements' so you're obliged to accomplish them... ;-)m. Th.noreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-9614322674585023052007-09-15T02:20:08.000-07:002007-09-15T02:20:08.000-07:00William: "I should slap you upside the head f...William: "I should slap you upside the head for doing such an stupid thing to a language that was great until people like you came along."<br><br>Or perhaps someone should slap you for being so rude... Given how long Allen's been at Borland/CodeGear mind, I take it you think the rot set in when Turbo Pascal gained objects.CRnoreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-91390096515879492502007-09-17T16:30:37.000-07:002007-09-17T16:30:37.000-07:00Allen, do you consider to implement mixins in Tibu...Allen, do you consider to implement mixins in Tiburon time frame and also to provide the possibility that those mixins to be parameterized? (ie. to implement a parameterized/generic mixin)m. Th.noreply@blogger.comtag:blogger.com,1999:blog-2428374771421713311.post-91463200409214591292007-11-12T20:13:37.000-08:002007-11-12T20:13:37.000-08:00Great!Once this is through Im sure some enterprisi...Great!<br>Once this is through Im sure some enterprising individual will reimplement the STL for delphi, bringing up Delphi development up a notch to rub shoulders with C++Vivek Nnoreply@blogger.com