Re: OT: on IDEs and code writing on steroids

2009-05-18 Thread Christopher Wright
davidl wrote: From a commercial basis for Walter, it may be easier to glue a C# frontend against the DMD backend to create a native C# compiler. Mono has AOT compilation. On the other hand, I've experienced more ICE per minute with Mono than with dmd. This is partially due to dmd's near mono

Re: "with" should be deprecated with extreme prejudice

2009-05-18 Thread Christopher Wright
Andrei Alexandrescu wrote: Bill Baxter wrote: On Mon, May 18, 2009 at 1:36 PM, Andrei Alexandrescu wrote: That's not an "equiv of". It's "completely missing the point of". Each "using" costs one new scope and one level of indentation which makes it non-scalable. Indentation is *expensive*. I t

Re: "with" should be deprecated with extreme prejudice

2009-05-18 Thread Christopher Wright
Steven Schveighoffer wrote: On Mon, 18 May 2009 16:14:29 -0400, Andrei Alexandrescu wrote: Nick Sabalausky wrote: "Leandro Lucarella" wrote in message news:20090518141908.gb9...@burns.springfield.home... bearophile, el 18 de mayo a las 04:33 me escribiste: Andrei, I agree that "with" is d

Re: foreach (x; a .. b) and foreach_reverse (x; a .. b) should be disallowed

2009-05-18 Thread Christopher Wright
grauzone wrote: Look at this for example: > writefln("%s", is(typeof(rtzx) == char)); This compiles even if rtzx doesn't exist. But you probably wanted to check the type of rtzx, not it if rtzx exists. If you mistyped rtzx, the compiler will never tell you. You can do 'is(typeof(rtzx)) && is

Re: OT: on IDEs and code writing on steroids

2009-05-17 Thread Christopher Wright
Ary Borenszweig wrote: BCS escribió: Hello Georg, So, in a way, Microsoft may be right in assuming that (especially when their thinking anyway is that everybody sits at a computer that's totally dedicated to the user's current activity anyhow) preposterous horse power is (or, should be) availa

Re: JSON in D

2009-05-17 Thread Christopher Wright
Fawzi Mohamed wrote: As we are about JSON blip has also one. It does not aim at replacing tango's one, which is really fast, and is the way to go if you want to read JSON to an in memory representation of it. On the other hand if you want to use JSON for serialization, i.e. to read into your

Re: Please Vote: Exercises in TDPL?

2009-05-16 Thread Christopher Wright
Daniel Keep wrote: Better than having a crash with OPTLINK with no error message nor indication of what the problem is, where the only reproducible test case is 2MB worth of object files and which has already cost you four days of trying fruitlessly to work around it, still without a solution. A

Re: Please Vote: Exercises in TDPL?

2009-05-16 Thread Christopher Wright
Don wrote: grauzone wrote: Incidentally, here, or in D.learn, somebody was asking for symbolic derivation with D templates. I think one of the excercises in SICP was to write a lisp snippet that did just that. Awesome stuff, through and through. An awesome way to hit compiler bugs, huh? We

Re: assignment: left-to-right or right-to-left evaluation?

2009-05-16 Thread Christopher Wright
Georg Wrede wrote: bearophile wrote: Georg Wrede: arra[i] = arrb[i++]; arra[i++] = arrb[i]; I'm not sure that such dependences are good code. By stating a definite order between lvalue and rvalue, you would actually encourage this kind of code. I agree that putting such things in code is bad

Re: OT: on IDEs and code writing on steroids

2009-05-16 Thread Christopher Wright
Georg Wrede wrote: If we were smart with D, we'd find out a way of leapfrogging this thinking. We have a language that's more powerful than any of C#, Java or C++, more practical than Haskell, Scheme, Ruby, &co, and more maintainable than C or Perl, but which *still* is Human Writable. More i

Re: Please Vote: Exercises in TDPL?

2009-05-15 Thread Christopher Wright
Nick Sabalausky wrote: "Sean Kelly" wrote in message I also don't understand why professors seem to always choose academic textbooks on the subject when I know there are infinitely better trade books available (which I generally already own). Hear hear!! There's also another phenomenon I've

Re: JSON in D

2009-05-15 Thread Christopher Wright
Sean Kelly wrote: == Quote from Steve Teale (steve.te...@britseyeview.com)'s article I'm trying to write a JSON parser/generator. If anyone else is doing the same, can we collaborate? I've got one, but I wrote it for work so I'm not sure if I can release it. I'd be happy to offer suggestions

Re: A case for opImplicitCast: making string search work better

2009-05-15 Thread Christopher Wright
downs wrote: Consider this type: struct StringPosition { size_t pos; void opImplicitCast(out size_t sz) { sz = pos; } void opImplicitCast(out bool b) { b = pos != -1; } } Wouldn't that effectively sidestep most problems people have with find returning -1? Or am I missing som

Re: Please Vote: Exercises in TDPL?

2009-05-15 Thread Christopher Wright
Andrei Alexandrescu wrote: Sean Kelly wrote: Brad Roberts wrote: There's only one book that I can remember ever working through the exercises on.. and that's even a stretch of the term exercise: Exceptional C++. For any of you that develop c++ code and haven't read that book.. I highly r

Re: Wrt. threadlocal by default: shared module constructors

2009-05-13 Thread Christopher Wright
Brad Roberts wrote: An interesting side effect of these changes is that thread startup cost is going to increase. Yet more reasons to avoid globals and global initialization. -- Brad It'll further promote use of threadpools. This isn't terribly safe because the globals for that thread are

Re: When will D1 be finished?

2009-05-13 Thread Christopher Wright
Andrei Alexandrescu wrote: If this is important to you, wouldn't it be more appropriate to look into making the patch complete instead of complaining about it? Andrei The poster of the patch believes it to be complete. Walter looks at it and believes that it is not. It adds perhaps one minut

Re: D users in Munich, Rome, Venice, or Frankfurt?

2009-05-13 Thread Christopher Wright
BCS wrote: Hello Derek, On Wed, 13 May 2009 01:04:19 + (UTC), BCS wrote: Ah! One of my favorite qwerks of the English language, how to refer to a specific single someone of unknown gender without insulting them: "it"? I hate it but what can I do? Use "they". Sure, its wrong but everyon

Re: What's the current state of D?

2009-05-12 Thread Christopher Wright
Georg Wrede wrote: Knowing what (*seriously excuse* the wording here) fascists the FSF guys are, they obviously assume similar behavior of any opposition. That explains why they appear paranoid and unreasonable in their demands of the copyright statements for any code even remotely considered f

Re: When will D1 be finished?

2009-05-12 Thread Christopher Wright
Walter Bright wrote: Christopher Wright wrote: Awesome! I'll add this to wiki4d. Might I also suggest adding it to some reasonable location on digitalmars.com and bugzilla? I think the wiki is the best place. What do you do about examples that should explicitly not compile? For examp

Re: When will D1 be finished?

2009-05-12 Thread Christopher Wright
Walter Bright wrote: Christopher Wright wrote: However, if a patch exists, there is only one excuse for not including it: lack of testing. And there is one huge reason that nobody submits additional test cases to your DMD test suite -- you've never released it, or even specified

Re: Overriding Private

2009-05-12 Thread Christopher Wright
dsimcha wrote: == Quote from Christopher Wright (dhase...@gmail.com)'s article dsimcha wrote: Is there any hack in D that will allow overriding of privacy settings on classes? For example, I really need a feature that will force D to let me mess with the internals of a class that I ha

Re: When will D1 be finished?

2009-05-12 Thread Christopher Wright
Walter Bright wrote: Luís Marques wrote: Two years ago, I tried to use a particular construct and DMD incorrectly detected that a statement was not reachable [1]. OK, D1 had been frozen earlier that year, so I thought it would be only a matter of time until the higher priority stuff had been t

Re: project oriented

2009-05-12 Thread Christopher Wright
davidl wrote: The module package system still stays in the state of the C age. It's file oriented. I think there's no more sound package system than C# one. The namespace and distributed packaging is a must nowadays and the compiler should be project oriented and take project information as the

Re: Overriding Private

2009-05-12 Thread Christopher Wright
dsimcha wrote: Is there any hack in D that will allow overriding of privacy settings on classes? For example, I really need a feature that will force D to let me mess with the internals of a class that I have no control over from a subclass, effectively making private members protected. I know

Re: assignment: left-to-right or right-to-left evaluation?

2009-05-12 Thread Christopher Wright
Michiel Helvensteijn wrote: Jarrett Billingsley wrote: It's incredibly rare that I have to assign the same value to multiple targets, and when I do, the little time I could save by not typing the second assignment is offset by the increased time it takes me to look for assignments to a variable

Re: When will D1 be finished?

2009-05-12 Thread Christopher Wright
Georg Wrede wrote: Derek Parnell wrote: I am not saying that D1 is not finished, but I am saying that DMD-v1 is not finished. D1 documentation says X is a function of D1. DMD-v1 does not implement X. Therefore DMD-v1 is not a complete implementation of D1. Even though D1 is finished,

Re: SCHEDULED for deprecation

2009-05-10 Thread Christopher Wright
Tomasz Sowiński wrote: This phrase gave me an idea for a small feat: deprecated(2009-4-19) void foo(); Compiling references to the deprecated declaration *before* the deprecation date would result in a *warning*. Compiling the deprecated declaration OR any reference to it *after* the date wou

Re: What's the current state of D?

2009-05-10 Thread Christopher Wright
Nick Sabalausky wrote: About the null references, most people seem to agree that the right way to fix that is with some sort of "non-nullable". But there's a lot of disagreement on exactly how non-nullables should work. And whether they *can* work. D2 has struct constructors, so structs can h

Re: What's the current state of D?

2009-05-10 Thread Christopher Wright
torhu wrote: On 10.05.2009 00:05, mpt wrote: I keep making 2 mistakes in my D programs, and fixing them feels troublesome. 1. Null references. I get a segfault and gdb is useless (ldc thing maybe). 2. Exceptions. It prints the msg nicely, but it's unhelpful in tracing the real cause of error.

Re: What's the current state of D?

2009-05-09 Thread Christopher Wright
Tyro[a.c.edwards] wrote: On 5/9/2009 11:24 AM, grauzone wrote: beyond and I'm quite sure that I'm not the only one. For all the Naysayers out there... Keep saying nay and go the hell away. D2 is just where it is supposed to be. Let’s not end up in the same mess we did by trying to make impatient

Re: What's the current state of D?

2009-05-09 Thread Christopher Wright
torhu wrote: On 09.05.2009 00:29, Christopher Wright wrote: Open source projects tend to have to support wider ranges of compilers. I've seen OSS projects where they prioritized issues specific to gcc-3.4.2 as highly as any other issue, even if the developers typically used the 4.x b

Re: What's the current state of D?

2009-05-08 Thread Christopher Wright
Sean Kelly wrote: == Quote from Steve Teale (steve.te...@britseyeview.com)'s article OK so for those who crave stability there is D1.x, but when all the focus appears to be on D2, what level of confidence is afforded to D1 users. Can a project Manager cross his heart and say that D1 will still

Re: What's the current state of D?

2009-05-08 Thread Christopher Wright
Steve Teale wrote: This is the sort of answer that will kill D. The guy comes back after 2 years, asks a straight question, and get's told "business as usual, we're still arguing among ourselves about what it should be". Last week I asked Andrei what DMD2/Phobos to use, looking for something

Re: Many questions

2009-05-06 Thread Christopher Wright
Denis Koroskin wrote: On Wed, 06 May 2009 02:36:21 +0400, Christopher Wright wrote: I see no use case for having one module in multiple files, though -- the only benefit would be private access to things defined in other files. I've never been big on making stuff private, though. The

Re: Many questions

2009-05-05 Thread Christopher Wright
grauzone wrote: Christopher Wright wrote: It *is* possible, by use of public imports. Are you splitting one file into many? Public import the other modules. Are you merging many files into one? Leave the other files with just a public import of the merged file. Nice story. In reality you

Re: Many questions

2009-05-05 Thread Christopher Wright
Georg Wrede wrote: Yigal Chripun wrote: *but*, I do think that splitting one file that got too big over time or uniting a bunch of small files into one should be possible. This would be especially good for us. D is mainly developed by individuals, and there projects tend to grow organically -

Re: Many questions

2009-05-04 Thread Christopher Wright
Fractal wrote: That's debatable. The hateful thing about namespaces is that they give you absolutely ZERO clue as to where any particular thing is coming from. If I see "tango.io.device.File", I know exactly where the source for that module is. -- Daniel Yes it is true. But the thing is no

Re: Throwable, Exception, and Error

2009-05-03 Thread Christopher Wright
Steve Teale wrote: Christopher Wright Wrote: Frank Benoit wrote: Walter Bright schrieb: Steve Teale wrote: If I want a catch-all catch, which should I be using. Out of habit I use Exception, but if I do that then I will miss some things thrown from Phobos. Is it the intention that

Re: can ibm support the d language £¿

2009-05-03 Thread Christopher Wright
dolive wrote: may the ibm support the d language £¿ If you asked them for a support contract, they would probably accept, but charge you lots of money. Since it's rather far afield of anything else they do, this would likely be around $2**20 annually (at least $2**17, I'd say -- it be a ful

Re: Throwable, Exception, and Error

2009-05-03 Thread Christopher Wright
Frank Benoit wrote: Walter Bright schrieb: Steve Teale wrote: If I want a catch-all catch, which should I be using. Out of habit I use Exception, but if I do that then I will miss some things thrown from Phobos. Is it the intention that Throwable be used for this purpose? Yes. Why is it p

Re: C tips (again)

2009-05-02 Thread Christopher Wright
superdan wrote: Steve Teale Wrote: bearophile Wrote: So I agree with nearly nothing you have (badly) expressed. Bye, bearophile Who is this guy?" He must be putting his messages through one of those web sites that translate into strange dialects - fry my ass! fer tat i recommend da geor

Re: I wish I could use D for everything

2009-05-01 Thread Christopher Wright
dsimcha wrote: == Quote from Brad Roberts (bra...@puremagic.com)'s article dsimcha wrote: D2 is a complex language, but it's not complex in a haphazard way. It's complex because it statically proves stuff about your code (const, etc), and allows extremely powerful, generic user-defined types

Re: I wish I could use D for everything

2009-05-01 Thread Christopher Wright
Derek Parnell wrote: On Thu, 30 Apr 2009 13:23:52 -0400, superdan wrote: (actually who cares what he wrote ...) "superdan", when you grow up I'm certain that you will be an important person. I just hope we don't have to wait too long. On those occasions on which I've read a post by superdan,

Re: I wish I could use D for everything

2009-04-30 Thread Christopher Wright
Robert Fraser wrote: Christopher Wright wrote: - a mock object library that doesn't force me to gouge my eyes out (which I could probably do by now) - an ORM library comparable to NHibernate http://www.dsource.org/projects/dmocks Not sure if the Sleeper is "comparable to NHiber

Re: RFC: naming for FrontTransversal and Transversal ranges

2009-04-30 Thread Christopher Wright
Rainer Deyke wrote: Christopher Wright wrote: Rainer Deyke wrote: Don't forget: + Supports timely destruction of contents (i.e. RAII). These are collections. RAII doesn't matter when you have a garbage collector and the only resource you have is memory, unless you're qui

Re: I wish I could use D for everything

2009-04-30 Thread Christopher Wright
Andrei Alexandrescu wrote: There have been quite a few bugs in the I/O functions because the infrastructure underneath them has gone through a few major revisions. As Don said, D2 is an alpha and it cannot be held to the stability standards of a finished product. Then I should wait a few revi

Re: I wish I could use D for everything

2009-04-30 Thread Christopher Wright
Unknown W. Brackets wrote: I'm lucky, I'm a technical lead/manager at work, so I get to say "for this project, we're using D." And then it happens. Muhahaha. We're a small shop but I enjoy my small amount of power. I could do that, but D is lacking essentials for me: - a message bus that i

Re: I wish I could use D for everything

2009-04-30 Thread Christopher Wright
Steven Schveighoffer wrote: I can't wait for D to take over the world, so I no longer have to write in this horrid language ;) C# is pretty reasonable. I see a fair number of things in recent versions that have been in D for a while, and some other vaguely neat things that D doesn't have on o

Re: RFC: naming for FrontTransversal and Transversal ranges

2009-04-30 Thread Christopher Wright
Rainer Deyke wrote: Andrei Alexandrescu wrote: 1. Value semantics (arrays are like int) Don't forget: + Supports timely destruction of contents (i.e. RAII). These are collections. RAII doesn't matter when you have a garbage collector and the only resource you have is memory, unless you're

Re: Keyword 'dynamic' of C#4

2009-04-28 Thread Christopher Wright
Unknown W. Brackets wrote: I read until I hit this: 4. if (o__SiteContainer0.<>p__Site1 == null) And I was suddenly hit with a huge feeling of "I'm glad D doesn't look like this." Seriously, I hope this is some sort of decompiled syntax and not actually valid. It's decompiled: "This

Re: Phobos2: sorting and std.typecons.Tuple

2009-04-27 Thread Christopher Wright
Andrei Alexandrescu wrote: bearophile wrote: Andrei Alexandrescu: s/recursive/transitive/ Litmus test: recursive could recurse forever. Transitive never does. I have used the word recursive because the functions I have designed (and I think they are designed correctly) call themselves until

Re: Yet another strike against the current AA implementation

2009-04-27 Thread Christopher Wright
Simen Kjaeraas wrote: Andrei Alexandrescu wrote: Georg Wrede wrote: There's an illusion. And that illusion comes from the D newsgroups having "wrong" names. The D2 newsgroup should have a name like "D2 discussion -- for D language development folks, enter at your own risk". And a *D1* newsg

Re: Why is utf8 the default in D?

2009-04-27 Thread Christopher Wright
Frank Benoit wrote: M$ and Java have chosen to use utf16 as their default Unicode character encoding. I am sure, the decision was not made without good reasoning. What are their arguments? Why does D propagate utf8 as the default? Unicode did not match ISO10646 when Java and Windows standardiz

Re: Yet another strike against the current AA implementation

2009-04-26 Thread Christopher Wright
Andrei Alexandrescu wrote: 2. I haven't measured, but the cost of the indirect call is large enough to make me suspect that opApply is not as efficient as it's cracked to be, even when compared with an iterator. When you know the type beforehand or can use templates, that is, rather than wrap

Re: If T[new] is the container for T[], then what is the container for T[U]?

2009-04-26 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: Simple solution: put the array definition in object.d and try implementing arrays with reference counting or manual memory management. I think stored slices break manual memory management, even with a dedicated slice type; but they should

Re: If T[new] is the container for T[], then what is the container for T[U]?

2009-04-25 Thread Christopher Wright
Robert Jacques wrote: On Sat, 25 Apr 2009 18:04:32 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: 1) In what way would it help to give the owner an identity? For example, on an implementation that doesn't want gc, they'd need the owner for deterministic destruction. Why is a si

Re: If T[new] is the container for T[], then what is the container for T[U]?

2009-04-25 Thread Christopher Wright
Andrei Alexandrescu wrote: It looks we can't make it with only T[]. Citation needed. If this is a continuation of a previous discussion, a link to the previous discussion will suffice. I grant that appending to an array is expensive. Make Array a user-defined type and we can see what's appr

Re: -nogc

2009-04-23 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: This means replacing a mark/sweep GC with a reference counting GC. It just means that certain types and constructs are rewritten. The exact strategy depends on how Ref, Array, and AssocArray are defined. Probably a good approach is to

Re: -nogc

2009-04-23 Thread Christopher Wright
Andrei Alexandrescu wrote: I've discussed something with Walter today and thought I'd share it here. The possibility of using D without a garbage collector was always looming and has been used to placate naysayers ("you can call malloc if you want" etc.) but that opportunity has not been realize

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Christopher Wright
Michel Fortin wrote: On 2009-04-20 07:25:43 -0400, Christopher Wright said: BCS wrote: Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being

Re: Fully dynamic d by opDotExp overloading

2009-04-20 Thread Christopher Wright
BCS wrote: Hello Christopher, The utility is when you are looking for methods to invoke via runtime reflection, you can determine that a given function is one of these runtime opDotExp equivalents. So it is being argued that there should be a standard way to do a run time function invocation

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Christopher Wright
Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-04-18 22:21:50 -0400, Andrei Alexandrescu said: I did, but sorry, it doesn't make sense and does nothing but continue the terrible confusion going in this thread. Then let's try to remove some of that confusion. Thanks for doing so.

Re: Fully dynamic d by opDotExp overloading

2009-04-19 Thread Christopher Wright
Michel Fortin wrote: The thing is that the name of that "catchAllHandlerFunc" function needs to be standardised for it to work with runtime reflection. I agree with this wholeheartedly. However, opDotExp would be hamstringed if it were made to serve this function. Since classes can implemen

Re: GC object finalization not guaranteed

2009-04-19 Thread Christopher Wright
Daniel Keep wrote: Walter Bright wrote: Leandro Lucarella wrote: Close a connection gracefully for example, I guess (I mean, send a "bye" packed, not just close the socket abruptly). Same for closing files writing some mark or something. They can be risky when finalization is not deterministic

Re: GC object finalization not guaranteed

2009-04-18 Thread Christopher Wright
Walter Bright wrote: Leandro Lucarella wrote: You missed the point. I'm not talking about freeing the memory. I'm talking about finalizers. A finalizer could send a "bye" packet throgh the net. That can't be handled by the OS. That shouldn't be handled by a finalizer. A "bye" packet can be h

Re: Fully dynamic d by opDotExp overloading

2009-04-18 Thread Christopher Wright
bearophile wrote: Andrei Alexandrescu: Yes. The amount of confusion in this thread is staggering. I think I have misunderstood about the whole thread then. If the string isn't determined at run time, then this thing isn't useful for my purposes, and it's not close to the object-C as I was ta

Re: Fully dynamic d by opDotExp overloading

2009-04-18 Thread Christopher Wright
Daniel Keep wrote: Cool! I suggest the rewrite: c.unknownmethod(args) -> c.opDotExp!("unknownmethod")(args) That way you have the option of handling the method name statically or dynamically. Careful. If you do that, you need to make sure it's possible to invoke a given method at runtime. A

Re: Fully dynamic d by opDotExp overloading

2009-04-18 Thread Christopher Wright
Nick Sabalausky wrote: "Christopher Wright" wrote in message news:gsb05g$2in...@digitalmars.com... Assuming that you are testing the logic of your application, you will trivially check things like accessing "legnth" rather than "length" -- under the assumption t

Re: Fully dynamic d by opDotExp overloading

2009-04-18 Thread Christopher Wright
Don wrote: Steven Schveighoffer wrote: On Fri, 17 Apr 2009 21:54:52 -0400, Steven Schveighoffer wrote: Andrei wrote: We are discussing a language extension. That language extension will allow a type to choose flexibility in defining methods dynamically, while being otherwise integrated syn

Re: Fully dynamic d by opDotExp overloading

2009-04-18 Thread Christopher Wright
Steven Schveighoffer wrote: On Fri, 17 Apr 2009 21:54:52 -0400, Steven Schveighoffer wrote: Andrei wrote: We are discussing a language extension. That language extension will allow a type to choose flexibility in defining methods dynamically, while being otherwise integrated syntactically w

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Andrei Alexandrescu wrote: Christopher Wright wrote: Andrei Alexandrescu wrote: Cool! I suggest the rewrite: c.unknownmethod(args) -> c.opDotExp!("unknownmethod")(args) That way you have the option of handling the method name statically or dynamically. How would that allow

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Nick Sabalausky wrote: "bearophile" wrote in message news:gsai34$1p9...@digitalmars.com... Nick Sabalausky: There are people who swear by the ability of adding methods at runtime and changing the inheritance hierarchy dynamically. It makes for a very fluid environment. Personally, I've alwa

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Andrei Alexandrescu wrote: I think there's merit in binding via strings. It makes for very flexible code that is future-proof, dynamic-linking-friendly, and hot-swappable without recompiling (e.g. you don't need to recompile because you now implement an interface etc.) Reflection is very useful

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Nick Sabalausky wrote: "davidl" wrote in message news:op.usje9ia3j5j...@my-tomato... The benefit is you don't need to write the call function, ...But you do have to write the opDotExp() function. How is that less work than just writing a dispatch function? It's more work, but it lets you d

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Andrei Alexandrescu wrote: Yah, glad someone mentioned it :o). The best way is a blend - you can statically dispatch on some popular/heavily-used names, then rely on a hashtable lookup for dynamic stuff. Andrei You suggest: auto opDotExp(string name)(...) { static if (name == "some

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
Andrei Alexandrescu wrote: Cool! I suggest the rewrite: c.unknownmethod(args) -> c.opDotExp!("unknownmethod")(args) That way you have the option of handling the method name statically or dynamically. How would that allow you to handle the method name dynamically, if you're passing it as a t

Re: TypeInfoEx and Variant: suggestions?

2009-04-17 Thread Christopher Wright
Daniel Keep wrote: Christopher Wright wrote: Daniel Keep wrote: Use the Tango Variant code. It supports values of any size and doesn't require knowledge of the compile-time type. Not so. That was one of three reasons that I wrote my own Variant previously (the others being toStrin

Re: Fully dynamic d by opDotExp overloading

2009-04-17 Thread Christopher Wright
davidl wrote: After tweaking dmd a bit litte, i get the dotexp overloading work. Do want. With this and extended runtime information, you can create a Variant that works exactly like the original type, allowing you to call methods on it without extracting it to the original type, just throwi

Re: Status of ClassInfo.getMembers / TypeInfo_Struct.xgetMembers

2009-04-16 Thread Christopher Wright
Daniel Keep wrote: Are these methods going to be implemented any time soon? I just stumbled across these are practically jumped for joy at what they'd allow me to do. I mean, they return an array of these: No. They've been there time out of mind and are still not implemented. They would be s

Re: TypeInfoEx and Variant: suggestions?

2009-04-16 Thread Christopher Wright
Daniel Keep wrote: Use the Tango Variant code. It supports values of any size and doesn't require knowledge of the compile-time type. Not so. That was one of three reasons that I wrote my own Variant previously (the others being toString and sameness comparison).

TypeInfoEx and Variant: suggestions?

2009-04-16 Thread Christopher Wright
Hi all, I finally found some time to work on TypeInfoEx. It's usable, in that you can view information about a type; but you can't do anything with that information. One large barrier is the lack of a usable Variant type. To invoke a function on an object or struct, you need to pass it as ei

Re: Why does readln include the line terminator?

2009-04-15 Thread Christopher Wright
Robert Fraser wrote: Christopher Wright wrote: Steven Schveighoffer wrote: auto reader = file.byLine!("/[.,]/")(); Why specify anything at compile time when a user could reasonably generate the value at runtime? auto reader = file.byLine(readConfig().separator); Yes, and f

Re: Why Java Doesn't Need Operator Overloading (and Very Few Languages Do, Really)

2009-04-15 Thread Christopher Wright
Don wrote: Paul D. Anderson wrote: Sounds like someone needs a strong dose of D!! http://java.dzone.com/articles/why-java-doesnt-need-operator The comments bounce between "operator overloading is always bad because you can do idiotic things with it" and "operator overloading is essential bec

Re: Why does readln include the line terminator?

2009-04-15 Thread Christopher Wright
Steven Schveighoffer wrote: auto reader = file.byLine!("/[.,]/")(); Why specify anything at compile time when a user could reasonably generate the value at runtime? auto reader = file.byLine(readConfig().separator);

Re: Navigate from ClassInfo to TypeInfo

2009-04-14 Thread Christopher Wright
Frank Benoit wrote: I need to retrieve an instance of TypeInfo from an object instance at runtime. TypeInfo info = typeid(obj) // does not work, only compile time TypeInfo info = obj.classinfo.; // how to navigate to TypeInfo? Is that possible? If not, why? And can it be added (D1)? Ther

Re: Alignment of unions

2009-04-14 Thread Christopher Wright
Stewart Gordon wrote: Don wrote: Stewart Gordon wrote: That's only because you want to be able to attach alignments to individual members of a union. And I still don't know why. I'm not sure why you think unions are so different to structs. They are identical in most respects -- including

Re: The great inapplicable attribute debate

2009-04-14 Thread Christopher Wright
Frits van Bommel wrote: Stewart Gordon wrote: Don wrote: Stewart Gordon wrote: Surely, align isn't applicable to unions at all. IINM the members of a union, by design, start at the same offset. Not so, the alignment of each member should be respected. But the offset of a union member i

Re: Why does readln include the line terminator?

2009-04-14 Thread Christopher Wright
Georg Wrede wrote: Readln returns a string which contains the line terminator. Is there a grand reason for this? Currently there are a few drawbacks with this. The naive user doesn't expect it, and the seasoned user has to keep stripping it. And then he has to search the docs (or get hold of

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Christopher Wright
Leandro Lucarella wrote: dsimcha, el 11 de abril a las 05:21 me escribiste: == Quote from Leandro Lucarella (llu...@gmail.com)'s article Andrei Alexandrescu, el 10 de abril a las 16:49 me escribiste: And Braddr just made a documentation fix, and Walter only commits portability stuff and an occ

Re: The new, new phobos sneak preview

2009-04-12 Thread Christopher Wright
Bill Baxter wrote: On Sun, Apr 12, 2009 at 5:50 AM, Andrei Alexandrescu wrote: Lars Kyllingstad wrote: I think isInfinite!() should be called isInfiniteRange!(). The current name is, in my opinion, too general. I'm undecided about this (and similar cases). isInfinite sits inside std.range, so

Re: Std Phobos 2 and logging library?

2009-04-10 Thread Christopher Wright
BLS wrote: Zz wrote: Hi, Are there any plans for a logging library in Std Phobos 2.0? Zz Why ask. Phobos is a one man show. In other word, Phobos is an ego-lib. In case that you want something special, ask the tango folks. ( beside, logging is avail. there for quite a while) Björn It's a

Re: Multithreaded I/O in the DMD compiler (DDJ article by Walter)

2009-04-09 Thread Christopher Wright
Sean Kelly wrote: Adam D. Ruppe wrote: On Wed, Apr 08, 2009 at 08:33:11PM -0700, Walter Bright wrote: and apt-get replies with: "Couldn't find package virtualbox" Evidently, my system is completely hosed now. Aren't package managers swell? Waste of bloody time that would better be spent on

Re: Contract programming syntax

2009-04-08 Thread Christopher Wright
Jarrett Billingsley wrote: On Wed, Apr 8, 2009 at 6:38 PM, Christopher Wright wrote: Then take this example: void foo(int i) { if (i < 0) return; in { assert (i != -1; } } This is confusing. There's a simple solution: define the function body grammar to only allow in{}

Re: Contract programming syntax

2009-04-08 Thread Christopher Wright
Jarrett Billingsley wrote: On Wed, Apr 8, 2009 at 4:51 PM, Christopher Wright wrote: No. This proposed syntax change is quite misleading. Contracts cannot access the function's local variables, but it looks like they can. Contracts are executed at particular times, but that syntax makes

Re: Contract programming syntax

2009-04-08 Thread Christopher Wright
Denis Koroskin wrote: On Thu, 09 Apr 2009 00:51:49 +0400, Christopher Wright wrote: bearophile wrote: But isn't a syntax like the following better? To me it looks more logic, because in{} and out(){} are part of the function, and there's no need of a special syntax for the bod

Re: why Unix?

2009-04-08 Thread Christopher Wright
Jarrett Billingsley wrote: On Wed, Apr 8, 2009 at 11:09 AM, Christopher Wright wrote: In this regard, Unix has a standard interface: text. This turns out to be usable >90% of the time. It has the advantage that you can write a program in any language that can process text. But it

Re: Contract programming syntax

2009-04-08 Thread Christopher Wright
bearophile wrote: But isn't a syntax like the following better? To me it looks more logic, because in{} and out(){} are part of the function, and there's no need of a special syntax for the body (and the 'body' keyword): long squareRoot(long x) { in { assert(x >= 0); } out

Re: why Unix?

2009-04-08 Thread Christopher Wright
Daniel Keep wrote: Powershell is designed to work with managed (.NET) objects. It can dynamically introspect these objects and pull them apart, mutate them, convert them, etc. Imagine if every file on a UNIX system also carried around a reference to its own parser, and a description of how to i

Re: why Unix?

2009-04-08 Thread Christopher Wright
Yigal Chripun wrote: ever heard of powershell? it is in fact a superior design for a shell compared to most unix shells. also, have you ever heard of rush? http://rush.heroku.com/ I tried rush. Its documentation is lacking. The lack of a working directory is annoying. The lack of formatting

Re: why Unix?

2009-04-07 Thread Christopher Wright
Yigal Chripun wrote: ever heard of powershell? it is in fact a superior design for a shell compared to most unix shells. I have tried it briefly. Too briefly to give a good analysis of it. The GUI is better than that of cmd.exe, but not anywhere near as good as, say, GNOME Terminal. (It's sti

<    1   2   3   4   5   >