On 01/05/2011 02:12 PM, Lars T. Kyllingstad wrote:
On Wed, 05 Jan 2011 13:40:05 +0200, Max Samukha wrote:
On 01/05/2011 12:24 PM, Lars T. Kyllingstad wrote:
On Wed, 05 Jan 2011 12:07:50 +0200, Max Samukha wrote:
On 01/05/2011 11:21 AM, Lars T. Kyllingstad wrote:
On Tue, 04 Jan 2011 17:06:45
On Wed, 05 Jan 2011 13:40:05 +0200, Max Samukha wrote:
> On 01/05/2011 12:24 PM, Lars T. Kyllingstad wrote:
>> On Wed, 05 Jan 2011 12:07:50 +0200, Max Samukha wrote:
>>
>>> On 01/05/2011 11:21 AM, Lars T. Kyllingstad wrote:
On Tue, 04 Jan 2011 17:06:45 -0600, Andrei Alexandrescu wrote:
>
On 01/05/2011 12:24 PM, Lars T. Kyllingstad wrote:
On Wed, 05 Jan 2011 12:07:50 +0200, Max Samukha wrote:
On 01/05/2011 11:21 AM, Lars T. Kyllingstad wrote:
On Tue, 04 Jan 2011 17:06:45 -0600, Andrei Alexandrescu wrote:
On 1/4/11 4:49 PM, %u wrote:
There's still the risk of keeping multiple
On Wed, 05 Jan 2011 12:07:50 +0200, Max Samukha wrote:
> On 01/05/2011 11:21 AM, Lars T. Kyllingstad wrote:
>> On Tue, 04 Jan 2011 17:06:45 -0600, Andrei Alexandrescu wrote:
>>
>>> On 1/4/11 4:49 PM, %u wrote:
> There's still the risk of keeping multiple hashes. Consider:
> ulong fun(
On 01/05/2011 11:21 AM, Lars T. Kyllingstad wrote:
On Tue, 04 Jan 2011 17:06:45 -0600, Andrei Alexandrescu wrote:
On 1/4/11 4:49 PM, %u wrote:
There's still the risk of keeping multiple hashes. Consider:
ulong fun(ulong n) { ... }
alias memoize!fun mfun;
mfun(5); // creates hash ulong[in
On Tue, 04 Jan 2011 17:06:45 -0600, Andrei Alexandrescu wrote:
> On 1/4/11 4:49 PM, %u wrote:
>>> There's still the risk of keeping multiple hashes. Consider:
>>
>>> ulong fun(ulong n) { ... }
>>> alias memoize!fun mfun;
>>
>>> mfun(5); // creates hash ulong[int]
>>> mfun(5u); // creates hash ulon
It seems to me that this is an unsolvable problem without built-in compiler
support using __traits(getOverloads, Func), since without knowing all the
overloads of a function, you can't possibly write a template to widen the
arguments to the correct parameter types. (The current getOverloads needs a
On 1/4/11 4:49 PM, %u wrote:
There's still the risk of keeping multiple hashes. Consider:
ulong fun(ulong n) { ... }
alias memoize!fun mfun;
mfun(5); // creates hash ulong[int]
mfun(5u); // creates hash ulong[uint]
mfun('5'); // creates hash ulong[char]
Ohhh I see... so you're basically
On Tue, 04 Jan 2011 22:49:11 +, %u wrote:
> (An unrelated side note: I'm new to newsgroups, and I was wondering,
> what program do people mainly use for communication? I'm using the web
> interface, but do most people use Thunderbird or something? Thank you!)
Also outlook express, omea reader
On Tuesday, January 04, 2011 14:49:11 %u wrote:
> > There's still the risk of keeping multiple hashes. Consider:
> >
> > ulong fun(ulong n) { ... }
> > alias memoize!fun mfun;
> >
> > mfun(5); // creates hash ulong[int]
> > mfun(5u); // creates hash ulong[uint]
> > mfun('5'); // creates hash ulon
> There's still the risk of keeping multiple hashes. Consider:
> ulong fun(ulong n) { ... }
> alias memoize!fun mfun;
> mfun(5); // creates hash ulong[int]
> mfun(5u); // creates hash ulong[uint]
> mfun('5'); // creates hash ulong[char]
Ohhh I see... so you're basically looking for a compile-ti
On 1/4/11 2:57 PM, %u wrote:
Hi all,
How does this work, with respect to overloading?
auto memo(alias Fn, TParams...)(TParams args) if (isCallable!(Fn))
{
static typeof(Func(args))[Tuple!(TParams)] cache;
auto key = tuple(args);
return key in cache ? cache[key] : (cache[key] = Fu
Hi all,
How does this work, with respect to overloading?
auto memo(alias Fn, TParams...)(TParams args) if (isCallable!(Fn))
{
static typeof(Func(args))[Tuple!(TParams)] cache;
auto key = tuple(args);
return key in cache ? cache[key] : (cache[key] = Func(args));
}
uint fib(uint n)
{ r
13 matches
Mail list logo