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?
One of the advantages of using this approach though is that it
I that directed at me? I'm not sure how it relates?
Yes, that's a question for you. Why would you take in spite of
everything still structs rather than classes?
On Saturday, 9 February 2013 at 10:05:21 UTC, Namespace wrote:
I that directed at me? I'm not sure how it relates?
Yes, that's a question for you. Why would you take in spite of
everything still structs rather than classes?
I'm not sure what in spite of is. No offense, but you seem to
be
I'm not sure what in spite of is. No offense, but you seem to
be the only person having problems with this.
Maybe I'm the only one who uses so many structs. That happens
when you have strong C++ background. I miss ''. :D
And the workarounds are plenty: My proposal, templatizing for
auto ref,
On Saturday, 9 February 2013 at 12:10:57 UTC, Namespace wrote:
In particular, you can't pack classes in a table, for example.
I don't understand.
I mean structs you can pack together in an array, eg:
S[10] s10; //10 structs S
You can't do that with classes. Sure, you can put 10 class
monarch_dodra:
I mean structs you can pack together in an array, eg:
S[10] s10; //10 structs S
You can't do that with classes. Sure, you can put 10 class
*references* in an array, but the *instances* themselves need
to be individually allocated.
This kind of works, with some limitations
(I'll ask to remove one limitation):
http://d.puremagic.com/issues/show_bug.cgi?id=9489
typeof(scoped!Foo(1))[10] foos; // Not initialized.
foreach (i, ref f; foos)
// f = new Foo(i * 10);
// f = scoped!Foo(i * 10);
f.x = i * 10;
What's the right/good way
some idea such as letter counting:
rename identifier
trimming sequence from quality value to cutoff
convert to a binary format
more idea later
On Saturday, 9 February 2013 at 00:54:58 UTC, Andrej Mitrovic
wrote:
Feel free to file an enhancement request.
http://d.puremagic.com/issues/show_bug.cgi?id=9491
Hopefully that is clear.
I have this small test program, it will crash when compiled on x64
windows, but it works fine on 32bit windows. What am I doing wrong?
import core.vararg;
import std.stdio;
void print(string fmt, ...)
{
auto arg = va_arg!(const(char)[])(_argptr);
writefln(fmt ~ arg);
}
void main(string[]
Am 09.02.2013 21:35, schrieb Ben Davis:
Hi,
I'm working on a multimedia driver DLL, i.e. one that Windows loads on
behalf of any program that uses the Windows multimedia API.
I'm using a .def file with an EXPORTS section, and I've also got all the
relevant functions marked as 'export' in the
On 2/9/13, Ben Davis ent...@cantab.net wrote:
Hi,
I'm working on a multimedia driver DLL, i.e. one that Windows loads on
behalf of any program that uses the Windows multimedia API.
I'm using a .def file with an EXPORTS section, and I've also got all the
relevant functions marked as 'export'
I wonder what the best, that means the fastest way is
to remove all whitespace \t\n\r from as string.
Whitespace are distributed erratically within the string.
Peter
On 2/9/13, Peter Sommerfeld nore...@rubrica.at wrote:
I wonder what the best, that means the fastest way is
to remove all whitespace \t\n\r from as string.
Whitespace are distributed erratically within the string.
Peter
Try f\too\t\n\rb\nar.removechars(\t\n\r)
Am 09.02.2013, 22:30 Uhr, schrieb Andrej Mitrovic
andrej.mitrov...@gmail.com:
f\too\t\n\rb\nar.removechars(\t\n\r)
thanks, works...
Peter
On Tuesday, 5 February 2013 at 20:10:37 UTC, bearophile wrote:
Jos van Uden:
I'll give it a shot if you like. The RCRPG I'd like to try
first.
I have already partially written those:
Partial translation of rcrpg-Python:
http://codepad.org/SflrKqbT
Partial translation of
It seems your template has problems with this:
struct A { }
class B {
public:
const int bar(ref A a) {
return 42;
}
mixin(rvalue!(bar));
}
remove the 'const' and it works fine.
On Saturday, 9 February 2013 at 22:23:07 UTC, Namespace wrote:
It seems your template has problems with this:
struct A { }
class B {
public:
const int bar(ref A a) {
return 42;
}
mixin(rvalue!(bar));
}
remove the 'const' and it works fine.
It
On 2013-02-09 23:32, Sparsh Mittal wrote:
I saw foreach and parallel commands on
http://dlang.org/phobos/std_parallelism.html
I have nested for-loops as follows:
for(int i=1; i N; i++)
{
for(int j=1; j M; j++)
{
func(i,j);
}
}
Here func(i,j) is such that there is no
This works so far:
auto funcAttr = functionAttributes!(fun);
if (FunctionAttribute.pure_ funcAttr) s ~= pure;
if (FunctionAttribute.nothrow_ funcAttr) s ~= nothrow;
if (FunctionAttribute.ref_ funcAttr) s ~= ref;
if (!isMutable!(typeof(fun))) s ~= const;
But it's curious that
On 9-2-2013 23:14, SomeDude wrote:
codepad.org doesn't work at all here. Maybe you should use dpaste (or pastebin
for other languages) instead ?
It's not working for me either. It's probably a temporary problem. It worked
fine before.
SomeDude:
...
Partial translation of rcrpg-Python:
http://codepad.org/SflrKqbT
Partial translation of
permutations_rank_of_a_permutation-Python:
http://codepad.org/El9SQwOE
Plus a better Perl implementation of the uniform() on BigInts:
http://codepad.org/LGcMpk2f
Partial translation of the
for(int i=1; i N; i++)==foreach(i; iota(1, N))
so you can use: foreach(i; parallel(iota(1, N))) { ... }
Thanks a lot. This one divides the x-cross-y region by rows.
Suppose dimension is 8*12 and 4 parallel threads are there, so
current method is dividing by 2*12 to each of 4 threads.
I'm using Windows and get gaps (blank lines) when using readText
and std.stdio.write.
import std.stdio;
import std.file;
void main() {
string s = readText(s.txt);
writeln('[', s, ']');
File(s.txt, w).write(s);
}
notepad.exe opens alright, (if you don't save as File(..,
I'm trying to write a script in D for building D projects.
They are dbuilder who do this . you can fork it
https://github.com/dbuilder-developers/dbuilder
On 09/02/2013 20:44, Andrej Mitrovic wrote:
On 2/9/13, Ben Davis ent...@cantab.net wrote:
Hi,
I'm working on a multimedia driver DLL, i.e. one that Windows loads on
behalf of any program that uses the Windows multimedia API.
I'm using a .def file with an EXPORTS section, and I've also got all
On 09/02/2013 20:39, Benjamin Thaut wrote:
Am 09.02.2013 21:35, schrieb Ben Davis:
Hi,
I'm working on a multimedia driver DLL, i.e. one that Windows loads on
behalf of any program that uses the Windows multimedia API.
I'm using a .def file with an EXPORTS section, and I've also got all the
This works better:
import std.stdio;
import std.file;
void main() {
//string s = readText(s.txt);
string s;
foreach(line; File(s.txt, r).byLine()) {
s ~= line~\r\n;
}
s = s[0..$-2];
writeln([s]);
File(s.txt,
This is an unexpected error; Seems it's the result of not
down-casting a variable-type. Is this a bug? Or just need a
better error message?
Version: DMD32 D Compiler v2.061
struct S {
void test(uint v) @property {}
void test2(ulong v) @property {}
}
ulong x;
S s;
s.test2
On Sunday, February 10, 2013 04:16:26 Era Scarecrow wrote:
This is an unexpected error; Seems it's the result of not
down-casting a variable-type. Is this a bug? Or just need a
better error message?
Version: DMD32 D Compiler v2.061
struct S {
void test(uint v) @property {}
On Sunday, 10 February 2013 at 03:24:37 UTC, Jonathan M Davis
wrote:
On Sunday, February 10, 2013 04:16:26 Era Scarecrow wrote:
This is an unexpected error; Seems it's the result of not
down-casting a variable-type. Is this a bug? Or just need a
better error message?
Version: DMD32 D
On Sunday, February 10, 2013 04:38:56 Era Scarecrow wrote:
Where should I add to the bug tracker so the error message can
be improved?
Just create a new bug report for it: http://d.puremagic.com/issues
- Jonathan M Davis
On Sunday, 10 February 2013 at 03:45:37 UTC, Jonathan M Davis
wrote:
On Sunday, February 10, 2013 04:38:56 Era Scarecrow wrote:
Where should I add to the bug tracker so the error message can
be improved?
Just create a new bug report for it:
http://d.puremagic.com/issues
- Jonathan M Davis
Hi, I'm new to the D programming language. Overall I'm liking
things very much, but I'm still getting the hang of a few things.
Here's a basic programming pattern: I have a class called Thing,
and while I'm coding I decide I need N Thing instances.
In C++ that's a matter of
std::vectorThing
On Sunday, 10 February 2013 at 06:14:37 UTC, Simon wrote:
Hi, I'm new to the D programming language. Overall I'm liking
things very much, but I'm still getting the hang of a few
things.
Here's a basic programming pattern: I have a class called Thing,
and while I'm coding I decide I need N
On 02/09/2013 10:14 PM, Simon wrote:
Hi, I'm new to the D programming language. Overall I'm liking
things very much, but I'm still getting the hang of a few things.
Here's a basic programming pattern: I have a class called Thing,
and while I'm coding I decide I need N Thing instances.
In
On 02/09/2013 10:52 PM, Ali Çehreli wrote:
auto things = iota(10).map!(i = new Thing(i))().array;
Actually, without the extra parentheses:
auto things = iota(10).map!(i = new Thing(i)).array;
Ali
On Sunday, 10 February 2013 at 06:57:42 UTC, Ali Çehreli wrote:
On 02/09/2013 10:52 PM, Ali Çehreli wrote:
auto things = iota(10).map!(i = new Thing(i))().array;
Actually, without the extra parentheses:
auto things = iota(10).map!(i = new Thing(i)).array;
Ali
It's a shame there
38 matches
Mail list logo