Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig
Brad Roberts escribió: Brad Roberts wrote: Ary Borenszweig wrote: Bill Baxter escribió: Another question -- I was wondering what it does for CTFE functions. I'm guessing it evaluates them and spits out the result. If so that could be very very helpful. Especially for code-building CTFE

Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig
Ary Borenszweig escribió: The Descent plugin for Eclipse provides an IDE for writing, launching and debugging code in D. Explanations on how to get it from within Eclipse are here: http://www.dsource.org/projects/descent New features: - Compile-time view (Window - Show View - Other - D -

Re: Descent 0.5.4 released

2009-01-28 Thread Qian Xu
Ary Borenszweig wrote: The Descent plugin for Eclipse provides an IDE for writing, launching and debugging code in D. This build is not compatible with Eclipse3.3 und SuseEnt10(SP2) as well. When I press CTRL+Space, I will see an error message:

Re: Descent 0.5.4 released

2009-01-28 Thread Don
Ary Borenszweig wrote: Brad Roberts escribió: Brad Roberts wrote: Ary Borenszweig wrote: Bill Baxter escribió: Another question -- I was wondering what it does for CTFE functions. I'm guessing it evaluates them and spits out the result. If so that could be very very helpful. Especially for

Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig
Daniel Keep wrote: Ary Borenszweig wrote: [snip] Wow! Thanks for the joyful answer, Daniel. :-) The attachment you sent doesn't compile, it gives a syntax error in the mixed content for the IsExpression (only a type is allowed, not this.). Anyway, I'll change the

DMD-MAC!!

2009-01-28 Thread BCS
http://dobbscodetalk.com/index.php?option=com_contenttask=viewid=1015Itemid=

Re: QtD. first results.

2009-01-28 Thread Walter Bright
Eldar Insafutdinov wrote: The main issue is that signals and slots and therefore event-handling in toolkit is not implemented. So it means that it is not really useful right now. But still we decide that it will be better than announce that not, to let people know that some work is going on.

Re: QtD. first results.

2009-01-28 Thread Bill Baxter
2009/1/29 Eldar Insafutdinov e.insafutdi...@gmail.com: Added some screenshots. http://code.google.com/p/qtd/wiki/Screenshots Way to go! I can hear motivation levels rising already. --bb

Re: QtD. first results.

2009-01-28 Thread Eldar Insafutdinov
Walter Bright Wrote: Eldar Insafutdinov wrote: The main issue is that signals and slots and therefore event-handling in toolkit is not implemented. So it means that it is not really useful right now. But still we decide that it will be better than announce that not, to let people know

Re: Descent 0.5.4 released

2009-01-28 Thread Ary Borenszweig
Jason House escribió: Ary Borenszweig wrote: New features: - Compile-time view This is a great feature that I've been looking forward to. When playing around with this, I noticed a few things that seemed odd to me. They may be normal/expected if I understood the better how the front

Re: Compiler as dll

2009-01-28 Thread John Reimer
Hello Yigal, Walter Bright wrote: I've done the compiler-as-dll thing for the Digital Mars IDE. It has some problems, though. The biggest is it's another executable to test, doubling the testing process. It could be done as one executable by making a shell that calls the dll, but those are

Re: ch-ch-changes

2009-01-28 Thread Don
Andrei Alexandrescu wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started. Ranges and concepts really make for beautiful code, and I am sure pretty

Re: ch-ch-changes

2009-01-28 Thread Denis Koroskin
On Wed, 28 Jan 2009 12:07:16 +0300, Nick Sabalausky a...@a.a wrote: Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:gloppm$1vo...@digitalmars.com... Jarrett Billingsley wrote: On Tue, Jan 27, 2009 at 11:15 PM, Andrei Alexandrescu [...] Feedback welcome. This is

Re: ch-ch-changes

2009-01-28 Thread Bill Baxter
On Wed, Jan 28, 2009 at 6:07 PM, Nick Sabalausky a...@a.a wrote: Isn't tail the standard counterpart to head? (toe just doesn't sound good) Tail has a history of being used to mean everything but head in functional programming languages like Haskel and ML. So of back, last, end, tail, rear,

Re: ch-ch-changes

2009-01-28 Thread Don
Denis Koroskin wrote: On Wed, 28 Jan 2009 12:07:16 +0300, Nick Sabalausky a...@a.a wrote: Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:gloppm$1vo...@digitalmars.com... Jarrett Billingsley wrote: On Tue, Jan 27, 2009 at 11:15 PM, Andrei Alexandrescu [...] Feedback

Re: Compiler as dll

2009-01-28 Thread grauzone
John Reimer wrote: ddl does not work for memory sharing like normal dll's, where multiple applications have access to a single dll at runtime. It appears that such support would be quite difficult to implement and moves in the direction of operating system features. Couldn't this be

Re: ch-ch-changes

2009-01-28 Thread Denis Koroskin
On Wed, 28 Jan 2009 07:15:25 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started.

Re: ch-ch-changes

2009-01-28 Thread Denis Koroskin
On Wed, 28 Jan 2009 12:52:03 +0300, Denis Koroskin 2kor...@gmail.com wrote: On Wed, 28 Jan 2009 07:15:25 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm

Re: ch-ch-changes

2009-01-28 Thread grauzone
One thing about std.algorithm: you really seem to like using compile-time strings as literals. However, this makes the use of delegates harder. For example, to use a delegate, you need to do this (quoted from your docs): int[] a = ...; static bool greater(int a, int b) { return a b;

Re: Compiler as dll

2009-01-28 Thread Mike Parker
grauzone wrote: When it's a commercial program, the DLL plugin approach probably wouldn't work anyway: in order to enable others to compile plugins, you would need to expose your internal headers (D modules). Note that This is exactly what id software did with their Quake games. They

Re: Compiler as dll

2009-01-28 Thread Daniel Keep
grauzone wrote: John Reimer wrote: ddl does not work for memory sharing like normal dll's, where multiple applications have access to a single dll at runtime. It appears that such support would be quite difficult to implement and moves in the direction of operating system features.

Re: Compiler as dll

2009-01-28 Thread grauzone
Alexander Pánek wrote: grauzone wrote: John Reimer wrote: ddl does not work for memory sharing like normal dll's, where multiple applications have access to a single dll at runtime. It appears that such support would be quite difficult to implement and moves in the direction of operating

Re: ch-ch-changes

2009-01-28 Thread bearophile
bearophile: My dlibs (for D1) use closures, I meant function pointers or delegates, sorry. Also note that two of the most commonly used higher-order functions, that is map/xmap/filter/xfilter can be replaced by a more handy (and often more efficient) lazy/eager array/iterable compr. I hope

Re: D to C compiler?

2009-01-28 Thread Wolfgang Draxinger
Nicolay Korslund wrote: I remember reading something about a D to C compiler on this group a few years ago. (I'm not really a regular here anymore, so there might have been more recent mentions that I've missed.) Does anyone know if there's any such project still around that's alive or could

Re: ch-ch-changes

2009-01-28 Thread Don
grauzone wrote: One thing about std.algorithm: you really seem to like using compile-time strings as literals. However, this makes the use of delegates harder. For example, to use a delegate, you need to do this (quoted from your docs): int[] a = ...; static bool greater(int a, int b)

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Don wrote: Andrei Alexandrescu wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started. Ranges and concepts really make for beautiful code, and I am

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Denis Koroskin wrote: On Wed, 28 Jan 2009 07:15:25 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected

Re: Compiler as dll

2009-01-28 Thread Sandeep Kakarlapudi
Yigal Chripun Wrote: the compiler itself could (and should) use it - currently there's a built in interpreter for CTFE which is limited to a subset of D. instead of implementing a limited interpreter in addition to the compiler, the compiler libs can easily be utilized for a JIT compiler

Re: ch-ch-changes

2009-01-28 Thread Don
Andrei Alexandrescu wrote: Don wrote: Andrei Alexandrescu wrote: I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started. Ranges and concepts really make

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
grauzone wrote: One thing about std.algorithm: you really seem to like using compile-time strings as literals. However, this makes the use of delegates harder. For example, to use a delegate, you need to do this (quoted from your docs): int[] a = ...; static bool greater(int a, int b)

Re: ch-ch-changes

2009-01-28 Thread Max Samukha
On Wed, 28 Jan 2009 06:01:29 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: The thing is, passing by alias allows you a host of options: * string for short functions * function name * delegate literal * delegate object (there's a bug in the compiler related to that, that Walter

Re: ch-ch-changes

2009-01-28 Thread Max Samukha
On Wed, 28 Jan 2009 06:46:29 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Max Samukha wrote: On Wed, 28 Jan 2009 06:01:29 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: The thing is, passing by alias allows you a host of options: * string for short

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Max Samukha wrote: On Wed, 28 Jan 2009 06:46:29 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Max Samukha wrote: On Wed, 28 Jan 2009 06:01:29 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: The thing is, passing by alias allows you a host of options: *

Re: ch-ch-changes

2009-01-28 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started. Ranges and concepts

Re: Compiler as dll

2009-01-28 Thread Nick Sabalausky
grauzone n...@example.net wrote in message news:glpha0$dg...@digitalmars.com... Alexander Pánek wrote: grauzone wrote: John Reimer wrote: ddl does not work for memory sharing like normal dll's, where multiple applications have access to a single dll at runtime. It appears that such

Re: Compiler as dll

2009-01-28 Thread Nick Sabalausky
Mike Parker aldac...@gmail.com wrote in message news:glpfr2$b5...@digitalmars.com... grauzone wrote: When it's a commercial program, the DLL plugin approach probably wouldn't work anyway: in order to enable others to compile plugins, you would need to expose your internal headers (D

Re: Compiler as dll

2009-01-28 Thread Nick Sabalausky
grauzone n...@example.net wrote in message news:glphtn$g0...@digitalmars.com... Daniel Keep wrote: Templates are a different matter, but then C++ has the same problem. Whether or not you want to release your templates as part of the SDK really depends on what they are. Templates +

Re: ch-ch-changes

2009-01-28 Thread Steven Schveighoffer
Andrei Alexandrescu wrote I've worked valiantly on defining the range infrastructure and making std.algorithm work with it. I have to say that I'm even more pleased with the result than I'd ever expected when I started. Ranges and concepts really make for beautiful code, and I am sure

Re: ch-ch-changes

2009-01-28 Thread dsimcha
== Quote from Walter Bright (newshou...@digitalmars.com)'s article It is hard to hit just the right tradeoff between performance and simplicity. One motivating issue, however, is we don't want to leave an excuse or desire to go back to C or C++ for performance reasons, even if those reasons

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Jason House wrote: I think algorithm signatures should not be made unnecessarily complex, and instead rely on other utilities for complex behavior. For example map!(a*a)(r1,r2) can be implemented as map!(a*a)(chain(r1,r2)) Yah, good point. I'm ambivalent about that. On one hand composition is

Re: ch-ch-changes

2009-01-28 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s I was working on stride just this minute. Guess I should check this group more often :o). A stride is a great way to get a good pivot into a large array when sorting. You sort the stride and then get its median. Andrei So

Re: ch-ch-changes

2009-01-28 Thread Yigal Chripun
Bill Baxter wrote: On Wed, Jan 28, 2009 at 6:07 PM, Nick Sabalauskya...@a.a wrote: Isn't tail the standard counterpart to head? (toe just doesn't sound good) Tail has a history of being used to mean everything but head in functional programming languages like Haskel and ML. So of back,

Re: ch-ch-changes

2009-01-28 Thread Derek Parnell
On Wed, 28 Jan 2009 22:31:04 +0200, Yigal Chripun wrote: I already asked in a previous post - would a chinese programmer intuitivly think that toe is the last item in a range? I am a native English speaker (well ... Australian okay) and I do not think intuitively of 'toe' as the last item in

Re: ch-ch-changes

2009-01-28 Thread Yigal Chripun
Andrei Alexandrescu wrote: [snipped where appropriate] String mixins are meant to be used for short functions, which at least in my code there are plenty of. You can e.g. sort by a field by writing sort!(a.name b.name)(vec) without so much as thinking about it. If you want syntax

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Yigal Chripun wrote: that's a good point but I don't like string mixin to be used for that. Actually, string mixins should be deprecated in favor of better tools. IIRC, ada has expression generics, which in D would be like: sort!(a.name b.name)(vec) // instead of the above the difference is

Re: ch-ch-changes

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 5:31 AM, Yigal Chripun yigal...@gmail.com wrote: Bill Baxter wrote: On Wed, Jan 28, 2009 at 6:07 PM, Nick Sabalauskya...@a.a wrote: Isn't tail the standard counterpart to head? (toe just doesn't sound good) Tail has a history of being used to mean everything but

Re: ch-ch-changes

2009-01-28 Thread Jason House
Andrei Alexandrescu Wrote: Jason House wrote: I think algorithm signatures should not be made unnecessarily complex, and instead rely on other utilities for complex behavior. For example map!(a*a)(r1,r2) can be implemented as map!(a*a)(chain(r1,r2)) Yah, good point. I'm ambivalent

Re: ch-ch-changes

2009-01-28 Thread Jason House
Andrei Alexandrescu Wrote: Jason House wrote: Andrei Alexandrescu Wrote: Jason House wrote: I also see in the docs that the structs returned are documented, complete with all the functions that they include. I'd hope that we could somehow document this stuff simpler...

Re: ch-ch-changes

2009-01-28 Thread Joel C. Salomon
Jarrett Billingsley wrote: I was thinking about making D ranges be to D arrays as C++ iterators are to C++ pointers: r[0] is head and r[$ - 1] is toe. But that has problems, since you can't make an infinite range, since you can't say that r[0] is legal while r[$ - 1] is not. (D also doesn't

Re: ch-ch-changes

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 7:38 AM, Yigal Chripun yigal...@gmail.com wrote: Bill Baxter wrote: On Thu, Jan 29, 2009 at 5:31 AM, Yigal Chripunyigal...@gmail.com wrote: Bill Baxter wrote: On Wed, Jan 28, 2009 at 6:07 PM, Nick Sabalauskya...@a.a wrote: Isn't tail the standard counterpart to

Re: ch-ch-changes

2009-01-28 Thread Jarrett Billingsley
On Wed, Jan 28, 2009 at 6:00 PM, Joel C. Salomon joelcsalo...@gmail.com wrote: Jarrett Billingsley wrote: I was thinking about making D ranges be to D arrays as C++ iterators are to C++ pointers: r[0] is head and r[$ - 1] is toe. But that has problems, since you can't make an infinite range,

Re: Compiler as dll

2009-01-28 Thread Christopher Wright
grauzone wrote: John Reimer wrote: ddl does not work for memory sharing like normal dll's, where multiple applications have access to a single dll at runtime. It appears that such support would be quite difficult to implement and moves in the direction of operating system features.

Re: Compiler as dll

2009-01-28 Thread Daniel Keep
Nick Sabalausky wrote: [snip] I disagree. Making all add-ons be interpreted scripts is one of the biggest reasons why Firefox (especially v2) is so absurdly slow (not that I'm a fan of IE, Opera or Safari). Also, the fact that the vast majority of scripting languages lack descent

Re: ch-ch-changes

2009-01-28 Thread Christopher Wright
Don wrote: grauzone wrote: and the code is more obfuscated. If you make an error in your predicate, random funny things internal to the library implementation could happen, and the compiler will spurt out indecipherable error messages for random modules (I guess in this case, std.algorithm or

Please vote once and for good: range operations

2009-01-28 Thread Andrei Alexandrescu
It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). So please let's vote once and for all. I will note that I disagree we should ignore what conventions other languages have. Provincialism is

Re: Please vote once and for good: range operations

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 9:26 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). Looking for bugs is too much like work. :-P So

Re: ch-ch-changes

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 9:32 AM, Sandeep Kakarlapudi sandeep.iitkgpspamme...@gmail.com wrote: toe is flat out silly and such names that pollute everything. Just curious -- do you find head and tail to be silly too? If not, what is it that makes them not silly? Is there anything more to it

Re: ch-ch-changes

2009-01-28 Thread Chad J
Sandeep Kakarlapudi wrote: Other mistakes that still irritate quite a few: C++ vector vs a mathematical vector In real time computer graphics, using binormal inplace of the bitangent. Curves have a binormal and surfaces have bitangents! No matter how many times binormal is used it still is

Re: ch-ch-changes

2009-01-28 Thread Andrei Alexandrescu
Christopher Wright wrote: Andrei Alexandrescu wrote: A stride is a great way to get a good pivot into a large array when sorting. You sort the stride and then get its median. I'm not so sure about that. If the array is in fact large, you're dealing with an external memory situation, and

Re: Please vote once and for good: range operations

2009-01-28 Thread Andrei Alexandrescu
Bill Baxter wrote: On Thu, Jan 29, 2009 at 9:26 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). Looking for bugs is too much

Re: Please vote once and for good: range operations

2009-01-28 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). So please let's vote once and for all. I will note that I

Re: ch-ch-changes

2009-01-28 Thread Chad J
Bill Baxter wrote: On Thu, Jan 29, 2009 at 9:44 AM, Chad J gamerc...@__spam.is.bad__gmail.com wrote: Sandeep Kakarlapudi wrote: Other mistakes that still irritate quite a few: C++ vector vs a mathematical vector In real time computer graphics, using binormal inplace of the bitangent.

Re: Please vote once and for good: range operations

2009-01-28 Thread Chad J
Andrei Alexandrescu wrote: So please let's vote Andrei As for voting rules, I suggest we all write down a list of pairs that are acceptable to us on the aesthetic level. Each pair counts as a vote for that pair. So people get multiple votes, but never for the same pair. At the end

Re: Please vote once and for good: range operations

2009-01-28 Thread Chad J
These are all fine to my eyes: begin/end begin/terminus current/last current/rear current/back first/last fore/aft front/back left/right leftmost/rightmost head/last head/rear head/back start/end start/last start/terminus If any more come up that I like, I'll post those too.

Re: Please vote once and for good: range operations

2009-01-28 Thread Steven Schveighoffer
Sandeep Kakarlapudi wrote Not sure if this vote is meant for regular members only or not! Here's my preference order anyways: first-last head-rhead head-tail head-toe Please post with your official D fan club id number for your vote to be counted. -Steve

Re: Please vote once and for good: range operations

2009-01-28 Thread Sandeep Kakarlapudi
Steven Schveighoffer Wrote: Sandeep Kakarlapudi wrote Not sure if this vote is meant for regular members only or not! Here's my preference order anyways: first-last head-rhead head-tail head-toe Please post with your official D fan club id number for your vote to be counted.

Re: Please vote once and for good: range operations

2009-01-28 Thread Robert Fraser
dsimcha wrote: Lisp, Scheme: Car has absolutely no intuitive connection with the first part of anything. This terminology was probably invented by some 60's programmer who was seriously stoned. Only sort of... http://en.wikipedia.org/wiki/Car_and_cdr Java: Worse yet than array indexing,

Re: Please vote once and for good: range operations

2009-01-28 Thread Saaa
fore/aft + head/toe seem different classes to me, rather head/back if fore/aft isn't going to win

Re: Please vote once and for good: range operations

2009-01-28 Thread John Reimer
Hello Andrei, It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). So please let's vote once and for all. I will note that I disagree we should ignore what conventions other languages have.

Re: Please vote once and for good: range operations

2009-01-28 Thread John Reimer
Hello Saaa, fore/aft + head/toe seem different classes to me, rather head/back if fore/aft isn't going to win Probably not wise for me to quibble over these points, but... to me, the main problem with fore/aft is that it implies a position of an object that occupies physical space.

Re: Please vote once and for good: range operations

2009-01-28 Thread Brad Roberts
Andrei Alexandrescu wrote: Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all. Andrei Do let's. My first vote goes to first/last, with head/toe at second place. -- Simen Ok, after looking at my code I discovered a huge problem with first. (Last

Re: Please vote once and for good: range operations

2009-01-28 Thread John Reimer
Hello Andrei, Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all. Andrei Do let's. My first vote goes to first/last, with head/toe at second place. -- Simen Ok, after looking at my code I discovered a huge problem with first. (Last is cool.) If all

What's the deal with __buck?

2009-01-28 Thread Andrei Alexandrescu
I stumbled upon a very interesting problem. Consider an infinite range that generates the numbers 1, 2, 3, ... That range doesn't have a length member. However, it is a random access range, which makes things rather interesting. Now consider I want to advance 10 steps in that range. Being an

Re: What's the deal with __buck?

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 1:48 PM, Bill Baxter wbax...@gmail.com wrote: On Thu, Jan 29, 2009 at 1:37 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I stumbled upon a very interesting problem. Consider an infinite range that generates the numbers 1, 2, 3, ... That range doesn't

Re: Please vote once and for good: range operations

2009-01-28 Thread Andrei Alexandrescu
Bill Baxter wrote: On Thu, Jan 29, 2009 at 1:25 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all. Andrei Do let's. My first vote goes to first/last, with head/toe at second place. -- Simen

Re: Please vote once and for good: range operations

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 1:51 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Bill Baxter wrote: On Thu, Jan 29, 2009 at 1:25 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all.

Re: Please vote once and for good: range operations

2009-01-28 Thread Sean Kelly
head/last It seems fairly popular and doesn't cause any confusion with 'tail' if we decide to use that later on. Sean

Re: Please vote once and for good: range operations

2009-01-28 Thread Nick Sabalausky
I'd be ok with any of these: head/last head/tail front/back current/last curr/last car_bonnet/car_boot (just kidding ;)) But beyond that, I'd sooner choose head/foot over head/toe. If array-style indexing were ever done, I'd be against using negative values to indicate distance from end. The

Re: Please vote once and for good: range operations

2009-01-28 Thread Ary Borenszweig
Andrei Alexandrescu escribió: Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all. Andrei Do let's. My first vote goes to first/last, with head/toe at second place. -- Simen Ok, after looking at my code I discovered a huge problem with first. (Last

Re: Please vote once and for good: range operations

2009-01-28 Thread BCS
Hello Andrei, C++: front back http://support.microsoft.com/kb/158613 Wow I actuly like something C++ did. vote++

Re: What's the deal with __buck?

2009-01-28 Thread BCS
Hello Bill, I guess what's required is the ability to define the __dollar in the scope of a class/struct/template. I think that is the correct solution. --bb

Re: Please vote once and for good: range operations

2009-01-28 Thread Brian Hay
I don't agree that first must go. I vote: first/last

Re: ch-ch-changes

2009-01-28 Thread Nick Sabalausky
Daniel Keep daniel.keep.li...@gmail.com wrote in message news:glqu65$15p...@digitalmars.com... Christopher Wright wrote: Don wrote: [snip] Then we get: static assert(__traits(mixincompiles, comp), Predicate: ~ comp ~ does not compile); mxin(comp); That's certainly prettier. Still

Re: Please vote once and for good: range operations

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 3:17 PM, BCS n...@anon.com wrote: Hello Andrei, C++: front back http://support.microsoft.com/kb/158613 Wow I actuly like something C++ did. vote++ I could go for front/back too. head/toe or first/last are also ok by me. --bb

Re: Please vote once and for good: range operations

2009-01-28 Thread BLS
C++: front back

Re: Please vote once and for good: range operations

2009-01-28 Thread Yigal Chripun
Andrei Alexandrescu wrote: Simen Kjaeraas wrote: Andrei Alexandrescu wrote: So please let's vote once and for all. Andrei Do let's. My first vote goes to first/last, with head/toe at second place. -- Simen Ok, after looking at my code I discovered a huge problem with first. (Last is

Re: Please vote once and for good: range operations

2009-01-28 Thread Daniel Keep
Ideally, I'd like to change all the names for the interface to be: front -- first element in the range back -- last element in the range advanceFront -- advance the front element by one retreatBack -- retreat the back element by one And, tempting fate... nonEmpty

Re: Please vote once and for good: range operations

2009-01-28 Thread Bill Baxter
On Thu, Jan 29, 2009 at 4:11 PM, Daniel Keep daniel.keep.li...@gmail.com wrote: nonEmpty -- as Walter one espoused: negative = bad, positive = good :D I think that's exactly the kind of thing he meant to avoid. Now you have if (!nonEmpty) { /* don't not do nothing here */ }

Re: ch-ch-changes

2009-01-28 Thread Daniel Keep
Nick Sabalausky wrote: Daniel Keep daniel.keep.li...@gmail.com wrote in message news:glqu65$15p...@digitalmars.com... Christopher Wright wrote: Don wrote: [snip] Then we get: static assert(__traits(mixincompiles, comp), Predicate: ~ comp ~ does not compile); mxin(comp); That's

Re: Please vote once and for good: range operations

2009-01-28 Thread Max Samukha
On Wed, 28 Jan 2009 16:26:17 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o). So please let's vote once and for all. I will

Re: Please vote once and for good: range operations

2009-01-28 Thread bearophile
Andrei Alexandrescu: Python: lst[0] lst[len(lst)-1] I have not read the whole thread so someone else may have already answered, but that's not pythonic, the last item is represented as: lst = abcde lst[-1] 'e' lst[-2] 'd' etc. You can write those in D as: lst[$-1] lst[$-2] Bye,

Re: Is there a way to remove the requirement for parenthesis?

2009-01-28 Thread Denis Koroskin
On Wed, 28 Jan 2009 08:45:12 +0300, Daniel Keep daniel.keep.li...@gmail.com wrote: Honestly, I can't see what you're trying to accomplish. It looks like you want something that's not called int, but which works exactly like an int does, and can be passed as one. If you just want another

Re: Moving from C to D

2009-01-28 Thread bob
do IN become in maybe? BLS Wrote: BCS wrote: Reply to bob, sorry i copy wrong line. how do i do this line: int PASCAL FAR mycnt ( IN SOCKET s, IN const struct sockaddr FAR *name, IN int namelen ); bob Wrote: step 1 would be get the output from the preprocessor and take

Re: Moving from C to D

2009-01-28 Thread Daniel Keep
bob wrote: do IN become in maybe? BLS Wrote: BCS wrote: Reply to bob, sorry i copy wrong line. how do i do this line: int PASCAL FAR mycnt ( IN SOCKET s, IN const struct sockaddr FAR *name, IN int namelen ); bob Wrote: step 1 would be get the output from the preprocessor and

Re: Prevent default-initialised struct

2009-01-28 Thread Daniel Keep
grauzone wrote: Use a class instead. That would defeat the purpose of defining a non_null template in the first place. -- Daniel

Re: Moving from C to D

2009-01-28 Thread Daniel Keep
BLS wrote: Daniel Keep wrote: [snip] Also, I believe that PASCAL is the same as the Windows cc, so my guess at the conversion would be: For D 1.x: extern(Windows) int mycnt ( SOCKET s, sockaddr* name, int namelen ); For D 2.x: extern(Windows) int mycnt ( SOCKET s, const sockaddr*

Re: Segmentation error at the end problem

2009-01-28 Thread Gide Nwawudu
On Tue, 27 Jan 2009 22:48:33 -0800, Charles Hixson charleshi...@earthlink.net wrote: Main routine: void main() { try { BlockFile bf; bf = new BlockFile (test.bf, 4096); writefln (before close); bf.close; bf = null; writefln (after close);

A array bug?

2009-01-28 Thread taqya
Hi,i write this code. then d compiler is shutdown. Is it a array bug? //Digital Mars D Compiler v2.014 (windows) import std.stdio; int main() { char[] a = a.dup; char[] b = b.dup; writefln(a + b); //Error: Array operations not implemented return 0;

Re: A array bug?

2009-01-28 Thread Ellery Newcomer
taqya wrote: Hi,i write this code. then d compiler is shutdown. Is it a array bug? //Digital Mars D Compiler v2.014 (windows) import std.stdio; int main() { char[] a = a.dup; char[] b = b.dup; writefln(a + b); //Error: Array operations not implemented return 0; }

Re: Is there a way to remove the requirement for parenthesis?

2009-01-28 Thread Charles Hixson
Suppose that you have four types, equivalent to, say, float. Call one of them Horiz, one Vertic, one Radians, and one Radius. These are all floats, but when you specify, say, float dist (Horiz x, Vert y) { return sqrt(x * x + y * y); } It's important that the arguments aren't Radius and

  1   2   >