digitalmars.D - 'partial' keyword in C# is very good for project ,what's the same
- FrankLike (6/6) Oct 29 2014 Hello,everyone,
- Paulo Pinto (2/8) Oct 29 2014 Maybe mixins might be a possibility.
- Regan Heath (23/32) Oct 29 2014 Something like..
- FrankLike (4/24) Oct 29 2014 The same thing in D should be done,now.Otherwise,no big projects
- FrankLike (0/13) Oct 29 2014
- ketmar via Digitalmars-d (3/5) Oct 29 2014 just don't write in D "like C#". that's it.
- Gary Willoughby (5/8) Oct 29 2014 Large projects are already being developed using D so your
- Walter Bright (2/9) Oct 29 2014 Either string mixins, template mixins, alias this or opDispatch.
- andre (14/28) Oct 30 2014 From some little tests I can say only string mixins are working
- Dejan Lekic (7/10) Oct 31 2014 This certainly made me laugh... I work on a very big project
- ketmar via Digitalmars-d (7/20) Oct 31 2014 each new generation of programmers tend to believe that there will be
- Paulo Pinto (8/19) Oct 31 2014 No human uses partial classes in .NET land other than the tools
- FrankLike (2/9) Oct 31 2014 Very good,It makes your code look very simple , nice and cool.
- Wyatt (4/8) Oct 31 2014 Does the inverse of the Turing test have a name? How am I
- ketmar via Digitalmars-d (3/13) Oct 31 2014 just show him IOCCC. he will never return. ;-)
- Regan Heath (15/17) Nov 10 2014 Sure, but that's not the point of partial. It's almost never used by th...
- FrankLike (6/19) Nov 10 2014 It's right, it's just a good idea for D.
- Jacob Carlborg (4/7) Nov 10 2014 Template mixins can be used instead. Looks a lot better.
- Andre (18/26) Nov 10 2014 One requirement for a partial alternative is, that the generated
- Gary Willoughby (3/5) Nov 10 2014 Yes, like this:
- deadalnix (3/20) Nov 10 2014 I don't get how the same can't be achieved with mixin template
- Regan Heath (6/28) Nov 12 2014 Someone raised concerns.. I haven't looked into it myself. If it can,
- Andrea Fontana (3/7) Oct 31 2014 I wonder how linux was written in c.
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (8/10) Oct 31 2014 Finns are hardcore.
- eles (4/14) Oct 31 2014 Caught in the act...
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (4/6) Oct 31 2014 Nice! He's got a sauna at home too. And he does "management by
- deadalnix (4/16) Oct 31 2014 They are out of control
- deadalnix (2/8) Oct 29 2014 What does it do ?
- Jacob Carlborg (7/8) Oct 30 2014 It lets you split the implementation of a class between multiple source
- FrankLike (4/11) Nov 08 2014 It's a good thing for editing codes.
- Kagamin (5/5) Oct 31 2014 I work on a big C# project with forms and controls designed in
- tcak (3/9) Nov 01 2014 We never used partial before. So you don't/shouldn't need it as
Hello,everyone, very userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.
Oct 29 2014
On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:Hello,everyone, is very userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.Maybe mixins might be a possibility.
Oct 29 2014
On Wed, 29 Oct 2014 07:54:39 -0000, Paulo Pinto <pjmlp progtools.org> wrote:On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:Something like.. class Foo { mixin(import("auto-generated.d")); } where auto-generated.d has class members/methods but no "class Foo" itself. code and user code into a single class. So, the Windows GUI builder does it placing all the GUI component construction and property setting in one file, and allowing the user to only have to see/edit the application level code in another file. Likewise LINQ to SQL generates a custom DataContext child class, and the user can optionally create a 2nd file with the partial class to extend it. compiler generated empty body. They are not virtual as you cannot call a base.method() from method(), instead you optionally implement the method and if you don't it does nothing. LINQ to SQL uses these for insert/update/delete events for each table in your database. R -- Using Opera's revolutionary email client: http://www.opera.com/mail/Hello,everyone, userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.Maybe mixins might be a possibility.
Oct 29 2014
On Wednesday, 29 October 2014 at 10:25:54 UTC, Regan Heath wrote:On Wed, 29 Oct 2014 07:54:39 -0000, Paulo Pinto <pjmlp progtools.org> wrote:On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:Hello,everyone, is very userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.auto-generated code and user code into a single class. So, the Windows GUI builder does it placing all the GUI component construction and property setting in one file, and allowing the user to only have to see/edit the application level code in another file. Likewise LINQ to SQL generates a custom DataContext child class, and the user can optionally create a 2nd file with the partial class to extend it.RThe same thing in D should be done,now.Otherwise,no big projects FrankLike
Oct 29 2014
auto-generated code and user code into a single class. So, the Windows GUI builder does it placing all the GUI component construction and property setting in one file, and allowing the user to only have to see/edit the application level code in another file. Likewise LINQ to SQL generates a custom DataContext child class, and the user can optionally create a 2nd file with the partial class to extend it.RThe same thing in D should be done,now.Otherwise,no big keyword,and update the compiler. FrankLike
Oct 29 2014
On Wed, 29 Oct 2014 12:58:28 +0000 FrankLike via Digitalmars-d <digitalmars-d puremagic.com> wrote:The same thing in D should be done,now.Otherwise=EF=BC=8Cno big=20
Oct 29 2014
On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:The same thing in D should be done,now.Otherwise,no big the compiler.Large projects are already being developed using D so your argument is wrong. Also no new keywords are being added to the language because D is trying to achieve stability right now. You can achieve what you desire using mixins.
Oct 29 2014
On 10/29/2014 7:01 AM, Gary Willoughby wrote:On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:Either string mixins, template mixins, alias this or opDispatch.The same thing in D should be done,now.Otherwise,no big projects can be doneLarge projects are already being developed using D so your argument is wrong. Also no new keywords are being added to the language because D is trying to achieve stability right now. You can achieve what you desire using mixins.
Oct 29 2014
From some little tests I can say only string mixins are working for the GUI builder scenario. The concrete class contains private ui controls (members). The gui builder framework needs to access these private members to call their constructors, and set their values to the last persisted state. template mixins aren't able to access these private members. I also think alias this and opDispatch do not help here. string mixins working perfectly. partial would be a really nice feature but I also doubt that it will come with D2. Kind regards André On Wednesday, 29 October 2014 at 23:23:40 UTC, Walter Bright wrote:On 10/29/2014 7:01 AM, Gary Willoughby wrote:On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:Either string mixins, template mixins, alias this or opDispatch.The same thing in D should be done,now.Otherwise,no big projects can be doneLarge projects are already being developed using D so your argument is wrong. Also no new keywords are being added to the language because D is trying to achieve stability right now. You can achieve what you desire using mixins.
Oct 30 2014
On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:The same thing in D should be done,now.Otherwise,no big the compiler.This certainly made me laugh... I work on a very big project does not have it. :) Even if it does we would not use it as we prefer our classes to be in a single file. In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"?
Oct 31 2014
On Fri, 31 Oct 2014 09:30:25 +0000 Dejan Lekic via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:each new generation of programmers tend to believe that there will be no success to languages other than that one they learned unless other languages becomes feature-to-feature clones of The One Language. it's ok, they will learn other languages sooner or later and will start to hate them all. ;-)The same thing in D should be done,now.Otherwise=EF=BC=8Cno big=20 the compiler.=20 This certainly made me laugh... I work on a very big project=20 does not have it. :) Even if it does we would not use it as we=20 prefer our classes to be in a single file. =20 In D apps I work on I prefer all my classes in a single module,=20 as is common "D way", or shall I call it "modular way"?
Oct 31 2014
On Friday, 31 October 2014 at 09:30:26 UTC, Dejan Lekic wrote:On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:No human uses partial classes in .NET land other than the tools themselves. It is a language feature introduced to simplify how Visual Studio supports round-trip editing of UI code in its designers, instead of relying in metadata files. -- PauloThe same thing in D should be done,now.Otherwise,no big the compiler.This certainly made me laugh... I work on a very big project does not have it. :) Even if it does we would not use it as we prefer our classes to be in a single file. In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"?
Oct 31 2014
No human uses partial classes in .NET land other than the tools themselves. It is a language feature introduced to simplify how Visual Studio supports round-trip editing of UI code in its designers, instead of relying in metadata files. -- PauloVery good,It makes your code look very simple , nice and cool. Frank
Oct 31 2014
On Friday, 31 October 2014 at 12:54:30 UTC, FrankLike wrote:Does the inverse of the Turing test have a name? How am I supposed to react when a human passes it? ;) -WyattNo human uses partial classes in .NET land other than the tools themselves.Very good,It makes your code look very simple , nice and cool.
Oct 31 2014
On Fri, 31 Oct 2014 13:45:37 +0000 Wyatt via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Friday, 31 October 2014 at 12:54:30 UTC, FrankLike wrote:just show him IOCCC. he will never return. ;-)Does the inverse of the Turing test have a name? How am I=20 supposed to react when a human passes it? ;)No human uses partial classes in .NET land other than the=20 tools themselves.Very good,It makes your code look very simple =EF=BC=8C nice and cool.
Oct 31 2014
On Fri, 31 Oct 2014 09:30:25 -0000, Dejan Lekic <dejan.lekic gmail.com> wrote:In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"?Sure, but that's not the point of partial. It's almost never used by the programmer directly, and when it is used you almost never need to look at the generated partial class code as "it just works". So, you effectively get what you "prefer" but you also get clean separation between generated and user code, which is very important if the generated code needs to be re-generated and it also means the user code stays simpler, cleaner and easier to work with. Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing. R -- Using Opera's revolutionary email client: http://www.opera.com/mail/
Nov 10 2014
On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote:Sure, but that's not the point of partial. It's almost never used by the programmer directly, and when it is used you almost never need to look at the generated partial class code as "it just works". So, you effectively get what you "prefer" but you also get clean separation between generated and user code, which is very important if the generated code needs to be re-generated and it also means the user code stays simpler, cleaner and easier to work with. Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing. RIt's right, it's just a good idea for D. I love D ,and hope it 'the user code stays simpler, cleaner and easier to work with.'. Thank you. Frank
Nov 10 2014
On 2014-11-10 11:21, Regan Heath wrote:Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing.Template mixins can be used instead. Looks a lot better. -- /Jacob Carlborg
Nov 10 2014
One requirement for a partial alternative is, that the generated coding can access private member of the actual class as they are in most GUI framework private members of the class. class Example { private Button b; private ComboBox cb; } The GUI framework takes care about calling their constructors and also about persisting their design time values (values you read and write in the GUI builder). Is there any possibility to access private members by using Template Mixins? As far as I can see only String Mixins are able to access private members of the scope they are inserted to. Kind regards André On Monday, 10 November 2014 at 14:38:58 UTC, Jacob Carlborg wrote:On 2014-11-10 11:21, Regan Heath wrote:Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing.Template mixins can be used instead. Looks a lot better.
Nov 10 2014
On Monday, 10 November 2014 at 16:44:53 UTC, Andre wrote:Is there any possibility to access private members by using Template Mixins?Yes, like this: https://github.com/nomad-software/tkd/blob/master/source/tkd/widget/common/value.d
Nov 10 2014
On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote:On Fri, 31 Oct 2014 09:30:25 -0000, Dejan Lekic <dejan.lekic gmail.com> wrote:I don't get how the same can't be achieved with mixin template for instance.In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"?Sure, but that's not the point of partial. It's almost never used by the programmer directly, and when it is used you almost never need to look at the generated partial class code as "it just works". So, you effectively get what you "prefer" but you also get clean separation between generated and user code, which is very important if the generated code needs to be re-generated and it also means the user code stays simpler, cleaner and easier to work with. Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing. R
Nov 10 2014
On Mon, 10 Nov 2014 18:09:12 -0000, deadalnix <deadalnix gmail.com> wrote:On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote:Someone raised concerns.. I haven't looked into it myself. If it can, great :) R -- Using Opera's revolutionary email client: http://www.opera.com/mail/On Fri, 31 Oct 2014 09:30:25 -0000, Dejan Lekic <dejan.lekic gmail.com> wrote:I don't get how the same can't be achieved with mixin template for instance.In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"?Sure, but that's not the point of partial. It's almost never used by the programmer directly, and when it is used you almost never need to look at the generated partial class code as "it just works". So, you effectively get what you "prefer" but you also get clean separation between generated and user code, which is very important if the generated code needs to be re-generated and it also means the user code stays simpler, cleaner and easier to work with. Basically it's just a good idea(TM). Unfortunately as many have said, it's not something D2.0 is likely to see. String mixins aren't the nicest thing to use, but at least they can achieve the same/similar thing. R
Nov 12 2014
On Wednesday, 29 October 2014 at 12:55:01 UTC, FrankLike wrote:The same thing in D should be done,now.Otherwise,no big the compiler. FrankLikeI wonder how linux was written in c. I think it's a rather big project to do without partial keyword.
Oct 31 2014
On Friday, 31 October 2014 at 13:50:30 UTC, Andrea Fontana wrote:I wonder how linux was written in c. I think it's a rather big project to do without partial keyword.Finns are hardcore. They drink a lot. They swear a lot. And they bathe in snow after taking a whipping. Naked… And they like it… Only Linus can create Linux without partial.
Oct 31 2014
On Friday, 31 October 2014 at 13:57:40 UTC, Ola Fosheim Grøstad wrote:On Friday, 31 October 2014 at 13:50:30 UTC, Andrea Fontana wrote:Caught in the act... http://www.freogan.org/wp-content/uploads/2009/12/linus-torvald-speedo-300x255.jpgI wonder how linux was written in c. I think it's a rather big project to do without partial keyword.Finns are hardcore. They drink a lot. They swear a lot. And they bathe in snow after taking a whipping. Naked…
Oct 31 2014
On Friday, 31 October 2014 at 14:03:04 UTC, eles wrote:Caught in the act... http://www.freogan.org/wp-content/uploads/2009/12/linus-torvald-speedo-300x255.jpgNice! He's got a sauna at home too. And he does "management by cursing": http://en.wikipedia.org/wiki/Management_by_perkele
Oct 31 2014
On Friday, 31 October 2014 at 13:57:40 UTC, Ola Fosheim Grøstad wrote:On Friday, 31 October 2014 at 13:50:30 UTC, Andrea Fontana wrote:They are out of control https://www.youtube.com/watch?v=VWHfiEKK3zwI wonder how linux was written in c. I think it's a rather big project to do without partial keyword.Finns are hardcore. They drink a lot. They swear a lot. And they bathe in snow after taking a whipping. Naked… And they like it… Only Linus can create Linux without partial.
Oct 31 2014
On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:Hello,everyone, is very userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.What does it do ?
Oct 29 2014
On 2014-10-30 00:00, deadalnix wrote:What does it do ?It lets you split the implementation of a class between multiple source codes, i.e. a GUI builder. You have the generated part of the class in one file and the code that is manually edited in another file. -- /Jacob Carlborg
Oct 30 2014
On Thursday, 30 October 2014 at 07:20:24 UTC, Jacob Carlborg wrote:On 2014-10-30 00:00, deadalnix wrote:It's a good thing for editing codes. FrankWhat does it do ?It lets you split the implementation of a class between that generate some codes, i.e. a GUI builder. You have the generated part of the class in one file and the code that is manually edited in another file.
Nov 08 2014
both ways: some are split into partial classes, some mix generated code with user code. Can't remember any issue with it, and difference is visible only when you realize, that the code is indeed in the same file, which may or may not happen.
Oct 31 2014
On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:Hello,everyone, is very userful,which lets the auto codes in another single file,my codes are very easy to update. But what the same thing in D? Thank you,every one.We never used partial before. So you don't/shouldn't need it as well. /s
Nov 01 2014