On 2/7/13, Dan wrote:
> I believe this would have to be done at the level of
> AssociativeArray and can not be done as a helper function, since
> this set helper is still doing 3 hashes/lookups.
Feel free to file an enhancement request.
On Friday, 8 February 2013 at 23:45:09 UTC, Namespace wrote:
Thank you.
But it looks ugly, and I dislike the use of such constructs for
such simple feature.
But cool thing. :D I like the meta stuff of D. :)
Other favorites?
Currently I think that Solutions #2 or Solution #5 are the best
sol
On 2/7/13 5:20 PM, Dan wrote:
For an associative array, what is the best idiom that allows for
checking if a key exists in the AA. If it does do something with the
value, if not initialize the value and then do something with it.
In this code: http://dpaste.dzfl.pl/daab318f
How would this piece
BTW: What's stopping you from using a class instead of a struct?
Thank you.
But it looks ugly, and I dislike the use of such constructs for
such simple feature.
But cool thing. :D I like the meta stuff of D. :)
Other favorites?
On Friday, 8 February 2013 at 21:06:27 UTC, Namespace wrote:
I've been thinking about the lack of rvalue references.
Therefore, I would like to know what you think is the best
workaround for this feature.
I illustrate below the only (*) five solutions briefly and
summarized.
What do you think i
rumbu:
If you want D to become popular, that's not an appropiate
answer in the d.learn section. I'm sure that if someone will
ask the same thing in the C# section of MSDN will obtain an
answer, not a redirect to an external forum.
I agree that it's important to be gentle.
(I remember the C
On Friday, 8 February 2013 at 15:08:06 UTC, Dicebot wrote:
On Friday, 8 February 2013 at 15:06:24 UTC, SaltySugar wrote:
How to run my program when computer starts?
This question is irrelevant to D and is operating system
specific. It is better suited for stackoverflow & Co.
If you want D t
> Does your IO layer require one call per log line or can you do multiple
> writes followed by an "end log line" terminator?
> Assuming the former, the most obvious approach would be for the writer to
> have a static array equal to the max log line size,
> accumulate until done and then issue on
On Friday, 8 February 2013 at 20:30:00 UTC, Maxim Fomin wrote:
On Friday, 8 February 2013 at 20:10:32 UTC, Nrgyzer wrote:
void main() {
int[string] b;
b["hello"] = 3;
}
This works for both versions... but I don't know why using a
method with ref-return value doesn't work anymore.
Thanks
Am 08.02.2013 22:53, schrieb Lee Braiden:
> On Fri, 08 Feb 2013 16:57:39 +0100, David wrote:
>> I am currently implementing a logging module, I want to make logging to
>> stderr/stdout/"any file" possible, also during runtime-shutdown (logging
>> from dtors)
>>
>> Atm it lookes like this:
>>
>> ---
On Fri, 08 Feb 2013 16:57:39 +0100, David wrote:
> I am currently implementing a logging module, I want to make logging to
> stderr/stdout/"any file" possible, also during runtime-shutdown (logging
> from dtors)
>
> Atm it lookes like this:
>
>
> void log(LogLevel level, Args...)(Args args)
I've been thinking about the lack of rvalue references.
Therefore, I would like to know what you think is the best
workaround for this feature.
I illustrate below the only (*) five solutions briefly and
summarized.
What do you think is the best? Which of these do you use? Or did
I forget some p
On Feb 8, 2013, at 7:57 AM, David wrote:
> I am currently implementing a logging module, I want to make logging to
> stderr/stdout/"any file" possible, also during runtime-shutdown (logging
> from dtors)
>
> Atm it lookes like this:
>
>
> void log(LogLevel level, Args...)(Args args) {
>
On Friday, 8 February 2013 at 20:10:32 UTC, Nrgyzer wrote:
void main() {
int[string] b;
b["hello"] = 3;
}
This works for both versions... but I don't know why using a
method with ref-return value doesn't work anymore.
Thanks for your suggestion.
This works because an element is assign
On Friday, 8 February 2013 at 20:12:41 UTC, Dan wrote:
This constant in a module causes a compilation error of the
"non-constant expression" variety.
DEFINITION 1
const(AssetProjectionMap) SavingsGrowth2013 = [
AssetReturnType.Interest :
RateCurve([DateRate(Date.min, CcRate(0.007))]),
This constant in a module causes a compilation error of the
"non-constant expression" variety.
DEFINITION 1
const(AssetProjectionMap) SavingsGrowth2013 = [
AssetReturnType.Interest :
RateCurve([DateRate(Date.min, CcRate(0.007))]),
];
The fix that addresses this error at module level
On Friday, 8 February 2013 at 19:24:55 UTC, simendsjo wrote:
On Friday, 8 February 2013 at 17:16:15 UTC, Nrgyzer wrote:
Hi guys,
I'm updated from DMD 2.060 to 2.061 and I just run into some
trouble by using associative arrays. Let's say I've the
following few lines:
string[string] myValues;
On Friday, 8 February 2013 at 17:16:15 UTC, Nrgyzer wrote:
Hi guys,
I'm updated from DMD 2.060 to 2.061 and I just run into some
trouble by using associative arrays. Let's say I've the
following few lines:
string[string] myValues;
ref string getValue(string v) {
return myValues[v];
}
vo
Ok, can't find in bugzilla anything similar, have filed new one:
http://d.puremagic.com/issues/show_bug.cgi?id=9486
On Fri, 08 Feb 2013 04:17:02 -0500, Peter Sommerfeld
wrote:
Steven Schveighoffer schrieb:
Windows is actually EXACTLY the same, except you don't use getenv and
putenv, you use SetEnvironmentVariable and GetEnvironmentVariable. You
can use the former if you want to use the C compatibility
Hi guys,
I'm updated from DMD 2.060 to 2.061 and I just run into some
trouble by using associative arrays. Let's say I've the following
few lines:
string[string] myValues;
ref string getValue(string v) {
return myValues[v];
}
void main() {
getValue("myValue") = "myString";
}
I get a
On Friday, 8 February 2013 at 16:11:48 UTC, Dicebot wrote:
On Friday, 8 February 2013 at 15:39:05 UTC, monarch_dodra wrote:
Wait, this is giving me a compile error. You are getting a
link error. What's going on?
What compile error do you get? After removing exclamation mark
from func declarat
On Friday, 8 February 2013 at 15:39:05 UTC, monarch_dodra wrote:
Wait, this is giving me a compile error. You are getting a link
error. What's going on?
What compile error do you get? After removing exclamation mark
from func declaration it works as described for me.
I am currently implementing a logging module, I want to make logging to
stderr/stdout/"any file" possible, also during runtime-shutdown (logging
from dtors)
Atm it lookes like this:
void log(LogLevel level, Args...)(Args args) {
string message = format(args);
... pass string to writ
On Friday, 8 February 2013 at 15:22:09 UTC, Dicebot wrote:
On Friday, 8 February 2013 at 15:20:53 UTC, bearophile wrote:
Dicebot:
void func!(alias arr)()
{
arr["key"] = 43;
}
I think you have to remove that exclamation mark.
Bye,
bearophile
Typo, irrelevant to subject.
Wait, this is g
On Friday, 8 February 2013 at 15:20:53 UTC, bearophile wrote:
Dicebot:
void func!(alias arr)()
{
arr["key"] = 43;
}
I think you have to remove that exclamation mark.
Bye,
bearophile
Typo, irrelevant to subject.
Dicebot:
void func!(alias arr)()
{
arr["key"] = 43;
}
I think you have to remove that exclamation mark.
Bye,
bearophile
On Friday, 8 February 2013 at 15:06:24 UTC, SaltySugar wrote:
How to run my program when computer starts?
This question is irrelevant to D and is operating system
specific. It is better suited for stackoverflow & Co.
== mod.d ==
void func!(alias arr)()
{
arr["key"] = 43;
}
== test.d ==
import mod;
void main()
{
auto arr = [ "key" : 42 ];
func!(arr)();
}
== shell ==
$ rdmd test.d
.../test.o: In function
`_D4test4mainFZv36__T4funcS24_D4test4mainFZv3arrHAyaiZ4funcMFZv':
test.d:(.text._D4test4mainF
On Friday, 8 February 2013 at 09:08:48 UTC, bioinfornatics wrote:
And use size_t instead to int for getChar/getInt method as type
returned
gdmd -w -O -release monarch.d
~ $ time ./monarch
/env/cns/proj/projet_AZH/A/RunsSolexa/121114_FLUOR_C16L5ACXX/AZH_AOSC_8_1_C16L5ACXX.IND1_clean.fastq
glob
On 02/08/2013 01:32 AM, Jonathan M Davis wrote:
> On Friday, February 08, 2013 09:30:41 Artur Skawina wrote:
>> On 02/08/13 01:33, Jonathan M Davis wrote:
>>> Hmmm. I wouldn't have thought that you could get the function
pointer at
>>> compiler time. Regardless, you lose any possibility of inlin
On Friday, 8 February 2013 at 09:33:19 UTC, Jonathan M Davis
wrote:
On Friday, February 08, 2013 09:30:41 Artur Skawina wrote:
On 02/08/13 01:33, Jonathan M Davis wrote:
> Hmmm. I wouldn't have thought that you could get the
> function pointer at
> compiler time. Regardless, you lose any possib
On 02/08/13 10:32, Jonathan M Davis wrote:
> On Friday, February 08, 2013 09:30:41 Artur Skawina wrote:
>> On 02/08/13 01:33, Jonathan M Davis wrote:
>>> Hmmm. I wouldn't have thought that you could get the function pointer at
>>> compiler time. Regardless, you lose any possibility of inlining the
On Friday, February 08, 2013 09:30:41 Artur Skawina wrote:
> On 02/08/13 01:33, Jonathan M Davis wrote:
> > Hmmm. I wouldn't have thought that you could get the function pointer at
> > compiler time. Regardless, you lose any possibility of inlining the
> > function call, which is the main problem A
Steven Schveighoffer schrieb:
Windows is actually EXACTLY the same, except you don't use getenv and
putenv, you use SetEnvironmentVariable and GetEnvironmentVariable. You
can use the former if you want to use the C compatibility layer, but
that's only if you use all compatibility layer func
On 2013-02-08 00:41, deed wrote:
Input regaridng DWT with phobos is welcome. See posting here:
http://forum.dlang.org/thread/otyfilaasbxrwnqvr...@forum.dlang.org
I've answered in the DWT newsgroup.
--
/Jacob Carlborg
On 02/08/13 01:33, Jonathan M Davis wrote:
> Hmmm. I wouldn't have thought that you could get the function pointer at
> compiler time. Regardless, you lose any possibility of inlining the function
> call, which is the main problem AFAIK, though I don't know if they would have
> been an option in
38 matches
Mail list logo