Re: UFCS for D

2012-03-30 Thread Nathan M. Swan
On Thursday, 29 March 2012 at 00:21:38 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/rif9x/uniform_function_call_syntax_for_the_d/ Andrei The primitives/utility distinction is an idea I've thought about a lot. UFCS is justifiable not only as a syntactic

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 04:05, Nick Sabalausky wrote: Walter Brightnewshou...@digitalmars.com wrote in message True, but I upgraded recently to 64 bit Win 7, with a 6 core processor and SSD drive. Reddit seems a lot zippier :-) I don't understand why people think it's ok for basic, basic shit that

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/29/2012 6:57 PM, Nick Sabalausky wrote: How the heck does that improve encapsualtion? With D's implicit friends, it *doesn't*, it's just shifting things around. There is NO encapsualtion benefit there. Like Steven said, to *get* the encapsualtion, you have to create a whole new module to

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/29/2012 7:05 PM, Nick Sabalausky wrote: I don't understand why people think it's ok for basic, basic shit that would have ran fine on a Pentium 1 (and less) to now require what quite literally is a super-fucking-computer-on-the-desktop just to run acceptably. Seriously, what the fuck's the

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:jl3kkf$j4b$1...@digitalmars.com... On 3/29/2012 6:57 PM, Nick Sabalausky wrote: How the heck does that improve encapsualtion? With D's implicit friends, it *doesn't*, it's just shifting things around. There is NO encapsualtion

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Jacob Carlborg d...@me.com wrote in message news:jl3kar$ie4$1...@digitalmars.com... On 2012-03-30 04:05, Nick Sabalausky wrote: Walter Brightnewshou...@digitalmars.com wrote in message True, but I upgraded recently to 64 bit Win 7, with a 6 core processor and SSD drive. Reddit seems a lot

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:jl3n59$qf7$1...@digitalmars.com... Jacob Carlborg d...@me.com wrote in message news:jl3kar$ie4$1...@digitalmars.com... On 2012-03-30 04:05, Nick Sabalausky wrote: Walter Brightnewshou...@digitalmars.com wrote in message True, but I upgraded

Re: UFCS for D

2012-03-30 Thread Timon Gehr
On 03/30/2012 01:45 AM, bearophile wrote: Timon Gehr: I think the article does not mention that it also works for primitive types. But there is a small problem with primitive properties: http://d.puremagic.com/issues/show_bug.cgi?id=7773 Bye, bearophile Yes, I have never understood why

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/30/2012 12:18 AM, Nick Sabalausky wrote: While there are definitely times I need to access private state across separate components within a module, I find such cases are fairly uncommon, so I question the wisdom of making it the default behavior. If your module has grown so large that

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:jl3l0c$jn2$1...@digitalmars.com... On 3/29/2012 7:05 PM, Nick Sabalausky wrote: I don't understand why people think it's ok for basic, basic shit that would have ran fine on a Pentium 1 (and less) to now require what quite

Re: UFCS for D

2012-03-30 Thread dennis luehring
or just use http://cdburnerxp.se/ Am 30.03.2012 10:30, schrieb Nick Sabalausky: Walter Brightnewshou...@digitalmars.com wrote in message news:jl3l0c$jn2$1...@digitalmars.com... On 3/29/2012 7:05 PM, Nick Sabalausky wrote: I don't understand why people think it's ok for basic, basic shit

Re: UFCS for D

2012-03-30 Thread Andrej Mitrovic
On 3/30/12, Walter Bright newshou...@digitalmars.com wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Ignoring that there are still a few import bugs, you can split functionality into multiple modules and

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:jl3qds$10ga$1...@digitalmars.com... On 3/30/2012 12:18 AM, Nick Sabalausky wrote: While there are definitely times I need to access private state across separate components within a module, I find such cases are fairly uncommon,

Re: UFCS for D

2012-03-30 Thread bls
On 03/30/2012 02:15 AM, Nick Sabalausky wrote: Eh? Other people have voiced concerns over that since waaay back in even pre-D1 times. In particular, many people have argued for allowing modules with the same name as a package. Ie: you could have both module foo and module foo.bar. This is

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/30/2012 2:15 AM, Nick Sabalausky wrote: Andrei and I have talked about it, and we think it is because of difficulties in breaking a module up into submodules of a package. We think it's something we need to address. Eh? Other people have voiced concerns over that since waaay back in even

Re: UFCS for D

2012-03-30 Thread foobar
On Friday, 30 March 2012 at 01:55:23 UTC, Nick Sabalausky wrote: Yea, that occurred to me, too. wishful musingI've been starting to think more and more that the everything in a module is a friend was a mistake, and that we should have instead just had a module access specifier like we have

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 02:42:03 -0400, Walter Bright newshou...@digitalmars.com wrote: On 3/29/2012 6:57 PM, Nick Sabalausky wrote: How the heck does that improve encapsualtion? With D's implicit friends, it *doesn't*, it's just shifting things around. There is NO encapsualtion benefit there.

Re: UFCS for D

2012-03-30 Thread foobar
On Friday, 30 March 2012 at 10:22:18 UTC, Walter Bright wrote: On 3/30/2012 2:15 AM, Nick Sabalausky wrote: Andrei and I have talked about it, and we think it is because of difficulties in breaking a module up into submodules of a package. We think it's something we need to address. Eh?

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 04:21:12 -0400, Nick Sabalausky a@a.a wrote: Nick Sabalausky a@a.a wrote in message news:jl3n59$qf7$1...@digitalmars.com... Yea, I've seen that. It's a very good article, though. Although I've been saying this since before that article, and even before multi-cores.

Re: UFCS for D

2012-03-30 Thread Piotr Szturmaj
Walter Bright wrote: On 3/29/2012 5:09 PM, Steven Schveighoffer wrote: The reason being, if you change anything in class A, you do not have to worry about the implementation of getXSquared, because it simply has no access to the private implementation. You only have to worry about internal

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 10:20, Walter Bright wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Andrei and I have talked about it, and we think it is because of difficulties in breaking a module up into submodules of a

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 11:40, bls a écrit : On 03/30/2012 02:15 AM, Nick Sabalausky wrote: Eh? Other people have voiced concerns over that since waaay back in even pre-D1 times. In particular, many people have argued for allowing modules with the same name as a package. Ie: you could have both module

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 12:57, foobar a écrit : On Friday, 30 March 2012 at 10:22:18 UTC, Walter Bright wrote: On 3/30/2012 2:15 AM, Nick Sabalausky wrote: Andrei and I have talked about it, and we think it is because of difficulties in breaking a module up into submodules of a package. We think it's

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 01:34, Steven Schveighoffer a écrit : On Wed, 28 Mar 2012 21:53:57 -0400, Jesse Phillips jessekphillip...@gmail.com wrote: I won't be going out of my way to check this, but there is a mention of adding the range primatives. This works, but it doesn't make the class a range for

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 10:36, Andrej Mitrovic wrote: On 3/30/12, Walter Brightnewshou...@digitalmars.com wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Ignoring that there are still a few import bugs, you can

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 04:13, Adam D. Ruppe a écrit : On Friday, 30 March 2012 at 01:55:23 UTC, Nick Sabalausky wrote: wishful musingI've been starting to think more and more that the everything in a module is a friend was a mistake,and that we should have instead just had a module access specifier like

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 08:10:14 -0400, deadalnix deadal...@gmail.com wrote: I would expect this not to work, because bar isn't defined in module1 and template are supposed to use declaration scope, not instantiation scope (unless it is mixin template). Right, I think it's the way it works

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 11:15, Nick Sabalausky wrote: I thought that was a deliberate Phobos style convention. I'm certain I remember you and/or Andrei talking here about a year or two ago about how you didn't want Phobos modules broken up into separate implemetation modules. I recognize that as well.

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 14:13, Steven Schveighoffer a écrit : On Fri, 30 Mar 2012 08:10:14 -0400, deadalnix deadal...@gmail.com wrote: I would expect this not to work, because bar isn't defined in module1 and template are supposed to use declaration scope, not instantiation scope (unless it is mixin

Re: UFCS for D

2012-03-30 Thread bls
On 03/30/2012 05:06 AM, deadalnix wrote: Le 30/03/2012 11:40, bls a écrit : On 03/30/2012 02:15 AM, Nick Sabalausky wrote: Eh? Other people have voiced concerns over that since waaay back in even pre-D1 times. In particular, many people have argued for allowing modules with the same name as a

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 08:22:12 -0400, deadalnix deadal...@gmail.com wrote: Le 30/03/2012 14:13, Steven Schveighoffer a écrit : On Fri, 30 Mar 2012 08:10:14 -0400, deadalnix deadal...@gmail.com wrote: I would expect this not to work, because bar isn't defined in module1 and template are

Re: UFCS for D

2012-03-30 Thread Adam D. Ruppe
On Friday, 30 March 2012 at 11:21:02 UTC, Steven Schveighoffer wrote: 4. Blow in bottom of cartridge, even though the pins are clean and free of dust (did this actually ever do anything?) My hypothesis is it was actually the moisture that made a better connection. I'd like to test this now...

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 14:07, deadalnix wrote: all.d this the de facto standard here. I think it should become an official guideline. Why can't we get import foo.*;, then we don't have to relay on guidelines. -- /Jacob Carlborg

Re: UFCS for D

2012-03-30 Thread Adam D. Ruppe
On Friday, 30 March 2012 at 12:10:32 UTC, deadalnix wrote: For the ease of distribution, you can use a module with public import in it. There's still a few things I don't like though, about downloading and compiling several modules. When it is just one, you can download the single file and

Re: UFCS for D

2012-03-30 Thread Andrei Alexandrescu
On 3/30/12 3:20 AM, Walter Bright wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Andrei and I have talked about it, and we think it is because of difficulties in breaking a module up into submodules of a

Re: UFCS for D

2012-03-30 Thread deadalnix
Le 30/03/2012 16:24, Andrei Alexandrescu a écrit : On 3/30/12 3:20 AM, Walter Bright wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Andrei and I have talked about it, and we think it is because of

Re: UFCS for D

2012-03-30 Thread Jacob Carlborg
On 2012-03-30 16:17, Adam D. Ruppe wrote: On Friday, 30 March 2012 at 12:10:32 UTC, deadalnix wrote: For the ease of distribution, you can use a module with public import in it. There's still a few things I don't like though, about downloading and compiling several modules. When it is just

Re: UFCS for D

2012-03-30 Thread Andrei Alexandrescu
On 3/30/12 9:32 AM, deadalnix wrote: Le 30/03/2012 16:24, Andrei Alexandrescu a écrit : On 3/30/12 3:20 AM, Walter Bright wrote: There has been a trend in Phobos of having some truly gigantic modules. I believe this is indicative of a problem in the language. Andrei and I have talked about it,

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 10:39:09 -0400, Jacob Carlborg d...@me.com wrote: On 2012-03-30 14:52, Steven Schveighoffer wrote: Why would there be ambiguities? Unlike C include files, D modules are consistently compiled, unaffected by importing other modules. What about static-if and string mixins?

Re: UFCS for D

2012-03-30 Thread Steven Schveighoffer
On Fri, 30 Mar 2012 10:48:04 -0400, deadalnix deadal...@gmail.com wrote: Le 30/03/2012 14:52, Steven Schveighoffer a écrit : On Fri, 30 Mar 2012 08:22:12 -0400, deadalnix deadal...@gmail.com wrote: Immagine you want to define your own to!xxx() for your type xxx. (It is dumb case because you

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/29/2012 4:34 PM, Steven Schveighoffer wrote: But I realized after typing about 2 messages in response to this (and deleting them), you are right, there is a fundamental problem here. Because the template instantiation is based solely on the type. It does *not* include the type and whatever

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Jacob Carlborg d...@me.com wrote in message news:jl4d2e$24i1$1...@digitalmars.com... On 2012-03-30 14:07, deadalnix wrote: all.d this the de facto standard here. I think it should become an official guideline. Why can't we get import foo.*;, then we don't have to relay on guidelines. The

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/30/2012 12:11 PM, Steven Schveighoffer wrote: On Fri, 30 Mar 2012 14:27:43 -0400, Walter Bright newshou...@digitalmars.com wrote: I would argue that: 3. An extension method for an argument of type template parameter T will be looked up only in the instantiation scope. I don't think

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.wbzdtbo0eav7ka@localhost.localdomain... On Fri, 30 Mar 2012 04:21:12 -0400, Nick Sabalausky a@a.a wrote: Nick Sabalausky a@a.a wrote in message news:jl3n59$qf7$1...@digitalmars.com... Of course, I don't expect software to be

Re: UFCS for D

2012-03-30 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:udpabjwyzxlollbiz...@forum.dlang.org... On Friday, 30 March 2012 at 11:21:02 UTC, Steven Schveighoffer wrote: 4. Blow in bottom of cartridge, even though the pins are clean and free of dust (did this actually ever do anything?)

OT: video games (was Re: UFCS for D)

2012-03-30 Thread Adam D. Ruppe
On Friday, 30 March 2012 at 21:03:21 UTC, Nick Sabalausky wrote: Problem is, it also corrodes the connectors. Yea. But oh well, it can't be too bad... my old games all still work! Though, nowadays I tend to prefer the emulators. I have a playstation controller on usb, which works for all the

Re: UFCS for D

2012-03-30 Thread Piotr Szturmaj
Walter Bright wrote: On 3/30/2012 4:24 AM, Piotr Szturmaj wrote: Walter Bright wrote: I think it's far superior to the explicit friend thing in C++. Just curious. Did you take it from Delphi? :-) No. I've never looked at Delphi in detail. But in any case, for any language feature, there's

Re: video games (was Re: UFCS for D)

2012-03-30 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:ftnddrqdfbrtxiiwe...@forum.dlang.org... On Friday, 30 March 2012 at 21:03:21 UTC, Nick Sabalausky wrote: Problem is, it also corrodes the connectors. Yea. But oh well, it can't be too bad... my old games all still work! Though,

Re: video games (was Re: UFCS for D)

2012-03-30 Thread Bernard Helyer
Eeewww, I hate playing games on a PC: - Too many other processes to screw up the experience. Maybe if you were basing your experiences off of Windows 95. - I spent sooo many hours every day *working* at the computer desk, I *don't* want to be be glued to it for my entertainment, too. -

Re: UFCS for D

2012-03-30 Thread Walter Bright
On 3/30/2012 12:36 PM, Walter Bright wrote: On 3/30/2012 12:11 PM, Steven Schveighoffer wrote: On Fri, 30 Mar 2012 14:27:43 -0400, Walter Bright newshou...@digitalmars.com wrote: I would argue that: 3. An extension method for an argument of type template parameter T will be looked up only

Re: video games (was Re: UFCS for D)

2012-03-30 Thread Adam D. Ruppe
On Friday, 30 March 2012 at 22:43:00 UTC, Nick Sabalausky wrote: Oh *definitely*. BTW, Wii homebrew is *fantastic* for that. I don't have one of those thingys though. But that would *never* happen under US-style IP law. You know what's funny: I used to use an Atari ac adapter for my Sega.

Re: video games (was Re: UFCS for D)

2012-03-30 Thread Nick Sabalausky
Bernard Helyer b.hel...@gmail.com wrote in message news:jiioyfihtaqhpjafg...@forum.dlang.org... Eeewww, I hate playing games on a PC: - Too many other processes to screw up the experience. Maybe if you were basing your experiences off of Windows 95. Actually, it was pretty good back then,