Re: Is this D or is it Javascript?

2013-07-05 Thread Rory McGuire
On Fri, Jul 5, 2013 at 5:21 AM, Adam D. Ruppe destructiona...@gmail.comwrote: [snip] d rox. !!! this is AWESOME! Now one can use a mix of static and dynamic typing which is really nice with document based databases. Being able to script subsections of a website is also really interesting.

Re: NDC Oslo talk: Generic Programming Galore Using D

2013-07-05 Thread Justin Whear
On Thu, 04 Jul 2013 09:47:36 -0700, Andrei Alexandrescu wrote: Videos for my two NDC 2013 talks are now online. Generic Programming Galore using D at http://vimeo.com/68378925 and the HipHop Virtual Machine at http://vimeo.com/68383350. Andrei Reddit:

Re: Is this D or is it Javascript?

2013-07-05 Thread Rob T
There are many cases where you do not know in advance what type of data is being received through an interface to some other system. This happens with some databases, and with messaging systems, and if you are interfacing to any dynamically or weakly typed language, such as with js/json. I

Re: Is this D or is it Javascript?

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 22:51:57 UTC, Rob T wrote: I suppose i could to this c = var.get!(typeof(c)); Yeah, I did two things: int c = var.get!int; and int c; var v; v.putInto(c); [do] you think multiple alias this will solve the problem? Maybe, but that would still be limited to a list

Re: Is this D or is it Javascript?

2013-07-05 Thread Andrei Alexandrescu
On 7/5/13 4:04 PM, Adam D. Ruppe wrote: BTW I'll push another commit to jsvar.d and script.d over the weekend. I got return/break/continue working now (in the cases I've tried at least, simple ones). I think you really should put the code in shape and convert your initial post into a blog

Re: Is this D or is it Javascript?

2013-07-05 Thread MattCoder
On Friday, 5 July 2013 at 03:21:31 UTC, Adam D. Ruppe wrote: Is any of this useful for anything? idk, maybe parsing json or maybe the script language could find use. But the real point I'm trying to make here is simply that... d rox. Awesome work, and I think it's a nice code to study more

Re: Is this D or is it Javascript?

2013-07-05 Thread Rob T
On Friday, 5 July 2013 at 23:04:28 UTC, Adam D. Ruppe wrote: Maybe, but that would still be limited to a list of types. What would be ideal is if alias this or opImplicitCast existed, or implicit constructors like C++ has for function calls and could be a template: T get(T)() { ...}

Re: Is this D or is it Javascript?

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 08:26:23 UTC, Rory McGuire wrote: Just need a decent wrapper on phobos to fix the naming of some stuff. That's fairly easy too: import arsd.jsvar; import arsd.script; void main() { var globals = var.emptyObject; { import std.algorithm;

Re: Is this D or is it Javascript?

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 23:58:30 UTC, Rob T wrote: What I always wanted to see, was full signature overloading rather than only the partial signature overloading we currently have. Indeed, that would be pretty cool.

Re: Is this D or is it Javascript?

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 23:51:16 UTC, MattCoder wrote: PS: I just think that var is maybe too generic, I would called it as jsvar or anything like that, but this is just my opinion, anyway I liked your solution. I just wanted the authentic javascript experience :P You could also rename it

Re: Is this D or is it Javascript?

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 23:35:54 UTC, Andrei Alexandrescu wrote: I think you really should put the code in shape and convert your initial post into a blog entry. You know, I have a lot of things I want to blab about, but the problem is I don't have a blog! I'm slowly working on coding one

Re: Is this D or is it Javascript?

2013-07-05 Thread JS
On Saturday, 6 July 2013 at 00:27:45 UTC, Adam D. Ruppe wrote: On Friday, 5 July 2013 at 23:35:54 UTC, Andrei Alexandrescu wrote: I think you really should put the code in shape and convert your initial post into a blog entry. You know, I have a lot of things I want to blab about, but the

Re: Is this D or is it Javascript?

2013-07-05 Thread Walter Bright
On 7/5/2013 5:27 PM, Adam D. Ruppe wrote: On Friday, 5 July 2013 at 23:35:54 UTC, Andrei Alexandrescu wrote: I think you really should put the code in shape and convert your initial post into a blog entry. You know, I have a lot of things I want to blab about, but the problem is I don't have

Re: D vs C++ - Where are the benchmarks?

2013-07-05 Thread Paulo Pinto
On Thursday, 4 July 2013 at 23:53:21 UTC, H. S. Teoh wrote: On Fri, Jul 05, 2013 at 01:45:24AM +0200, Mehrdad wrote: On Thursday, 4 July 2013 at 22:28:18 UTC, H. S. Teoh wrote: Really? I thought there are conservative GC's out there for C++

Re: std.stream replacement

2013-07-05 Thread w0rp
I think you can win with both. You can have very convenient and general abstractions like ranges which perform very well too. In addition, you can provide all of the usual range features to make them compatible with generic algorithms, and a few extra methods for extra features, like changing

Re: Function templates do implicit conversions for their arguments

2013-07-05 Thread TommiT
On Friday, 5 July 2013 at 02:45:47 UTC, Maxim Fomin wrote: On Thursday, 4 July 2013 at 21:31:43 UTC, TommiT wrote: On Thursday, 4 July 2013 at 20:43:45 UTC, Maxim Fomin wrote: Implementation may do other way, at first instantiate template (with deduced type) and then try to plug arguments

Re: D vs C++ - Where are the benchmarks?

2013-07-05 Thread Mehrdad
On Thursday, 4 July 2013 at 23:53:21 UTC, H. S. Teoh wrote: On Fri, Jul 05, 2013 at 01:45:24AM +0200, Mehrdad wrote: On Thursday, 4 July 2013 at 22:28:18 UTC, H. S. Teoh wrote: Really? I thought there are conservative GC's out there for C++

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Dicebot
On Thursday, 4 July 2013 at 23:25:38 UTC, Andrei Alexandrescu wrote: Where does the whole stronger typing comes in? This is poppycock. We need real arguments here. Andrei More values typeof([]) can be implicitly converted to - weaker typing, that simple. Actually I'd love to be able to

Re: bug in pragma?

2013-07-05 Thread Dicebot
On Friday, 5 July 2013 at 00:44:24 UTC, JS wrote: Well, duh. Just because something works the way it works doesn't mean it's the right or best way. You are welcome to make a DIP and try to prove that your proposed alternative is better. Chance of success is low but it is possible. In the

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Nicolas Sicard
On Thursday, 4 July 2013 at 23:52:35 UTC, bearophile wrote: Andrei Alexandrescu: Where does the whole stronger typing comes in? This is poppycock. We need real arguments here. Maybe it's a matter of definitions, for me having null as literal for empty array, null pointer, empty associative

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread monarch_dodra
On Friday, 5 July 2013 at 08:15:35 UTC, Nicolas Sicard wrote: On Thursday, 4 July 2013 at 23:52:35 UTC, bearophile wrote: Andrei Alexandrescu: Where does the whole stronger typing comes in? This is poppycock. We need real arguments here. Maybe it's a matter of definitions, for me having

Re: bug in pragma?

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 09:58:24 Dicebot wrote: In the meanwhile I find the current system really well-designed and consistent. Agreed. - Jonathan M Davis

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Thu, 04 Jul 2013 20:15:08 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of if(x) is compare the value of x with 0 (in C, C++, .. ). The value of x for a pointer is the address to which it

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread TommiT
On Thursday, 4 July 2013 at 19:15:09 UTC, Dmitry Olshansky wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of if(x) is compare the value of x with 0 (in C, C++, .. ). The value of x for a pointer is the address to which it points. The value of x

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Thu, 04 Jul 2013 18:26:09 +0100, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Why do you want so much an empty array that's not null? I can't make sense of this entire argument. Suppose you have a web page, suppose it has a text field on it called comment. Suppose you load

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Dmitry Olshansky
05-Jul-2013 13:01, TommiT пишет: On Thursday, 4 July 2013 at 19:15:09 UTC, Dmitry Olshansky wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of if(x) is compare the value of x with 0 (in C, C++, .. ). The value of x for a pointer is the address to

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Dmitry Olshansky
05-Jul-2013 12:55, Regan Heath пишет: On Thu, 04 Jul 2013 20:15:08 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of if(x) is compare the value of x with 0 (in C, C++, .. ). The value of x for a

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 11:01:17 TommiT wrote: On Thursday, 4 July 2013 at 19:15:09 UTC, Dmitry Olshansky wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of if(x) is compare the value of x with 0 (in C, C++, .. ). The value of x for a

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Fri, 05 Jul 2013 10:13:11 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 05-Jul-2013 12:55, Regan Heath пишет: On Thu, 04 Jul 2013 20:15:08 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Fri, 05 Jul 2013 10:17:02 +0100, Jonathan M Davis jmdavisp...@gmx.com wrote: On Friday, July 05, 2013 11:01:17 TommiT wrote: On Thursday, 4 July 2013 at 19:15:09 UTC, Dmitry Olshansky wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you can generalise further. The meaning of

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 10:26:09 Regan Heath wrote: I think it is simpler to think of arrays as a struct with 2 members (ptr and length) and this struct is/as a value type. Then it all simply makes sense. I'm not saying that it can't be understood. It's just that the semantics are a bit

Re: Rust switches to external iteration

2013-07-05 Thread Russel Winder
On Thu, 2013-07-04 at 20:27 +0200, bearophile wrote: […] Yet in Python they are used everywhere. I define input ranges often in D and I think they are useful. Having a built-in yield in a language is quite handy. Take a look at the Python and the second D solutions here:

Request: traits isImplemented

2013-07-05 Thread JS
I have a request to add to __traits to check if a method/property of a class/struct is actually implemented or not. interface A { void myfunc(); } class B : A { } // myfunc not implemented class C : A { void myfunc() { ... } // myfunc implemented This may seem odd but I need it for

Re: UDP enhancement

2013-07-05 Thread Jacob Carlborg
On 2013-07-03 03:42, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. I don't think that works so well together with ddoc comments. Ideally you should be able to do something like this: class Foo { /// Get/set bar mixin

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Dmitry Olshansky
05-Jul-2013 13:24, Regan Heath пишет: On Fri, 05 Jul 2013 10:13:11 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 05-Jul-2013 12:55, Regan Heath пишет: On Thu, 04 Jul 2013 20:15:08 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 04-Jul-2013 19:00, Regan Heath пишет: In fact, you

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread TommiT
On Friday, 5 July 2013 at 10:39:38 UTC, Dmitry Olshansky wrote: 05-Jul-2013 13:24, Regan Heath пишет: Given those statements I have come to the conclusion that if (x) on an array should compare x.ptr to 0. I'd agree if arrays did decay to pointers or integers on demand (implicit

Re: Request: traits isImplemented

2013-07-05 Thread Jacob Carlborg
On 2013-07-05 11:52, JS wrote: I have a request to add to __traits to check if a method/property of a class/struct is actually implemented or not. interface A { void myfunc(); } class B : A { } // myfunc not implemented class C : A { void myfunc() { ... } // myfunc implemented This may seem

Code doesn't compile

2013-07-05 Thread Mohammad Sadegh Khoeini
Hi D community, I was just playing with some code and encountered a problem: ``` struct Foo(alias T) { void call() { T(); } } struct Bar { void fun() {} } struct Baz(T) { void fun(U)() {} } void main() { auto b = Bar(); auto f = Foo!(delegate{b.fun();})(); // this works

Re: UDP enhancement

2013-07-05 Thread Daniel Murphy
Jacob Carlborg d...@me.com wrote in message news:kr673g$179s$1...@digitalmars.com... On 2013-07-03 03:42, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. I don't think that works so well together with ddoc comments. Ideally you

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Artur Skawina
On 07/05/13 12:39, Dmitry Olshansky wrote: 05-Jul-2013 13:24, Regan Heath пишет: 1. Arrays are a thin wrapper around a reference type (ptr) which add safety. Rather it packs 2 pointers (pair: ptr, ptr+len), modeling the region in between. No matter how we look at it, it doesn't overlap

Re: UDP enhancement

2013-07-05 Thread Andrej Mitrovic
On 7/5/13, Jacob Carlborg d...@me.com wrote: I don't think that works so well together with ddoc comments. Ideally you should be able to do something like this: class Foo { /// Get/set bar mixin property!(int, bar); } Related:

Re: Rust switches to external iteration

2013-07-05 Thread Artur Skawina
On 07/04/13 20:27, bearophile wrote: Having a built-in yield in a language is quite handy. Take a look at the Python and the second D solutions here: http://rosettacode.org/wiki/Same_Fringe Would tuples really be the ideal tree representation when dealing with mutable data in /real/ code?

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Artur Skawina
On 07/05/13 14:26, Artur Skawina wrote: Actually, slices should implicitly convert to bool with !!length. Normal pointers couldn't do that - because they had no length. s/implicitly// artur

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Daniel Murphy
TommiT tommitiss...@hotmail.com wrote in message news:cajkpllpdchpphqxh...@forum.dlang.org... On Thursday, 4 July 2013 at 13:32:25 UTC, Steven Schveighoffer wrote: On Thu, 04 Jul 2013 08:52:12 -0400, Regan Heath wrote: Indeed. IMO if(arr) should mean if(arr.ptr) .. and I thought it did.. or

Re: UDP enhancement

2013-07-05 Thread Wyatt
On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested Oh hey, I remember the DIP23 madness. Is it that time again already? is to do something like public @property int value; Yes. Please, yes.

Re: UDP enhancement

2013-07-05 Thread Timon Gehr
On 07/05/2013 03:53 PM, Wyatt wrote: On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested Oh hey, I remember the DIP23 madness. Is it that time again already? is to do something like public

Re: D vs C++ - Where are the benchmarks?

2013-07-05 Thread Iain Buclaw
On 4 July 2013 22:03, Mehrdad wfunct...@hotmail.com wrote: D, on the other hand, has a GC built into the language itself; it's not an implementation detail. I'd say built into the runtime, rather than language. And it is an implementation detail on just how the GC tracks, allocates and collects

Re: D vs C++ - Where are the benchmarks?

2013-07-05 Thread Iain Buclaw
On 4 July 2013 22:04, Mehrdad wfunct...@hotmail.com wrote: To put it another way, _any_ conformant D compiler must necessarily have a GC. Not necessarily true, but your application at runtime may leak surplus amounts of memory from hidden allocation calls without a GC. ;) -- Iain Buclaw

Re: Code doesn't compile

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 11:23:55 UTC, Mohammad Sadegh Khoeini wrote: // auto u = Foo!(b.fun)(); // doesn't work: vaiable b cannot be read at compile time // auto v = Foo!(Baz!int.fun!int)(); //doesn't work: this for fun needs to be type Baz not type Foo!(fun) Not a bug, I think at

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Fri, 05 Jul 2013 11:39:37 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 05-Jul-2013 13:24, Regan Heath пишет: On Fri, 05 Jul 2013 10:13:11 +0100, Dmitry Olshansky dmitry.o...@gmail.com wrote: 05-Jul-2013 12:55, Regan Heath пишет: On Thu, 04 Jul 2013 20:15:08 +0100, Dmitry

Re: Request: traits isImplemented

2013-07-05 Thread JS
On Friday, 5 July 2013 at 10:55:26 UTC, Jacob Carlborg wrote: On 2013-07-05 11:52, JS wrote: I have a request to add to __traits to check if a method/property of a class/struct is actually implemented or not. interface A { void myfunc(); } class B : A { } // myfunc not implemented class C :

Re: Feature request: Path append operators for strings

2013-07-05 Thread TommiT
On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote: On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote: On 7/2/2013 1:47 PM, TommiT wrote: Division operator for strings doesn't make any sense, That's why overloading / to do something completely unrelated to division is

Re: Feature request: Path append operators for strings

2013-07-05 Thread Paulo Pinto
Am 05.07.2013 16:59, schrieb TommiT: On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote: On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote: On 7/2/2013 1:47 PM, TommiT wrote: Division operator for strings doesn't make any sense, That's why overloading / to do something

Re: Feature request: Path append operators for strings

2013-07-05 Thread TommiT
On Friday, 5 July 2013 at 15:04:44 UTC, Paulo Pinto wrote: Am 05.07.2013 16:59, schrieb TommiT: On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote: On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote: On 7/2/2013 1:47 PM, TommiT wrote: Division operator for strings doesn't

Re: Request: traits isImplemented

2013-07-05 Thread Andrej Mitrovic
On 7/5/13, JS js.m...@gmail.com wrote: I have a request to add to __traits to check if a method/property of a class/struct is actually implemented or not. interface A { void myfunc(); } class B : A { } // myfunc not implemented class C : A { void myfunc() { ... } // myfunc implemented

Re: Code doesn't compile

2013-07-05 Thread Mohammad Sadegh Khoeini
On 7/5/13 7:05 PM, Adam D. Ruppe wrote: On Friday, 5 July 2013 at 11:23:55 UTC, Mohammad Sadegh Khoeini wrote: // auto u = Foo!(b.fun)(); // doesn't work: vaiable b cannot be read at compile time // auto v = Foo!(Baz!int.fun!int)(); //doesn't work: this for fun needs to be type Baz not

Re: Code doesn't compile

2013-07-05 Thread Adam D. Ruppe
On Friday, 5 July 2013 at 15:17:09 UTC, Mohammad Sadegh Khoeini wrote: However, the gotchas like that will surprise people. Aye, I have fought with it before and never made a good solution. The problem is that b can change at runtime, so it has no way of knowing for sure which object it

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Dmitry Olshansky
05-Jul-2013 16:26, Artur Skawina пишет: On 07/05/13 12:39, Dmitry Olshansky wrote: 05-Jul-2013 13:24, Regan Heath пишет: 1. Arrays are a thin wrapper around a reference type (ptr) which add safety. Rather it packs 2 pointers (pair: ptr, ptr+len), modeling the region in between. No matter how

Re: Request: traits isImplemented

2013-07-05 Thread Jacob Carlborg
On Friday, 5 July 2013 at 14:59:19 UTC, JS wrote: This doesn't work with overloaded members. It's possible that a function with the same name may be completely unrelated to the interface being implemented. There's a trait for that as well. Read the documentation. -- /Jacob Carlborg

Re: Feature request: Path append operators for strings

2013-07-05 Thread H. S. Teoh
On Fri, Jul 05, 2013 at 05:04:46PM +0200, Paulo Pinto wrote: Am 05.07.2013 16:59, schrieb TommiT: On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote: On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote: On 7/2/2013 1:47 PM, TommiT wrote: Division operator for strings

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Andrei Alexandrescu
On 7/5/13 2:05 AM, Regan Heath wrote: On Thu, 04 Jul 2013 18:26:09 +0100, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Why do you want so much an empty array that's not null? I can't make sense of this entire argument. Suppose you have a web page, suppose it has a text field on it

Re: Request: traits isImplemented

2013-07-05 Thread Ali Çehreli
On 07/05/2013 02:52 AM, JS wrote: I have a request to add to __traits to check if a method/property of a class/struct is actually implemented or not. interface A { void myfunc(); } class B : A { } // myfunc not implemented class C : A { void myfunc() { ... } // myfunc implemented This may

Re: Feature request: Path append operators for strings

2013-07-05 Thread Walter Bright
On 7/5/2013 9:17 AM, H. S. Teoh wrote: Python uses +. There's much historical precedence for + meaning concatenation, and much historical experience with the resulting ambiguity. The famous example is: 123 + 4 ? In D, the canonical problem is: int[] array; array + 4 Does

Re: Request: traits isImplemented

2013-07-05 Thread JS
On Friday, 5 July 2013 at 16:04:19 UTC, Jacob Carlborg wrote: On Friday, 5 July 2013 at 14:59:19 UTC, JS wrote: This doesn't work with overloaded members. It's possible that a function with the same name may be completely unrelated to the interface being implemented. There's a trait for

Automatic Interface Implementation

2013-07-05 Thread JS
I ripped and hacked up some code from typecons that allows one to implement an interface automatically by redirecting it to a variable implementing the interface. http://dpaste.dzfl.pl/209e260b To see the effectiveness of the code, notice that very little, if any, boilerplate code needs to

Re: Feature request: Path append operators for strings

2013-07-05 Thread Peter Alexander
On Friday, 5 July 2013 at 14:59:39 UTC, TommiT wrote: It's rather C++'s std::string which overloads the meaning of + to mean concatenation. I wonder if some other programming language has assigned some other symbol (than ~) to mean concatenation. I guess math uses || for it. || is used for a

Re: Feature request: Path append operators for strings

2013-07-05 Thread H. S. Teoh
On Fri, Jul 05, 2013 at 10:44:43AM -0700, Walter Bright wrote: On 7/5/2013 9:17 AM, H. S. Teoh wrote: Python uses +. There's much historical precedence for + meaning concatenation, and much historical experience with the resulting ambiguity. Which leads to some nasty situations in

Re: Feature request: Path append operators for strings

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 16:59:38 TommiT wrote: On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote: On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote: On 7/2/2013 1:47 PM, TommiT wrote: Division operator for strings doesn't make any sense, That's why overloading /

Re: Feature request: Path append operators for strings

2013-07-05 Thread Namespace
Most languages I've used use + for concatenating strings, so it was definitely surprising to me that D didn't. I have no problem with the fact that it has a specific operator for concatenation (and there are some good reasons for it), but + seems to be pretty standard across languages from what

Re: Feature request: Path append operators for strings

2013-07-05 Thread Timon Gehr
On 07/05/2013 09:43 PM, Namespace wrote: Most languages I've used use + for concatenating strings, so it was definitely surprising to me that D didn't. I have no problem with the fact that it has a specific operator for concatenation (and there are some good reasons for it), but + seems to be

Re: Feature request: Path append operators for strings

2013-07-05 Thread Namespace
Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means *any* and do not refer to binary.

Re: Feature request: Path append operators for strings

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 22:09:53 Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means *any* and do not refer to binary. I did mean any, not just binary. I thought that there

Re: Feature request: Path append operators for strings

2013-07-05 Thread Timon Gehr
On 07/05/2013 10:34 PM, Timon Gehr wrote: On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means *any* and do not refer to binary. Yes. Neither do 'use', 'for'

Re: Feature request: Path append operators for strings

2013-07-05 Thread Timon Gehr
On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means *any* and do not refer to binary. Yes. Neither do 'use', 'for' and 'purpose'. Establishing that it is

Re: Feature request: Path append operators for strings

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 22:34:57 Timon Gehr wrote: On 07/05/2013 10:34 PM, Timon Gehr wrote: On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means

Re: Feature request: Path append operators for strings

2013-07-05 Thread Namespace
On Friday, 5 July 2013 at 20:34:26 UTC, Timon Gehr wrote: On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any* really means *any* and do not refer to binary. Yes. Neither

Re: Feature request: Path append operators for strings

2013-07-05 Thread Wyatt
On Friday, 5 July 2013 at 18:18:14 UTC, H. S. Teoh wrote: It doesn't necessarily have to be ~, as long as it's something other than + (or any other numerical binary operator). Perl uses '.', but in D's case, that would be a bad idea, since you'd have ambiguity in: Perl is my day job and I've

Re: [:] as empty associative array literal, plus warning for null

2013-07-05 Thread Regan Heath
On Friday, 5 July 2013 at 16:22:12 UTC, Andrei Alexandrescu wrote: On 7/5/13 2:05 AM, Regan Heath wrote: Why? Because if it were null it would have a different meaning. It would mean that the comment field was not present on the page at all, and should not be altered. I find the example

Re: Feature request: Path append operators for strings

2013-07-05 Thread Jonathan M Davis
On Friday, July 05, 2013 22:46:59 Namespace wrote: On Friday, 5 July 2013 at 20:34:26 UTC, Timon Gehr wrote: On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary usage. [...] use ~ for _any_ purpose. I'd expected that *any*

Re: Automatic Interface Implementation

2013-07-05 Thread Vladimir Panteleev
On Friday, 5 July 2013 at 17:53:11 UTC, JS wrote: I ripped and hacked up some code from typecons that allows one to implement an interface automatically by redirecting it to a variable implementing the interface. How about splitting up the implementation of AutoImplement into a template

Re: Automatic Interface Implementation

2013-07-05 Thread JS
On Friday, 5 July 2013 at 22:33:01 UTC, Vladimir Panteleev wrote: On Friday, 5 July 2013 at 17:53:11 UTC, JS wrote: I ripped and hacked up some code from typecons that allows one to implement an interface automatically by redirecting it to a variable implementing the interface. How about

Re: Feature request: Path append operators for strings

2013-07-05 Thread H. S. Teoh
On Fri, Jul 05, 2013 at 03:30:07PM -0700, Jonathan M Davis wrote: On Friday, July 05, 2013 22:46:59 Namespace wrote: On Friday, 5 July 2013 at 20:34:26 UTC, Timon Gehr wrote: On 07/05/2013 10:09 PM, Namespace wrote: Unary ~ is bitwise not in Java and D, and he is referring to binary

Re: Automatic Interface Implementation

2013-07-05 Thread John Colvin
On Friday, 5 July 2013 at 22:33:01 UTC, Vladimir Panteleev wrote: The new wrap from std.typecons Yikes... I'm a native english speaker and pretty confident with D but I can't get my head around what wrap does. It looks suspiciously like the docs were written by a Russian (missing articles

Re: Automatic Interface Implementation

2013-07-05 Thread H. S. Teoh
On Sat, Jul 06, 2013 at 12:54:37AM +0200, John Colvin wrote: On Friday, 5 July 2013 at 22:33:01 UTC, Vladimir Panteleev wrote: The new wrap from std.typecons Yikes... I'm a native english speaker and pretty confident with D but I can't get my head around what wrap does. It looks suspiciously

Re: Feature request: Path append operators for strings

2013-07-05 Thread John Colvin
On Friday, 5 July 2013 at 22:49:40 UTC, H. S. Teoh wrote: How to even remotely model such a thought process in a machine is an extremely hard problem indeed! I would posit (being a machine learning guy myself to some extent, although not natural language) that it's only an interesting

Re: Automatic Interface Implementation

2013-07-05 Thread Vladimir Panteleev
On Friday, 5 July 2013 at 22:54:38 UTC, John Colvin wrote: On Friday, 5 July 2013 at 22:33:01 UTC, Vladimir Panteleev wrote: The new wrap from std.typecons Yikes... I'm a native english speaker and pretty confident with D but I can't get my head around what wrap does. It looks suspiciously

Re: Automatic Interface Implementation

2013-07-05 Thread Michael
It's looks like he modify a source code from std.typecons (something like class AutoImplement?) and a new thing called wrap was created. Like two fingers on the asphalt)

Re: Automatic Interface Implementation

2013-07-05 Thread Vladimir Panteleev
On Friday, 5 July 2013 at 22:43:06 UTC, JS wrote: std.typecon has a lot of goodies in it but it seems to re-implement much of the same functionality in many of the templates. I agree, it would be nice if it would be broken up into smaller, reusable pieces that would also be usable from user

Re: UDP enhancement

2013-07-05 Thread Idan Arye
On Wednesday, 3 July 2013 at 01:42:06 UTC, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. https://github.com/D-Programming-Language/phobos/pull/1294

Re: Automatic Interface Implementation

2013-07-05 Thread JS
On Friday, 5 July 2013 at 23:22:23 UTC, Vladimir Panteleev wrote: On Friday, 5 July 2013 at 22:43:06 UTC, JS wrote: std.typecon has a lot of goodies in it but it seems to re-implement much of the same functionality in many of the templates. I agree, it would be nice if it would be broken up

Current version of D.

2013-07-05 Thread Caitlin
Hi all. I recently downloaded and installed version 2.063.2, but now I see the current version is listed as 2.063. Is this is an error? Also, does anyone know if a new edition of The D Programming Language is planned in the relatively near future? Thanks, Caitlin

Re: Current version of D.

2013-07-05 Thread Jonathan M Davis
On Saturday, July 06, 2013 03:22:57 Caitlin wrote: Hi all. I recently downloaded and installed version 2.063.2, but now I see the current version is listed as 2.063. Is this is an error? The current release is 2.063.2, but it's the first time that we've actually released point releases like

Poll: how long have you been into D

2013-07-05 Thread dnewbie
Hi. It's time for the annual poll of the year. Please vote http://www.easypolls.net/poll.html?p=51d766e4e4b03d6de547a64b

Fun with templates

2013-07-05 Thread Manu
Okay, so I feel like this should be possible, but I can't make it work... I want to use template deduction to deduce the argument type, but I want the function arg to be Unqual!T of the deduced type, rather than the verbatim type of the argument given. I've tried: void f(T : Unqual!U, U)(T a) {}

Re: Fun with templates

2013-07-05 Thread Daniel Murphy
Manu turkey...@gmail.com wrote in message news:mailman.1752.1373074509.13711.digitalmar...@puremagic.com... Okay, so I feel like this should be possible, but I can't make it work... I want to use template deduction to deduce the argument type, but I want the function arg to be Unqual!T of the

Re: Fun with templates

2013-07-05 Thread finalpatch
On Saturday, 6 July 2013 at 01:35:09 UTC, Manu wrote: Okay, so I feel like this should be possible, but I can't make it work... I want to use template deduction to deduce the argument type, but I want the function arg to be Unqual!T of the deduced type, rather than the verbatim type of the

Re: Fun with templates

2013-07-05 Thread Vladimir Panteleev
On Saturday, 6 July 2013 at 01:35:09 UTC, Manu wrote: Okay, so I feel like this should be possible, but I can't make it work... I don't think D's IFTI allows different argument and parameter types... I think this is possible with a proxy function (a function that accepts arguments with any

Re: Fun with templates

2013-07-05 Thread Timon Gehr
On 07/06/2013 03:34 AM, Manu wrote: Okay, so I feel like this should be possible, but I can't make it work... I want to use template deduction to deduce the argument type, but I want the function arg to be Unqual!T of the deduced type, rather than the verbatim type of the argument given. I've

Re: Anybody using D's COM objects?

2013-07-05 Thread Andrej Mitrovic
On 6/26/13, Sönke Ludwig slud...@outerproduct.org wrote: Am 25.06.2013 20:29, schrieb Walter Bright: Any projects using AddRef() and Release()? I'm currently using it for Direct2D and Direct3D 9/10/11. Also, I have an MIDL - D translator for WinRT and plan to make a language projection for

Re: Fun with templates

2013-07-05 Thread Manu
On 6 July 2013 11:41, Daniel Murphy yebbl...@nospamgmail.com wrote: Manu turkey...@gmail.com wrote in message news:mailman.1752.1373074509.13711.digitalmar...@puremagic.com... Okay, so I feel like this should be possible, but I can't make it work... I want to use template deduction to

  1   2   >