Re: Appender and CTFE

2011-03-04 Thread Kevin Bealer
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > I see nothing wrong with the occasional forking conditioned by __ctfe. > Even today, code may fork an optimized but nonportable implementation of > some algorithm. The main requirement is that such forks are rare enough >

Re: Is @property implementable?

2011-03-04 Thread Kevin Bealer
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > But that's not how the function is written. The left parameter is the > destination. If myString.strcpy(myString2) is confusing, I would expect > strcpy(myString, myString2) to be just as confusing. I don't see how using the > member

Re: std.parallelism: Call for benchmarks

2011-02-26 Thread Kevin Bealer
I would say look for small things people do which are CPU intensive. One example is sorting -- it can be parallelized fairly well and yet sorting 10_000_000 elements still takes long enough to be worth parallelizing. If you want examples of working parallel sort etc you can look in the 'Futurism

uniqueness propagation

2011-02-24 Thread Kevin Bealer
I think immutable could benefit from a Value Range Propagation-like uniqueness logic: string a; char[] b; string c = a ~ b; // result of ~ is always unique string z = c.dup; // also any kind of .dup is definitely unique char[] q = z.dup; // also okay -- assign to a non-immutable The lines w/ dup

Re: Uh... destructors?

2011-02-23 Thread Kevin Bealer
== Quote from Kevin Bealer (kevindangerbea...@removedanger.gmail.com)'s article > == Quote from bearophile (bearophileh...@lycos.com)'s article > ... > > Currently you are able to write functions like: > > pure bool randomPure() { > > int[] a1 = new in

Re: Uh... destructors?

2011-02-23 Thread Kevin Bealer
== Quote from bearophile (bearophileh...@lycos.com)'s article ... > Currently you are able to write functions like: > pure bool randomPure() { > int[] a1 = new int[1]; > int[] a2 = new int[2]; > return a1.ptr > a2.ptr; > } Is it possible to fix this by disallowing using the value of a

Re: Uh... destructors?

2011-02-23 Thread Kevin Bealer
== Quote from Stewart Gordon (smjg_1...@yahoo.com)'s article > On 23/02/2011 18:07, Ary Manzana wrote: > > On 2/22/11 10:36 AM, Simen Kjaeraas wrote: > >> %u Wrote: > >>> Well, the trouble is, pretty much all of these are invalid attributes: > >> > >>> - static obviously makes no sense > >> > >> An

Re: float equality

2011-02-23 Thread Kevin Bealer
== Quote from Sean Kelly (s...@invisibleduck.org)'s article > Andrei Alexandrescu wrote: > > On 2/21/11 6:08 PM, bearophile wrote: > >> Andrei Alexandrescu: > >> > >>> This is a long-standing myth. I worked on Wall Street and have friends > >>> who have been doing it for years. Everybody uses doub

Re: float equality

2011-02-21 Thread Kevin Bealer
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > Kevin Bealer wrote: > A reasonable way to do financial work is to use longs to represent pennies. > After all, you don't have fractional cents in your accounts. > Using floating point to represent mone

Re: float equality

2011-02-20 Thread Kevin Bealer
== Quote from Walter Bright (newshou...@digitalmars.com)'s article ... > I do understand that if you have a full symbolic representation, you can do so > with zero losses. But Kevin's proposal was not that, it was for a ratio > representation. > > All it represents symbolically is division. There a

Re: float equality

2011-02-20 Thread Kevin Bealer
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > Kevin Bealer wrote: > > You could switch to this: > > > > struct { > > BigInt numerator; > > BigInt denominator; > > }; > > > > Bingo -- no compromise. > It cann

Re: float equality

2011-02-20 Thread Kevin Bealer
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article ... > It may be that you would still end up with situations where two values that > you > would think would be the same aren't due to rounding error or whatnot. > However, > with a fixed point value, you wouldn't have the problem wher

Re: Integer conversions too pedantic in 64-bit

2011-02-17 Thread Kevin Bealer
== Quote from Daniel Gibson (metalcae...@gmail.com)'s article > It was not proposed to alter ulong (int64), but to only a size_t equivalent. > ;) > And I agree that not having unsigned types (like in Java) just sucks. > Wasn't Java even advertised as a programming language for network stuff? Quite

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Kevin Bealer
== Quote from spir (denis.s...@gmail.com)'s article > On 02/16/2011 03:07 AM, Jonathan M Davis wrote: > > On Tuesday, February 15, 2011 15:13:33 spir wrote: > >> On 02/15/2011 11:24 PM, Jonathan M Davis wrote: > >>> Is there some low level reason why size_t should be signed or something > >>> I'm c

Re: tooling quality and some random rant

2011-02-13 Thread Kevin Bealer
Sorry this was a completely unintentional error --- I meant to say "in case anyone doubts Gary's post". Blame the lateness of the night and/or my annoyingly lossy wireless keyboard. Kevin

Re: tooling quality and some random rant

2011-02-13 Thread Kevin Bealer
> our famous Reddit trolls, that is retard = uriel = eternium = lurker In case anyone doubts gay's guess... for those who don't follow entertainment trivia, Alan Smithee is a pseudonym used by directors disowning a film (google it). So anyone using this name is actually effectively *claiming* to

Re: is there any way to get a list of classes that inherit a class?

2011-02-13 Thread Kevin Bealer
I don't know if you can find all of them easily but you can find the instantiated ones by adding a line to the Foo constructor as shown here. Two limits: 1. This doesn't report Bar itself since a Bar object is never created; however in a sense a 'Bar' object was created when Baz and Qux are cre

Re: What's C's biggest mistake?

2010-01-02 Thread Kevin Bealer
bearophile Wrote: > Walter Bright: > > 3. The glaring fact that std::vector and std::string are different > > suggests something is still wrong. > > In an array/vector you want O(1) access time to all items (ignoring RAM-cache > access/transfer delays), while in a string with variable-width Uni

Re: What's C's biggest mistake?

2009-12-31 Thread Kevin Bealer
BCS Wrote: > Hello Walter, > > > BCS wrote: > > > >> I guess my point is that aside from VERY resource limited systems, > >> almost no one will have C as their first choice. Even with those > >> limited systems I'd bet that most people would rather be working in > >> something else if they could

Re: algorithms that take ranges by reference

2009-12-30 Thread Kevin Bealer
Andrei Alexandrescu Wrote: > The grand STL tradition is to _always_ take iterators by value. If > iterators are computed, they are returned by the algorithm. > > My initial approach to defining std.algorithm was to continue that > tradition for ranges: ranges are values. No algorithm currently

Re: Concurrency architecture for D2

2009-12-30 Thread Kevin Bealer
Andrei Alexandrescu Wrote: > I think we are now in the position of defining a solid set of > concurrency primitives for D. This follows many months of mulling over > models and options. > > It would be great to open the participation to the design as broadly as > possible, but I think it's rea

Re: Go rant

2009-12-30 Thread Kevin Bealer
Rainer Deyke Wrote: > Kevin Bealer wrote: > > I think a lot of people would do even better than insertion with a > > deck of poker cards -- they might group cards by either suit or rank > > (or rank groups) (e.g. "Hmm, I'll make three piles of 1-5, 6-10, and >

Re: Go rant

2009-12-30 Thread Kevin Bealer
dsimcha Wrote: > == Quote from Kevin Bealer (kevinbea...@gmail.com)'s article > > (Non-software) people doing routine tasks often come up with better > > algorithms > intuitively than my intuition expects them to. > > I think a lot of people would do even better

Re: Go rant

2009-12-30 Thread Kevin Bealer
Don Wrote: > retard wrote: ... > > I'd say it's easier. If you watch someone sorting some cards, they'll > use either insertion sort or selection sort. Nobody should have ever > heard of bubble sort, I'm pleased to hear some schools aren't mentioning > it. Such a foolish algorithm. > > "the bu

Re: Go rant

2009-12-21 Thread Kevin Bealer
Walter Bright Wrote: > dsimcha wrote: > > == Quote from Walter Bright (newshou...@digitalmars.com)'s article > >> qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs) > >> prominently featured in Haskell's official introduction page: > >> http://www.haskell.org/haskellwiki/Int

Re: What's wrong with D's templates?

2009-12-21 Thread Kevin Bealer
yigal chripun Wrote: > of the three above I think option 3 is the worst design and option 2 is my > favorite design. I think that in reality you'll almost always want to define > such an interface and I really can't think of any useful use cases for an > unrestricted template parameter as in C+

Re: What's wrong with D's templates?

2009-12-21 Thread Kevin Bealer
dsimcha Wrote: > == Quote from Yigal Chripun (yigal...@gmail.com)'s article > > but even more frustrating is the fact that > > template compilation bugs will also happen at the client. > > There's a whole range of designs for this and related issues and IMO the > > C++ design is by far the worst o

Re: D growing pains (was Re: The Demise of Dynamic Arrays?!)

2009-12-17 Thread Kevin Bealer
Walter Bright Wrote: > Kevin Bealer wrote: > > To smooth this out, it would help to have the best practices for > > doing common things in D (e.g. serialization, logging) somewhat > > documented for the consumption of non-experts. I wonder what a good > > way of doin

D growing pains (was Re: The Demise of Dynamic Arrays?!)

2009-12-15 Thread Kevin Bealer
retard Wrote: > Tue, 15 Dec 2009 09:42:26 -0500, Steven Schveighoffer wrote: > > Most likely Walter won't even tell what kind of arrays D2 will have. > Anything can happen. The final word is the undocumented executable you > can download when the book hits stores. Even then dmd's behavior isn't

private (aka no-inherit) implementations for public methods

2009-12-03 Thread Kevin Bealer
I think I have a solution to some problems that occur in OO design. The problems occurs when a method can be implemented that provides a great functionality for a specific class, but which it is not valid for its subclasses without extra work. The classic examples in C++ would be serialize. v