Re: [OT] Quality of software localization

2010-08-31 Thread Kagamin
Walter Bright Wrote: > Tomek Sowiñski wrote: > > Oh, and if the problem called for a turbo spreadsheet, I had to re-learn > > the function names all over because in VBA they're English. :-/ > Yes, localized Excel is a real pain. > My father spent years in Japan after the war, and of course Japa

Re: Bug 3999 and 4261

2010-08-31 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.28.1283307608.858.digitalmar...@puremagic.com... > >That is all that I thought enums are useful for. But apparently an >enum is a type and you can instantiate it and I don't even know >what an enum is anymore. I'll just stay out of this discussi

Re: Bug 3999 and 4261

2010-08-31 Thread Nick Sabalausky
"Daniel Gibson" wrote in message news:i5kbpr$24t...@digitalmars.com... > bearophile schrieb: >> Daniel Gibson: >> >>> Why not use the non-fictional const keyword? "The const attribute >>> declares constants that can be evaluated at compile time."[1] >> >> But you can use const for constants that

Re: Bug 3999 and 4261

2010-08-31 Thread Andrej Mitrovic
This whole enum thing is making my head explode out of confusion. I thought having a tag was just supossed to be used as a namespace for enumerated values. E.g.: enum { red = 1, green, blue } ... if (getValue() == green) { do.. } and: enum Tagged { red = 1, green, blue } ... if (getValue() =

Re: Bug 3999 and 4261

2010-08-31 Thread bearophile
Daniel Gibson: > Really? Than that definition from the language docs is inaccurate. This compiles, here n is known at run-time only: void main(string[] args) { const int n = args.length; } This compiles, but I think it's a bug: void main(string[] args) { enum int n = args.length; } T

Re: Bug 3999 and 4261

2010-08-31 Thread Daniel Gibson
bearophile schrieb: Daniel Gibson: Why not use the non-fictional const keyword? "The const attribute declares constants that can be evaluated at compile time."[1] But you can use const for constants that are known at run-time only. While you can't use enum for constant known at run-time.

Re: Bug 3999 and 4261

2010-08-31 Thread bearophile
Daniel Gibson: > Why not use the non-fictional const keyword? "The const attribute > declares constants that can be evaluated at compile time."[1] But you can use const for constants that are known at run-time only. While you can't use enum for constant known at run-time. > "enum int n = 10;"

Re: Bug 3999 and 4261

2010-08-31 Thread Daniel Gibson
bearophile wrote: ctconst is a fictional keyword that denotes compile-time constants. Now you are probably able to see that there is no correlation between the n and Color. Why not use the non-fictional const keyword? "The const attribute declares constants that can be evaluated at compile

Re: Bug 3999 and 4261

2010-08-31 Thread Nick Sabalausky
"Daniel Gibson" wrote in message news:mailman.26.1283301521.858.digitalmar...@puremagic.com... > > Then there still is the consistency-issue (anon. enums are treated > differently then named enums). > Anon. enums *are* fundamentally different from named enums. It's already inconsistent.

Re: Bug 3999 and 4261

2010-08-31 Thread bearophile
Daniel Gibson: > Then there still is the consistency-issue (anon. enums are treated > differently then named enums). Look at this:Se enum int n = 10; enum Color { Red, Green, Blue } Color color; if (color == Color.Red) { ... Color is a sequence of symbols, Red, Green and Blue, named Color. When

Re: Bug 3999 and 4261

2010-08-31 Thread Daniel Gibson
bearophile schrieb: Daniel Gibson: I sometimes find it convenient to just treat those values as integers, Yes, I am sure in some situations it can be handy. But it's a a bit of convenience that has a too much high price, the semantics is less clean, and it's more bug prone. So no thanks. Kee

Re: Bug 3999 and 4261

2010-08-31 Thread bearophile
Daniel Gibson: > I sometimes find it convenient to just treat those values as integers, Yes, I am sure in some situations it can be handy. But it's a a bit of convenience that has a too much high price, the semantics is less clean, and it's more bug prone. So no thanks. Keeping things tidy is mo

Overloading + on points

2010-08-31 Thread Eduardo Cavazos
(Discussion originally on digitalmars-d-learn. Moving to digitalmars-d list.) Eduardo Cavazos wrote: > Here's a short program which creates a type for points and overloads '+' > to do element wise addition as well as addition to floats, however it > produces an error: > > ---

Re: Bug 3999 and 4261

2010-08-31 Thread Nick Sabalausky
"Daniel Gibson" wrote in message news:mailman.24.1283298345.858.digitalmar...@puremagic.com... > --- > int x; > stream.read(x); // btw: this often sucks - why not x = stream.readInt()? Better yet: stream.read!int() > if(x == MyEnum.DIE) > return 0; > else if(x == MyEnum.CALLFOO) > foo(x); > ---

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Walter Bright
Andrei Alexandrescu wrote: Relevant reading: http://www.paulgraham.com/taste.html Art is indeed a relational value (has value only defined jointly by a creator and a recipient) but that doesn't make it wholly relative. Where I draw the line is when someone tries to impose their taste upon ot

Re: Bug 3999 and 4261

2010-08-31 Thread Daniel Gibson
bearophile schrieb: A way to tell them apart is the presence of the EnumTag, if it's present, then the enum is a new type: enum V1 = 10; enum { V2 = 20 } enum Foo { V3 } void main() { assert(V1 == 10);// OK assert(V2 == 20);// OK assert(Foo.V3 == 0); // ERROR, type mismatch

Re: Bug 3999 and 4261

2010-08-31 Thread bearophile
A way to tell them apart is the presence of the EnumTag, if it's present, then the enum is a new type: enum V1 = 10; enum { V2 = 20 } enum Foo { V3 } void main() { assert(V1 == 10);// OK assert(V2 == 20);// OK assert(Foo.V3 == 0); // ERROR, type mismatch } Bye, bearophile

Bug 3999 and 4261

2010-08-31 Thread bearophile
Probably each of the ~25 bugs of the short list I have shown here recently need a bit of discussion (also because some of them are little breaking changes over current DMD and/or TDPL). Even if some of them may need to wait in Bugzilla for two years, it's positive to discuss them already. But yo

Re: std.mixins

2010-08-31 Thread Nick Sabalausky
"dsimcha" wrote in message news:i5jtdn$1g4...@digitalmars.com... > > Isn't this a core language feature that's in the spec but is only > currently > implemented for arrays? I thought eventually uniform function call syntax > was > coming for classes and structs, too. I've been really wishing

Re: std.mixins

2010-08-31 Thread bearophile
Lutger: > wtf it works! That's a cool trick / workaround, thanks. See bug 4085 Bye, bearophile

Re: std.mixins

2010-08-31 Thread Jonathan M Davis
On Tuesday, August 31, 2010 14:49:43 dsimcha wrote: > Isn't this a core language feature that's in the spec but is only currently > implemented for arrays? I thought eventually uniform function call syntax > was coming for classes and structs, too. There are people who keep asking for it, but as

Re: std.mixins

2010-08-31 Thread Philippe Sigaud
On Wed, Sep 1, 2010 at 00:05, Lutger wrote: > wtf it works! That's a cool trick / workaround, thanks. > > That'd be cool if this worked too: foreach(i,_; test) // since test is iterable or even: foreach(i,_; typeof(test)) // int[3] -> consider it as (int,int,int) and iterate. Halas, no. Thou

Re: std.mixins

2010-08-31 Thread Philippe Sigaud
On Tue, Aug 31, 2010 at 23:49, dsimcha wrote: > > > Isn't this a core language feature that's in the spec but is only currently > implemented for arrays? I thought eventually uniform function call syntax > was > coming for classes and structs, too. > Yes I heard that too. But it will be at leas

Re: std.mixins

2010-08-31 Thread Lutger
Philippe Sigaud wrote: ... >> I want this to work or something like it, is it possible? >> >> enum test = [1,2, 3]; >> >> foreach(i; 0..test.length) { >>pragma(msg, to!string(test[i]) ); >> } >> > > Well, 0..someEnum is not recognized by the compiler. The workaround is to > create a typetuple

Re: std.mixins

2010-08-31 Thread dsimcha
== Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article > std.typecons is full of good stuff. I learnt quite a lot reading it. The Any > code gave many hours of reading, compiling the resulting code in my head, so > to say. Then I went a little mad ;) > My initial suggestion for your OP

Re: std.mixins

2010-08-31 Thread Philippe Sigaud
On Tue, Aug 31, 2010 at 22:41, Lutger wrote: > > Wait what, we have static foreach? I thought that didn't work out. > > foreach is automatically done at compile-time if you iterate in typetuples string toStrings(Args...)(Args args) //btw, I regularly need this { string result; foreach(i,Type

Re: std.mixins

2010-08-31 Thread Philippe Sigaud
On Tue, Aug 31, 2010 at 20:03, dsimcha wrote: > == Quote from Lutger (lutger.blijdest...@gmail.com)'s article > > Instead of std.mixins, perhaps it is better to fold the code with > std.typecons > > or create new modules as needed (std.pattern?). > > I initially thought std.mixins would be a good

Re: Where do I post website bugs?

2010-08-31 Thread Matthias Pleh
Am 30.08.2010 19:34, schrieb Andrei Alexandrescu: On 8/30/10 12:28 PDT, Adam B wrote: Thanks. I'll use the puremagic issue tracker. And by the way, if http://www.d-programming-language.org holds a proposed style change I'll vote for it! It feels much more modern and polished. That said, having t

Re: std.mixins

2010-08-31 Thread Lutger
Nick Sabalausky wrote: > "Lutger" wrote in message > news:i5jmlc$13l...@digitalmars.com... >> Nick Sabalausky wrote: >> >>> "Lutger" wrote in message >>> news:i5jiap$rv...@digitalmars.com... dsimcha wrote: >It can still be useful if you also change the loop body a > little, for exam

Re: std.mixins

2010-08-31 Thread bearophile
dsimcha: > I thought about this. Simple loop unrolling doesn't seem like a very useful > optimization on modern hardware because branch prediction and pipelining have > gotten so good. It can still be useful if you also change the loop body a > little, > for example using multiple accumulators t

Re: std.mixins

2010-08-31 Thread Nick Sabalausky
"Lutger" wrote in message news:i5jmlc$13l...@digitalmars.com... > Nick Sabalausky wrote: > >> "Lutger" wrote in message >> news:i5jiap$rv...@digitalmars.com... >>> dsimcha wrote: It can still be useful if you also change the loop body a little, for example using multiple accumulators to

Re: std.mixins

2010-08-31 Thread dsimcha
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article > Nick Sabalausky wrote: > > "Lutger" wrote in message > > news:i5jiap$rv...@digitalmars.com... > >> dsimcha wrote: > >> > >> ... > My suggestion is to include a mixin for unrolling loops. > >>> > >>> I thought about this. Simple

Re: std.mixins

2010-08-31 Thread Lutger
Nick Sabalausky wrote: > "Lutger" wrote in message > news:i5jiap$rv...@digitalmars.com... >> dsimcha wrote: >> >> ... My suggestion is to include a mixin for unrolling loops. >>> >>> I thought about this. Simple loop unrolling doesn't seem like a very >>> useful >>> optimization on modern h

Re: std.mixins

2010-08-31 Thread Jacob Carlborg
On 2010-08-31 18:11, Denis Koroskin wrote: On Tue, 31 Aug 2010 19:13:17 +0400, Jacob Carlborg wrote: On 2010-08-31 05:17, Andrei Alexandrescu wrote: On 8/30/10 20:04 PDT, dsimcha wrote: I've been toying for a long time with the idea of a std.mixins for Phobos that would contain meta-implemen

Re: std.mixins

2010-08-31 Thread Nick Sabalausky
"Lutger" wrote in message news:i5jiap$rv...@digitalmars.com... > dsimcha wrote: > > ... >>> My suggestion is to include a mixin for unrolling loops. >> >> I thought about this. Simple loop unrolling doesn't seem like a very >> useful >> optimization on modern hardware because branch prediction

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread BCS
Hello Torarin, 2010/8/31 BCS : Hello Torarin, So reviews are useless? Without context, yes they are useless. With context, your just looking at correlation: i.e "we like/dislike the same things". I can understand the premise of the view that art cannot be quality-assessed, but I think th

Re: std.mixins

2010-08-31 Thread BCS
Hello dsimcha, == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 8/30/10 20:04 PDT, dsimcha wrote: I've been toying for a long time with the idea of a std.mixins for Phobos that would contain meta-implementations of commonly needed boilerplate code for mixing int

Re: std.mixins

2010-08-31 Thread Lutger
dsimcha wrote: ... >> My suggestion is to include a mixin for unrolling loops. > > I thought about this. Simple loop unrolling doesn't seem like a very useful > optimization on modern hardware because branch prediction and pipelining have > gotten so good. It can still be useful if you also cha

Re: std.mixins

2010-08-31 Thread dsimcha
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article > Instead of std.mixins, perhaps it is better to fold the code with std.typecons > or create new modules as needed (std.pattern?). I initially thought std.mixins would be a good idea, since it would be a one-stop shop for all kinds of

Re: std.mixins

2010-08-31 Thread Lutger
dsimcha wrote: > I've been toying for a long time with the idea of a std.mixins for Phobos that > would contain meta-implementations of commonly needed boilerplate code for > mixing into classes and and structs. I've started to prototype it > (http://dsource.org/projects/scrapple/browser/trunk/st

Re: std.algorithm move() struct emptying

2010-08-31 Thread Andrei Alexandrescu
On 8/31/10 11:28 CDT, Philippe Sigaud wrote: On Tue, Aug 31, 2010 at 17:05, Andrei Alexandrescu mailto:seewebsiteforem...@erdani.org>> wrote: On 8/31/10 7:49 CDT, Michel Fortin wrote: On 2010-08-31 06:16:17 -0400, bearophile mailto:bearophileh...@lycos.com>> said:

Re: std.algorithm move() struct emptying

2010-08-31 Thread Philippe Sigaud
On Tue, Aug 31, 2010 at 17:05, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 8/31/10 7:49 CDT, Michel Fortin wrote: > >> On 2010-08-31 06:16:17 -0400, bearophile said: >> >> If in generic code T.init is not guaranteed to be an lvalue, as your >>> example shows, isn't it better

Re: std.mixins

2010-08-31 Thread Denis Koroskin
On Tue, 31 Aug 2010 19:13:17 +0400, Jacob Carlborg wrote: On 2010-08-31 05:17, Andrei Alexandrescu wrote: On 8/30/10 20:04 PDT, dsimcha wrote: I've been toying for a long time with the idea of a std.mixins for Phobos that would contain meta-implementations of commonly needed boilerplate code

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Andrei Alexandrescu
On 8/31/10 9:09 CDT, Torarin wrote: 2010/8/31 BCS: Hello Torarin, So reviews are useless? Without context, yes they are useless. With context, your just looking at correlation: i.e "we like/dislike the same things". I can understand the premise of the view that art cannot be quality-asses

Re: std.mixins

2010-08-31 Thread Jacob Carlborg
On 2010-08-31 05:49, dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 8/30/10 20:04 PDT, dsimcha wrote: I've been toying for a long time with the idea of a std.mixins for Phobos that would contain meta-implementations of commonly needed boilerplate c

Re: std.mixins

2010-08-31 Thread Jacob Carlborg
On 2010-08-31 05:17, Andrei Alexandrescu wrote: On 8/30/10 20:04 PDT, dsimcha wrote: I've been toying for a long time with the idea of a std.mixins for Phobos that would contain meta-implementations of commonly needed boilerplate code for mixing into classes and and structs. I've started to prot

Re: std.algorithm move() struct emptying

2010-08-31 Thread Andrei Alexandrescu
On 8/31/10 7:49 CDT, Michel Fortin wrote: On 2010-08-31 06:16:17 -0400, bearophile said: If in generic code T.init is not guaranteed to be an lvalue, as your example shows, isn't it better to disallow (turning it into a syntax error) &T.init in all cases? Personally, I'd say the code should

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Torarin
2010/8/31 BCS : > Hello Torarin, > >> So reviews are useless? >> > > Without context, yes they are useless. With context, your just looking at > correlation: i.e "we like/dislike the same things". I can understand the premise of the view that art cannot be quality-assessed, but I think there are s

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Don
Steven Schveighoffer wrote: On Mon, 30 Aug 2010 16:43:27 -0400, Kagamin wrote: Steven Schveighoffer Wrote: Shit, just look at the over-abundance of totally crappy open source software versus for-sale software. Who cares about crap if free software is still better than for-sale? For-sale

Re: Bug reports [Was: Re: About Andrei's interview, part 3]

2010-08-31 Thread Andrej Mitrovic
Wouldn't it be better if we had some kind of compile-time block statement instead of making separate compile-time keywords for every run-time keyword? For example, we could reuse static, and instead of code like this from std.range: private template MostDerivedInputRangeImpl(R) { private alia

Re: std.algorithm move() struct emptying

2010-08-31 Thread Stanislav Blinov
31.08.2010 16:49, Michel Fortin пишет: On 2010-08-31 06:16:17 -0400, bearophile said: If in generic code T.init is not guaranteed to be an lvalue, as your example shows, isn't it better to disallow (turning it into a syntax error) &T.init in all cases? Personally, I'd say the code should c

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread BCS
Hello Torarin, So reviews are useless? Without context, yes they are useless. With context, your just looking at correlation: i.e "we like/dislike the same things". 2010/8/31 BCS : Hello Kagamin, dsimcha Wrote: Of course everyone thinks ~60-70% of what Hollywood puts out is crap. Th

Re: std.algorithm move() struct emptying

2010-08-31 Thread Michel Fortin
On 2010-08-31 06:16:17 -0400, bearophile said: If in generic code T.init is not guaranteed to be an lvalue, as your example shows, isn't it better to disallow (turning it into a syntax error) &T.init in all cases? Personally, I'd say the code should check if T.init is an lvalue using __trai

Re: std.algorithm move() struct emptying

2010-08-31 Thread Stanislav Blinov
31.08.2010 0:27, Torarin wrote: Yeah, I get the enum case, but what I forgot to mention is that the example from move() is enclosed in static if (is(T == struct)) Which makes me wonder what kind of struct would have an rvalue .init. I don't know, maybe the one that's not invented yet ;)

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Steven Schveighoffer
On Mon, 30 Aug 2010 16:43:27 -0400, Kagamin wrote: Steven Schveighoffer Wrote: Shit, just look at the over-abundance of totally crappy open source software versus for-sale software. Who cares about crap if free software is still better than for-sale? For-sale software that sucks doesn't l

Re: [Slight OT] TDPL in Russia

2010-08-31 Thread Torarin
So reviews are useless? 2010/8/31 BCS : > Hello Kagamin, > >> dsimcha Wrote: >> >>> Of course everyone thinks ~60-70% of what Hollywood puts out is crap. >>> The problem is that everyone thinks that about a **different** >>> ~60-70% because different movies cater to different niches.  Having a >>>

Re: std.algorithm move() struct emptying

2010-08-31 Thread bearophile
Stanislav Blinov: > > Currently you can take its address, so doesn't that mean that it's an > > lvalue? > > No, you can't. Generally, that is. > For example: > enum A > { > a, > b > } > > void main() > { > void* p = &A.init; // won't compile > } > > You may be able to take ad

Re: inplace_merge, nWayUnion

2010-08-31 Thread bearophile
Andrei: Sorry for my late answer, yesterday I was very busy. >What I was saying is that in a past bug report you complained that find() is >too hard to understand.< An in a later post I have explained what in my opinion it can be done to improve the situation (this is not a fully good answer,

Re: D.challenge

2010-08-31 Thread bearophile
Justin Johansson: > "challenging D to do this or that" in the > context of, say, another programming language or some CS > problem. In past months I have proposed two little challenges, the second of them was to implement this RosettaCode task in D, to produce a program that is faster, shorter a