Re: std.locale

2009-03-02 Thread Christopher Wright
Andrei Alexandrescu wrote: The localized version will look like this: auto format = "File `%s' not found, system error is %s."; auto localFormat = currentLocale ? currentLocale.peek(format) : null; if (!localFormat) localFormat = format; throw Exception(localFormat, filename, errnomsg); This s

Re: std.locale

2009-03-02 Thread Christopher Wright
Andrei Alexandrescu wrote: If you want to provide a specific date formatter, you plant a delegate in the locale table. The code in Phobos doing formatting will detect that and call your delegate passing in the date. You do whatever you want on your side (format on the spot, use your own class h

Re: std.locale

2009-03-02 Thread Christopher Wright
Georg Wrede wrote: The hypothetical Ambitious Programmer might want to use locale. He could then have the dates and times (and currencies, etc.) follow the country. Now, that might sound commendable, but in practice it *crumbles*. He can't possibly know how to deal with languages that are writte

Re: std.locale

2009-03-02 Thread Christopher Wright
Georg Wrede wrote: (You know, a few years ago we had a major conversation here about whether non-ASCII variable names should be accepted in D. The end result is, yes. (I just tried it.) Now, how can an international team cowork on a project where variable names are written so the other folks ca

Re: Unofficial wish list status.(Mar 2009)

2009-03-01 Thread Christopher Wright
Daniel Keep wrote: unordered foreach( i ; 0..10 ) { ... } If the foreach body consists of a pure function call, then the foreach is reorderable and parallelizable. Considering that, you could save a keyword and use 'pure' rather than 'foreach'. If you like the idea, send Walter a patc

Re: __FUNCTION__

2009-03-01 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: grauzone wrote: For classes and structs, this is already possible: typeof(this).stringof Not outside of a member function. This is crippling my Visitor implementation. I use it in static constructors. If it

Re: __FUNCTION__

2009-02-28 Thread Christopher Wright
Andrei Alexandrescu wrote: grauzone wrote: For classes and structs, this is already possible: typeof(this).stringof Not outside of a member function. This is crippling my Visitor implementation. I use it in static constructors. If it doesn't work, well, that's news to me. I don't know ab

Re: __FUNCTION__

2009-02-28 Thread Christopher Wright
Walter Bright wrote: Andrei Alexandrescu wrote: I don't know much about APL, what was wrong with it? It needed a special keyboard. There is an input method for APL that supports standard keyboards, I believe.

Re: dmd platform support - poll

2009-02-27 Thread Christopher Wright
Jarrett Billingsley wrote: On Fri, Feb 27, 2009 at 4:19 AM, bearophile wrote: suresh: In my ideal world (dream :) ) 'gdc' would have been the main line for development and getting it to run on all the above mentioned platforms would be easy. Also take a look at LDC: http://www.dsource.org/pr

Re: Old problem with performance

2009-02-25 Thread Christopher Wright
Kagamin wrote: Daniel Keep Wrote: You probably don't want D, you want ATS: http://www.ats-lang.org/ Bye, bearophile http://www.ats-lang.org/EXAMPLE/MISC/listquicksort.dats Dear god. I think... I think I'm going to go cry in the corner... Is it common for functional languages to love 1-let

Re: Use case for std.bind

2009-02-25 Thread Christopher Wright
Walter Bright wrote: Jason House wrote: I'd give better examples/details if I wasn't typing this with my thumb into a cell phone... You do caps, quotes, special characters, correct grammar with your thumb on a cell phone?! I'm impressed! I can't bother with that without a full keyboard. Doin

Re: Old problem with performance

2009-02-25 Thread Christopher Wright
Weed wrote: Christopher Wright пишет: Weed wrote: As a result, classes will be slow, or require more code to achieve speeds comparable to C++. That is actually a model of classes D harder than C++. Yes, C++ offers more unsafe optimizations than D. Straight to the point! I am choosing

Re: Old problem with performance

2009-02-24 Thread Christopher Wright
Weed wrote: As a result, classes will be slow, or require more code to achieve speeds comparable to C++. That is actually a model of classes D harder than C++. Yes, C++ offers more unsafe optimizations than D.

Re: Old problem with performance

2009-02-24 Thread Christopher Wright
Kagamin wrote: Weed Wrote: But why not allow this operation at the same speed that allows C++? If you pass it by value you'll lose polymorphism. It is possible that this polymorphism is not needed and should be prohibited for operations by value. The class is ready, why it should not be used

Re: primitive vector types (permutation syntax)

2009-02-22 Thread Christopher Wright
Denis Koroskin wrote: On Sun, 22 Feb 2009 14:02:53 +0300, Mattias Holm wrote: I think that the following would work reasonably well: allow the [] operator for arrays to take comma separated lists of indices. So the OpenCL like statement: v.xyzw = v2.wzyx; will be written as:

Re: Is implicit string literal concatenation a good thing?

2009-02-22 Thread Christopher Wright
Brad Roberts wrote: Back in c and c++, with it's pre-processor, merging adjacent string literals is very handy. In D, it's only marginally so, but not completely useless. It can still be used to break a really long string literal into parts. There's other string boundary tokens in D which migh

Re: primitive vector types

2009-02-21 Thread Christopher Wright
Jarrett Billingsley wrote: On Sat, Feb 21, 2009 at 5:47 PM, Andrei Alexandrescu wrote: Yah, ref on the callee side, or the [] operator without any arguments on the caller side. Wait, what? I wouldn't have expected anything but "ref type[n] foo" on the function parameter to pass byref. What

Re: Tango: Out of Date Installation Instructions

2009-02-21 Thread Christopher Wright
Benji Smith wrote: I just set up a new (Windows) computer, after working with the same DMD/Tango/DWin/DSSS installation for the last six or eight months. And for the life of me, I can't get my code to compile on the new machine. The Tango installation instructions seem to be somewhat out of da

Re: primitive vector types

2009-02-21 Thread Christopher Wright
Andrei Alexandrescu wrote: Jarrett Billingsley wrote: Please make them value types. I, for one, am tired of dealing with their crap. Ok, you just tipped the balance :o). I'm also realizing something. The scenario I'm most afraid of is something like: char[1] humongous = "This is a humo

Re: assert or execption case program hang in multi thread

2009-02-21 Thread Christopher Wright
liyu wrote: > maybe i should title it assert or execption can't terminate the prog in > multithread:-) > yes, the main thread is still running, but i want the program terminated > when a assert failure or exception happened whatever. otherwise i have > to notify the main thread, i think that's a

Re: Is str ~ regex the root of all evil, or the leaf of all good?

2009-02-20 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: Your first example was: auto match (char[] source, char[] pattern, char[] options); Your second example was: auto match (char[] source, regex expression); The second is good, but more typing than you said originally. The first is

Re: Is str ~ regex the root of all evil, or the leaf of all good?

2009-02-19 Thread Christopher Wright
Derek Parnell wrote: "I don't think I like X" means that I *know* that I don't like X, there is no uncertainty. Not so. That is the only *reasonable* interpretation, but the person might not have any opinion whatsoever on the issue of whether they like X, and know that.

Re: Is str ~ regex the root of all evil, or the leaf of all good?

2009-02-19 Thread Christopher Wright
Denis Koroskin wrote: On Thu, 19 Feb 2009 15:00:42 +0300, Christopher Wright wrote: Denis Koroskin wrote: "abracazoo".match("a[b-e]", "g") is as short as "abracazoo" ~ regex("a[b-e]", "g") but doesn't existing conventions. I

Re: Old problem with performance

2009-02-19 Thread Christopher Wright
Weed wrote: Kagamin пишет: Weed Wrote: Will the language change? Hmm... You already has Walter's answer. He's the boss. I want a more specific answer (yes or no) if possible... It will not. If you come up with some really awesome use case, then it could, but nobody has yet, and the issue

Re: Is str ~ regex the root of all evil, or the leaf of all good?

2009-02-19 Thread Christopher Wright
Denis Koroskin wrote: "abracazoo".match("a[b-e]", "g") is as short as "abracazoo" ~ regex("a[b-e]", "g") but doesn't existing conventions. I prefer it over '~' version. In is also fine (both ways). This isn't so good for two reasons. First, I can't reuse regexes in your way, so if there is any

Re: problem with declaration grammar?

2009-02-19 Thread Christopher Wright
jerry quinn wrote: Christopher Wright Wrote: jerry quinn wrote: Hi there, I'm not sure if I'm missing something, but I'm having trouble seeing that a simple declaration will parse correctly with the D grammar. If we take a declaration statment like: int x = 3; we have

Re: problem with declaration grammar?

2009-02-18 Thread Christopher Wright
jerry quinn wrote: Hi there, I'm not sure if I'm missing something, but I'm having trouble seeing that a simple declaration will parse correctly with the D grammar. If we take a declaration statment like: int x = 3; we have (my best guess): DeclarationStatement -> Declaration Declaration ->

Re: (non)nullable types

2009-02-18 Thread Christopher Wright
Daniel Keep wrote: Christopher Wright wrote: One problem here is static constructors. They're supposed to run in import order, I believe, so if you do this: module A; Object o; static this () { o = new Object; } module B; import A; static this () { writeln(o); } That should be safe. I

Re: (non)nullable types

2009-02-18 Thread Christopher Wright
Christopher Wright wrote: Nick Sabalausky wrote: "Christopher Wright" wrote in message news:gnfgj6$148...@digitalmars.com... One possible change: implicit casting with an assertion that the nullable value is not null. I can tell right now I wouldn't like that. That would

Re: (non)nullable types

2009-02-17 Thread Christopher Wright
Nick Sabalausky wrote: "Christopher Wright" wrote in message news:gnfgj6$148...@digitalmars.com... One possible change: implicit casting with an assertion that the nullable value is not null. I can tell right now I wouldn't like that. That would make it far too easy to make

Re: (non)nullable types

2009-02-17 Thread Christopher Wright
Sergey Gromov wrote: Mon, 16 Feb 2009 13:26:29 +1100, Daniel Keep wrote: To clarify: I am, and always have been, in full support of non-nullable types, preferably by default. What I object to specifically in this case is the requirement to always check that a nullable value is not null every t

Re: OT -- Re: random cover of a range

2009-02-17 Thread Christopher Wright
Anonymous Coward wrote: Nick Sabalausky wrote: It takes a weak person to be harmed by words. Let me put it this way: if you've been picked on, put down, *hunted* by the people around you and generally treated as a sub-human piece of worthless garbage for over eight years of your life across

Re: OT -- Re: random cover of a range

2009-02-17 Thread Christopher Wright
John Reimer wrote: Nick, I'm merely saying that we must take responsibility for what we say, including the potential affect on the listener. I can't take it any more! Affect (noun): appearance, expression (on one's face) Effect (noun): result Affect (verb): alter, change, produce an effect Eff

Re: OT -- Re: random cover of a range

2009-02-16 Thread Christopher Wright
Denis Koroskin wrote: On Mon, 16 Feb 2009 23:36:12 +0300, Christopher Wright wrote: Denis Koroskin wrote: I know one - Jesus. I haven't seen Jesus. Seeing is believing, huh? I haven't *seen* a Christian who obeys all laws from the Torah, or even keeps kosher, to my knowle

Re: OT -- Re: random cover of a range

2009-02-16 Thread Christopher Wright
Denis Koroskin wrote: I know one - Jesus. I haven't seen Jesus. There is also "Jews for Jesus" organization that follow kosher diet. And I've also heard of christian old-believers in Russia that don't eat pork and shellfish. I've heard of Jews for Jesus, actually. I don't know many ultra-

Re: OT -- Re: random cover of a range

2009-02-16 Thread Christopher Wright
Don wrote: Yigal Chripun wrote: Nick Sabalausky wrote: "Yigal Chripun" wrote in message news:gn9qp7$ap...@digitalmars.com... A millennium ago, Europe was in the midst of the dark ages while all scientific advances were made by Islamic scholars (know Algebra?), and the christian world went on

Re: (non)nullable types

2009-02-15 Thread Christopher Wright
Nick Sabalausky wrote: "Christopher Wright" wrote in message news:gn7jn9$1i0...@digitalmars.com... class Foo { void delegate()? dg; void doStuff() { if (dg) { doPart1; doPart2; } else { // some other long

Re: OT -- Re: random cover of a range

2009-02-15 Thread Christopher Wright
John Reimer wrote: Hello Christopher, John Reimer wrote: Hello Christopher, John Reimer wrote: Hello bearophile, (And my name is bearophile, thank you). Bye, bearophile I'm curious to know what "bearophile" means? No cross, no crown, no green star. If you're disgusted by someone's u

Re: OT -- Re: random cover of a range

2009-02-15 Thread Christopher Wright
BCS wrote: John- I think you have a good point (not the original, that I will ignore for the moment) Why should people not of the Judeo-Christian world view be allowed to publicly state their view that people of the Judeo-Christian world view should not be allowed to publicly state their vi

Re: OT -- Re: random cover of a range

2009-02-14 Thread Christopher Wright
John Reimer wrote: Hello Christopher, John Reimer wrote: Hello bearophile, (And my name is bearophile, thank you). Bye, bearophile I'm curious to know what "bearophile" means? No cross, no crown, no green star. If you're disgusted by someone's username and it isn't actively evil, preten

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Denis Koroskin wrote: private void doPart1() { void delegate() dg = unchecked(this.dg); // no checking done // use dg here without checking // *BUT* it someone denies the contract and calls the method without // ensuring that this.dg is not null, you'll get a access violation (or NPE

Re: OT -- Re: random cover of a range

2009-02-14 Thread Christopher Wright
John Reimer wrote: Hello bearophile, (And my name is bearophile, thank you). Bye, bearophile I'm curious to know what "bearophile" means? No cross, no crown, no green star. If you're disgusted by someone's username and it isn't actively evil, pretend you don't know what it means. Don't w

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Nick Sabalausky wrote: You would only need to check when you're going to derefernce or convert to a non-nullable. Nulls could still be stored and passed around without checking. If this doesn't cover what you're concerned about, perhaps you could provide an example? Let's say I originally hav

Re: default random object?

2009-02-14 Thread Christopher Wright
Ary Borenszweig wrote: Christopher Wright escribió: Andrei Alexandrescu wrote: auto rng = Random(unpredictableSeed); auto a = 0.0, b = 1.0; auto x1 = uniform!("[]")(rng, a, b); auto x2 = uniform!("[)")(rng, a, b); auto x3 = uniform!("(]")(rng, a, b); auto x4 =

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Jarrett Billingsley wrote: On Sat, Feb 14, 2009 at 8:37 AM, Christopher Wright wrote: void Foo(void delegate()? dg) //nullable { dg(); } You're right for that small example. Now let's say you have an object a dozen methods referencing the same nullable member. They're

Re: Templates at runtime

2009-02-14 Thread Christopher Wright
Ary Borenszweig wrote: Christopher Wright wrote: Justin wrote: Is there a way to "find" a classinfo for such a class at runtime? The slow way: foreach (modul; ModuleInfo) foreach (info; modul.localClasses) if (info.name == name) return info; return null; It doesn&

Re: Some Ideas for Dynamic Vtables in D

2009-02-14 Thread Christopher Wright
Frits van Bommel wrote: Michel Fortin wrote: === In the current vtable system, each D object begins with a monitor pointer, followed by a pointer to the vtable, followed by the object’s members. === Isn't it { vtable, mon

Re: default random object?

2009-02-14 Thread Christopher Wright
Andrei Alexandrescu wrote: auto rng = Random(unpredictableSeed); auto a = 0.0, b = 1.0; auto x1 = uniform!("[]")(rng, a, b); auto x2 = uniform!("[)")(rng, a, b); auto x3 = uniform!("(]")(rng, a, b); auto x4 = uniform!("()")(rng, a, b); I always have to look up whether "[]" is exclusive or inclu

Re: random cover of a range

2009-02-14 Thread Christopher Wright
bearophile wrote: Andrei Alexandrescu: Your handwaving ain't much better than my memory. Hey, either somebody goes through the math over here or we can give up on the whole thing and use O(n) storage for the blessed thing.< We can implement both, and we can look what's better in practical si

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Nick Sabalausky wrote: The "burning hoop", as you describe it, of checking a nullable var for null before dereferencing is just simply something that the programmer should already be doing anyway. Take the following case: void Foo(void delegate()? dg) //nullable { dg(); } You're right fo

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Daniel Keep wrote: Both of these syntaxes are solving a problem that doesn't exist. This is why we have null dereference exceptions: accessing a null pointer is an error. All this is doing is moving the onus for the check from the hardware to the programmer. I believe you should be able to us

Re: (non)nullable types

2009-02-14 Thread Christopher Wright
Nick Sabalausky wrote: I still like this that someone else mentioned: T? x = something; if(x !is null) { // x is implicitly "T" here, not "T?" } else { // handle null condition (x is still "T?") } I hate it. It encourages too much nesting, and it silently changes a variable's type.

Re: Templates at runtime

2009-02-13 Thread Christopher Wright
Justin wrote: Is there a way to "find" a classinfo for such a class at runtime? The slow way: foreach (modul; ModuleInfo) foreach (info; modul.localClasses) if (info.name == name) return info; return null;

Re: (non)nullable types

2009-02-13 Thread Christopher Wright
Nick Sabalausky wrote: "Brian" wrote in message news:gn3dfn$2lp...@digitalmars.com... On Thu, 12 Feb 2009 08:41:54 -0500, Christopher Wright wrote: Brian mentioned having to check if the variable is null before using it. This would not be easy to implement, and it might be a bit h

Re: Old problem with performance

2009-02-13 Thread Christopher Wright
Rainer Deyke wrote: Unfortunately this doesn't solve the RAII problem: if value_semantics!(T) deletes the contained reference in its destructor, then it is no longer safe to embed a value_semantics!(T) variable in memory managed by the garbage collector. You can take additional steps to ensure

Re: random cover of a range

2009-02-13 Thread Christopher Wright
Andrei Alexandrescu wrote: Bill Baxter wrote: On Fri, Feb 13, 2009 at 7:21 AM, Andrei Alexandrescu wrote: Jason House wrote: Andrei Alexandrescu Wrote: No. Your wording sounds like you're doing stuff that's way off, but the resulting math is correct. My calculation would be based on the ave

Re: Old problem with performance

2009-02-12 Thread Christopher Wright
Rainer Deyke wrote: What mechanism for sharing state is available to by-reference objects but not by-value objects? struct C { T t; } C c1; C c2 = c1; If T was a reference type, 'c1' and 'c2' now share state, and it's up to the programmer to write code to prevent this. Moreover, the D lang

Re: (non)nullable types

2009-02-12 Thread Christopher Wright
Jarrett Billingsley wrote: Except honestly, the number of cases where you _don't_ want something to be null far outweighs the number of cases where you _do_. It's not exactly as insidious as the "throws" clause. I see what you're saying, though I'm certain there is a large minority of cases i

Re: (non)nullable types

2009-02-11 Thread Christopher Wright
Jarrett Billingsley wrote: On Wed, Feb 11, 2009 at 5:23 PM, Christopher Wright wrote: Or add an invariant. You know which field is null when it shouldn't be, so that should be simple enough. Or use a property rather than a field and add a contract. This covers the same cases that non-nul

Re: (non)nullable types

2009-02-11 Thread Christopher Wright
Jarrett Billingsley wrote: On Wed, Feb 11, 2009 at 3:40 PM, Christopher Wright wrote: Your language features should get rid of bugs that are easy to make and difficult to track down. It's not worthwhile to alter your language to remove easily found, easily fixed bugs. Except when so

Re: (non)nullable types

2009-02-11 Thread Christopher Wright
Sebastian Biallas wrote: Christopher Wright wrote: Oh, and I vote no. I think it's needless complexity. I code without any special care for null objects, and I get a segfault or NullReferenceException maybe once a week, probably less. I've always been able to track down the bug ve

Re: Old problem with performance

2009-02-11 Thread Christopher Wright
Rainer Deyke wrote: Andrei Alexandrescu wrote: So the problem exists since you are trusting the programmer to avoid it. The slicing problem exists in the sense that it is possible for a bad programmer to accidentally slice an object. However: - This is not a problem with the language, but a

Re: Proposal : allocations made easier with non nullable types.

2009-02-11 Thread Christopher Wright
Denis Koroskin wrote: Christopher Wright Wrote: Any case in which the default constructor has side effects or preconditions is a problem. 1) It is a valid C++ construct, and I don't remember having any problem with it. 2) It's just a shortcut for Foo foo = new Foo(). If you don

Re: escaping addresses of ref parameters - not

2009-02-11 Thread Christopher Wright
Bartosz Milewski wrote: What bothers me is that this is equivalent to saying that a seg fault caused by null dereference can be caught only if the programmer puts explicit runtime checks before it happens. I would say that reaks of C philosophy, except that in most C++ implementation I've been

Re: Old problem with performance

2009-02-09 Thread Christopher Wright
Weed wrote: And if I need some different such combinations? For each it is necessary to write such 8-10 lines? This is terrible! You need to add those lines for every method you need virtual dispatch with for your value type. It's an overhead of three lines per method, two for the interface (

Re: Lambda syntax, etc

2009-02-09 Thread Christopher Wright
Kagamin wrote: Christopher Wright Wrote: D: void foo(void delegate(int) dg); C#: delegate void SomeName(int i); void foo(SomeName dg); Does C# 3 fix this? I've seen the new syntax for defining delegates, but not for using them. C# got anough rope for this :) http://msdn.microsoft.c

Re: Proposal : allocations made easier with non nullable types.

2009-02-09 Thread Christopher Wright
Michel Fortin wrote: On 2009-02-09 06:41:59 -0500, Ary Borenszweig said: How would you do this? X x; if(someCondition) { x = new SomeX(); } else { x = new SomeOtherX(); } Well, the declaration could be transformed to this: X x = new X; But since x is not used before being reas

Re: (non)nullable types

2009-02-09 Thread Christopher Wright
Brian wrote: On Mon, 09 Feb 2009 04:25:55 +0300, Denis Koroskin wrote: So, let's ask the community: Would you like to see nullable types in D? http://www.micropoll.com/akira/mpview/539369-138652 (please, don't abuse by voting multiple time) Explain your reasoning in newsgroups. Thank you. i

Re: (non)nullable types

2009-02-09 Thread Christopher Wright
Brian wrote: On Mon, 09 Feb 2009 04:25:55 +0300, Denis Koroskin wrote: So, let's ask the community: Would you like to see nullable types in D? http://www.micropoll.com/akira/mpview/539369-138652 (please, don't abuse by voting multiple time) Explain your reasoning in newsgroups. Thank you. i

Re: escaping addresses of ref parameters - not

2009-02-09 Thread Christopher Wright
Denis Koroskin wrote: On Mon, 09 Feb 2009 11:24:09 +0300, Bartosz Milewski wrote: My point is that it's a redundant check. Whether it is there or not, the result is the same--the program will halt. Maybe the error message form enforce will look nicer, but that's about it. It will throw a

Re: escaping addresses of ref parameters - not

2009-02-09 Thread Christopher Wright
Daniel Keep wrote: I've used ref arguments in the past to wrap a C api that expects pointers. I'm fine with this so long as there is a way to break out of it (in regular D, at least) that makes it abundantly clear you need to know what you're doing. Something like: void wrapSomeCApi(ref Foo ar

Re: Old problem with performance

2009-02-09 Thread Christopher Wright
Rainer Deyke wrote: Andrei Alexandrescu wrote: The slicing problem exists in spades in this example, or better put its converse (your code will fire asserts when it shouldn't). The reason is rather subtle, so please try the code out to edify yourself. You're referring to the automatically gene

Re: Old problem with performance

2009-02-08 Thread Christopher Wright
Weed wrote: Christopher Wright пишет: Weed wrote: (Has started here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=81359) To me still does not give rest performance of classes (in comparison with C++ or with D structs) On my system, your struct exa

Re: Old problem with performance

2009-02-08 Thread Christopher Wright
Weed wrote: (Has started here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=81359) To me still does not give rest performance of classes (in comparison with C++ or with D structs) On my system, your struct example averaged 0.36 seconds, and your class e

Re: The path to unity [You ALL ignored my post!]

2009-02-07 Thread Christopher Wright
Andrei Alexandrescu wrote: By the way, what happened to std.traits and std.typecons? They are two of my faves and are growing as we speak. Andrei std.traits and tango.core.Traits have a number of superficial differences, such as ReturnType versus ReturnTypeOf, ParameterTypeTuple versus Par

Re: The path to unity [You ALL ignored my post!]

2009-02-07 Thread Christopher Wright
Don wrote: Don wrote: With the druntime project, we now have a run time which is shared between Tango and Phobos. This is a huge step forward, but it's still not much use without some common user code. The highest priorities which I see are, in order: (1) the C standard library tango.stdc = s

Re: The path to unity

2009-02-07 Thread Christopher Wright
Don wrote: The I/O is difficult. I think it's a legitimate design difference between Tango and Phobos -- we're probably stuck with it. I think it'd be better to leave it aside, and concentrate on unifying the simple stuff. It would be convenient if a shared low-level IO api could be used, so

Re: property syntax problems

2009-02-06 Thread Christopher Wright
Robert Jacques wrote: Also, the x.y.z = 10 not doing anything when y is a struct from your other post is a well known issue is all languages that have POD struct (As far as I know). The solution is to move x.y to a ref return property. Moving from POD members to functions in order to support mo

Re: Inline assembler in D and LDC, round 2

2009-02-06 Thread Christopher Wright
Andrei Alexandrescu wrote: Frits van Bommel wrote: Tomas Lindquist Olsen wrote: The approach Fritz mentions should still allow inlining. Having a fake Why do people keep performing s/s/z/ on my name? :( You're in luck. They tend to do s/ndrei/lex/ on mine :o). Andrei Has anyone s/Alexand

Re: Lambda syntax, etc

2009-02-05 Thread Christopher Wright
Kagamin wrote: Yeah, C# lambdas are the killer feature. Slick, readable, C-compatible. Anders knows his job. Let's face it: delegate literals suck a little, mixins as delegates suck a lot, the former is too verbose, the latter just sucks. C# delegates in C# 2.0 are annoying. I try not to use

Re: Dual CPU code

2009-02-02 Thread Christopher Wright
Andrei Alexandrescu wrote: Walter Bright wrote: bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bu

Re: D versus Objective C Comparison

2009-02-02 Thread Christopher Wright
John Reimer wrote: This is actually kind of interesting because it would seem to make Objective-C slightly comparable to the C# language in that it's more than just a language (as is Java). It's a platform (and the beauty of the platform is really only extensively demonstrated by the OS runtim

Re: Multiple Tuple IFTI Syntactic Sugar

2009-02-01 Thread Christopher Wright
dsimcha wrote: I've been thinking about how IFTI works for variadic function templates. I use variadic functions heavily in the infotheory module of dstats, and am looking to add some features here. Currently, my mutual information function looks like: real mutualInfo(T, U)(T[] x, U[] y); I'd

Re: Scientific computing with D

2009-01-31 Thread Christopher Wright
Walter Bright wrote: Daniel Keep wrote: Walter Bright wrote: Bill Baxter wrote: Having to recompile and rerun after every one of those changes just isn't quite as direct. If it can be done in under half a second, isn't that direct enough? Of course, I'm talking about a shell that does it for

Re: D versus Objective C Comparison

2009-01-31 Thread Christopher Wright
It seems that your only significant complaint about Descent is that it is not integrated with DSSS. I believe you can set up DSSS as an external task in Eclipse: http://dsource.org/projects/descent/wiki/CompilingPrograms I believe this will call dsss (or whatever program you specify) on the cu

Re: better compile-time messages for string functors

2009-01-31 Thread Christopher Wright
Andrei Alexandrescu wrote: Don wrote: Not necessarily. Andrei can just add: static if(__traits(compiles, mixin(comp) )) { mixin(comp); } else { // static assert is a bit broken, // better to do it this way to provide a backtrace. pragma(msg, "Bad predicate: " ~ comp); deliberate_e

Re: ch-ch-update: series, closed-form series, and strides

2009-01-31 Thread Christopher Wright
Andrei Alexandrescu wrote: The truth is, the reasons against using strings for short functions are shrinking. I mean, you don't want to not use strings just to not use strings, right? I hope I convinced you that strings are unbeatable for short functions that don't need access to local state, t

Re: ch-ch-update: series, closed-form series, and strides

2009-01-31 Thread Christopher Wright
Ary Borenszweig wrote: Ah... But I can see the problem with delegates. I guess with strings you just mix them in a bigger expression and it's like inlining the call. With delegates you can't do that. So there's also a performance tradeoff... If it's an alias, it should be inlinable. The fronte

Re: Scientific computing with D

2009-01-31 Thread Christopher Wright
Saaa wrote: :D Is that some sort of successor to D? C++ is still alive and people are already trying to beat D!

Re: Heap: container or range?

2009-01-29 Thread Christopher Wright
Andrei Alexandrescu wrote: Bill Baxter wrote: On Fri, Jan 30, 2009 at 12:14 PM, Andrei Alexandrescu Ah, never mind all that. I realized that I can't have a heap range. This is because heaps must mutate the underlying range in-place and any copy will mess the heap up. Here's the example that c

Re: Compiler as dll

2009-01-29 Thread Christopher Wright
Daniel Keep wrote: Personally, I think the best approach is to combine the two; write the hot spots in C, D or some other fast language, and all the glue in a dynamic language. For all it's expressiveness, there are just some things that are easier to do with a dynamic language like Python or Lu

Re: ch-ch-changes

2009-01-28 Thread Christopher Wright
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 sorting the stride means you ha

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

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. Couldn't

Re: Compiler as dll

2009-01-27 Thread Christopher Wright
bearophile wrote: In C# 4.0 the VM becomes a module of the standard lib, so it can be used from normal C# code, to do various things. While writing a genetic programming program (and in some other situations) I find it useful to have an eval() function, like in Lisp/Scheme and most scripting

Re: range and algorithm-related stuff

2009-01-27 Thread Christopher Wright
Denis Koroskin wrote: My point is, if empty() returns false (and you can't know it because empty() is not const) you may get either an invalid result, access violation or an exception on member access: void foo(Range)(const Range r) { // is r empty? can I /safely/ access its head? // let

Re: D to C compiler?

2009-01-27 Thread Christopher Wright
Brad Roberts wrote: It could, but then it still wouldn't necessarily interact properly with other C++ or D code eh mechanisms which aren't sjlj based. On unix, sjlj exceptions aren't used anymore. I'm not sure about windows. The presentation I saw that went through win64 showed that at least t

Re: range and algorithm-related stuff

2009-01-25 Thread Christopher Wright
Andrei Alexandrescu wrote: Sergey Gromov wrote: Sat, 24 Jan 2009 17:09:07 -0800, Andrei Alexandrescu wrote: I'm working on the new range stuff and the range-based algorithm. In all likelihood, you all might be pleased with the results. I wanted to gauge opinions on a couple of issues. One is

Re: OT: Worthwhile *security-competent* web host?

2009-01-25 Thread Christopher Wright
Andrei Alexandrescu wrote: Never ever *ever* EVER *EVER* email a password in clear. I'd say, if anyone thinks she wants to do that, she doesn't deserve a server that understands basic security concepts, even if one existed. Andrei This isn't terribly important if you're only considering one

Re: Getting D language patch into GDB

2009-01-24 Thread Christopher Wright
Jason House wrote: I was chatting on #gdb earlier today and it sounds like getting a patch for the d programming language into gdb shouldn't be too bad. There's a patches mailing list and some kind of paperwork to resolve copyright issues. Is there any legal/copyright issues that prevent the

<    1   2   3   4   5   >