On Sunday, 12 April 2015 at 04:04:43 UTC, lobo wrote:
On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote:
I don't understand why the following code compiles and runs
without an error:
import std.stdio;
mixin template ABC(){
int abc() { return 3; }
}
mixin ABC;
int abc() { retu
On Thursday, 12 April 2012 at 08:11:58 UTC, Andrea Fontana wrote:
On Wednesday, 11 April 2012 at 15:25:56 UTC, Stefan wrote:
On Wednesday, 11 April 2012 at 13:00:45 UTC, Andrea Fontana
wrote:
On Wednesday, 11 April 2012 at 12:46:30 UTC, Andrea Fontana
wrote:
How can I redirect stdout / stderr t
On Sunday, 12 April 2015 at 02:54:27 UTC, Rikki Cattermole wrote:
On 12/04/2015 7:24 a.m., Laeeth Isharc wrote:
Hi.
Two questions:
1. On startup I load various indexes from file storage into
memory in
the shared static this segment, and I would like to access
these from
threads serving web r
On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote:
I don't understand why the following code compiles and runs
without an error:
import std.stdio;
mixin template ABC(){
int abc() { return 3; }
}
mixin ABC;
int abc() { return 4; }
void main()
{
writefln("abc() = %s", abc())
I don't understand why the following code compiles and runs
without an error:
import std.stdio;
mixin template ABC(){
int abc() { return 3; }
}
mixin ABC;
int abc() { return 4; }
void main()
{
writefln("abc() = %s", abc());
}
Doesn't the mixin ABC create a function with the same signatu
On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote:
Parsers unique duplicated strings via a name table:
string udup(string s, ref string[string] nameTable)
{
if(s in nameTable)return nameTable[s];
string s1=s.dup;
nameTable[s1]=s1;
return s1;
}
This way you avoid extra duplicates.
On 12/04/2015 7:24 a.m., Laeeth Isharc wrote:
Hi.
Two questions:
1. On startup I load various indexes from file storage into memory in
the shared static this segment, and I would like to access these from
threads serving web requests. The data can be considered immutable once
loaded.
What is
On 12/04/2015 2:22 a.m., John S wrote:
On Saturday, 11 April 2015 at 03:27:32 UTC, Rikki Cattermole wrote:
I'm currently writing a web server[0].
I do have a web service framework waiting for it. It is based upon my
previous one (Cmsed).
If you want to help with the web server, please let me kn
On Saturday, 11 April 2015 at 22:45:39 UTC, Dennis Ritchie wrote:
I also want to know whether it is possible to D somehow set the
maximum width of the print string in characters?
I got to do this:
-
import std.stdio, std.range, std.conv, std.array;
void formatWidthIotaToStr(ref string for
On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote:
Parsers unique duplicated strings via a name table:
string udup(string s, ref string[string] nameTable)
{
if(s in nameTable)return nameTable[s];
string s1=s.dup;
nameTable[s1]=s1;
return s1;
}
This way you avoid extra duplicates.
Need to have some way of manipulating email in D though.
I agree. This would especially be cool, if you can do it from a
small device like a microcontroller!
Yes - nice to know it can do that also. For me I need to have a
way of managing large amounts of email (I have about 2mm
messages)
I also want to know whether it is possible to D somehow set the
maximum width of the print string in characters?
-
void main() {
import std.stdio, std.range;
writefln(";; %(%s, %)).", iota(10, 1101));
}
-
For example, here's the code to Common Lisp which is given by the
Parsers unique duplicated strings via a name table:
string udup(string s, ref string[string] nameTable)
{
if(s in nameTable)return nameTable[s];
string s1=s.dup;
nameTable[s1]=s1;
return s1;
}
This way you avoid extra duplicates. You can also try to free
file content manually when it's p
On Saturday, 11 April 2015 at 20:37:17 UTC, anonymous wrote:
On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie
wrote:
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],
a[30 .. 45],
a[45 .. 60],
On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie wrote:
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],
a[30 .. 45],
a[45 .. 60],
a[60 .. 75],
a[75 .. 90],
On Saturday, 11 April 2015 at 19:08:50 UTC, Marco Leise wrote:
Am Sat, 11 Apr 2015 18:28:35 +
schrieb "Paul D Anderson" :
Is there a way to return the name of a function (a string)
from a pointer to that function?
Function pointer example from D Reference:
---
int function() fp;
void tes
Hi,
Is it possible to write somehow shorter using formatted output
and other library functions?
-
import std.stdio, std.range;
void main() {
auto a = iota(100, 201);
writefln("%(;; %(%s, %),\n%).", [
a[0 .. 15],
a[15 .. 30],
Hi.
Two questions:
1. On startup I load various indexes from file storage into
memory in the shared static this segment, and I would like to
access these from threads serving web requests. The data can be
considered immutable once loaded.
What is the best way to make this data accessible?
Paul D Anderson:
Is there a way to return the name of a function (a string) from
a pointer to that function?
Perhaps creating a string[void*] AA and initializing with all the
function pointers you care about.
Bye,
bearophile
Am Sat, 11 Apr 2015 18:28:35 +
schrieb "Paul D Anderson" :
> Is there a way to return the name of a function (a string) from a
> pointer to that function?
>
> Function pointer example from D Reference:
> ---
> int function() fp;
>
> void test()
> {
> static int a = 7;
> static int
Is there a way to return the name of a function (a string) from a
pointer to that function?
Function pointer example from D Reference:
---
int function() fp;
void test()
{
static int a = 7;
static int foo() { return a + 3; }
fp = &foo;
}
void bar()
{
test();
int i = fp();
On Friday, 10 April 2015 at 13:47:52 UTC, Kagamin wrote:
On Tuesday, 7 April 2015 at 15:28:21 UTC, jicman wrote:
H... Will you be able to give me an example of what is bad
and then fix that bad to a good? This may be my problem...
maybe
aTUs = AddToTrackerRepeat(aTUs, source.dup, fn, 1, t
On Saturday, 11 April 2015 at 03:27:32 UTC, Rikki Cattermole
wrote:
I'm currently writing a web server[0].
I do have a web service framework waiting for it. It is based
upon my previous one (Cmsed).
If you want to help with the web server, please let me know.
The configuration system still is
On Saturday, 11 April 2015 at 14:01:07 UTC, John Colvin wrote:
What OS are you on?
Ubuntu 14.10.
On Saturday, 11 April 2015 at 12:04:06 UTC, matovitch wrote:
On Saturday, 11 April 2015 at 11:24:32 UTC, John Colvin wrote:
On Saturday, 11 April 2015 at 11:03:28 UTC, matovitch wrote:
On Saturday, 11 April 2015 at 10:53:46 UTC, Jakob Ovrum wrote:
On Saturday, 11 April 2015 at 10:50:17 UTC, ma
On 04/10/15 17:36, John Colvin via Digitalmars-d-learn wrote:
> On Friday, 10 April 2015 at 15:13:54 UTC, Marc Schütz wrote:
>> Is there a way to turn an array (known at compile time) into a TypeTuple?
> For input ranges in general:
>
> import std.range : isInputRange;
>
> template TypeTupleOf(
On Saturday, 11 April 2015 at 12:04:06 UTC, matovitch wrote:
well ldc doesn't compile :
kmeans.d(40): Error: no property 'enumerate' for type 'Range'
With -O -release -inline I get around 2s with foreach and 0.5s
with a simple for.
LDC does not yet support the 2.067 front-end version in whi
On Saturday, 11 April 2015 at 11:24:32 UTC, John Colvin wrote:
On Saturday, 11 April 2015 at 11:03:28 UTC, matovitch wrote:
On Saturday, 11 April 2015 at 10:53:46 UTC, Jakob Ovrum wrote:
On Saturday, 11 April 2015 at 10:50:17 UTC, matovitch wrote:
Hello,
The question is in the title. It shoul
On Saturday, 11 April 2015 at 11:03:28 UTC, matovitch wrote:
On Saturday, 11 April 2015 at 10:53:46 UTC, Jakob Ovrum wrote:
On Saturday, 11 April 2015 at 10:50:17 UTC, matovitch wrote:
Hello,
The question is in the title. It should be possible for a
finite random access ranges to perform an i
On Saturday, 11 April 2015 at 10:53:46 UTC, Jakob Ovrum wrote:
On Saturday, 11 April 2015 at 10:50:17 UTC, matovitch wrote:
Hello,
The question is in the title. It should be possible for a
finite random access ranges to perform an indexed foreach no ?
I mean like :
foreach(size_t i = 0, aut
Hello,
The question is in the title. It should be possible for a finite
random access ranges to perform an indexed foreach no ? I mean
like :
foreach(size_t i = 0, auto ref x; R)
{
/*...*/
}
Why are other foreach statements overloadable but this one ?
Thanks in advance.
On Saturday, 11 April 2015 at 10:50:17 UTC, matovitch wrote:
Hello,
The question is in the title. It should be possible for a
finite random access ranges to perform an indexed foreach no ?
I mean like :
foreach(size_t i = 0, auto ref x; R)
{
/*...*/
}
Why are other foreach statements ov
In fact I am now thinking it's great...I tried with string
instead of float and got a clear error message. I should have
read the spec more thoroughly.
Ok this explain it :
http://dlang.org/function.html#auto-functions. It should return a
float.
On Saturday, 11 April 2015 at 09:23:11 UTC, Dicebot wrote:
On Saturday, 11 April 2015 at 09:05:19 UTC, Nordlöw wrote:
On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote:
Why not use isStaticArray instead of isInputRange here?
Because that would be completely different. Static array
(you can remove the ref stuff)
Hi,
I just learn about auto ref functions and tried this :
import std.stdio;
auto ref foo(int i, ref float f)
{
if (i < f)
{
return i;
}
else
{
return f;
}
}
void main()
{
int i = 1;
float f1 = 1.
On Saturday, 11 April 2015 at 09:05:19 UTC, Nordlöw wrote:
On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote:
Why not use isStaticArray instead of isInputRange here?
Because that would be completely different. Static arrays
aren't even input ranges...
Ahh, my mistake.
Could som
On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote:
Why not use isStaticArray instead of isInputRange here?
Because that would be completely different. Static arrays
aren't even input ranges...
Ahh, my mistake.
Could somebody explain when this feature is needed?
On Friday, 10 April 2015 at 22:55:23 UTC, Nordlöw wrote:
On Friday, 10 April 2015 at 15:36:42 UTC, John Colvin wrote:
if (TL.length == 1 && isInputRange!(typeof(TL[0])))
Why not use isStaticArray instead of isInputRange here?
Because that would be completely different. Static arrays aren'
40 matches
Mail list logo