How do you install Allegro 5 (OSX)? Like, using 'Home Brew'.
I want to create a simple clone operator based on UDAs. First
step is to create a tuple of the fields with desired UDA value
and construct a clone method which uses that tuple.
import std.traits;
enum Cloneable;
struct Foo {
@Cloneable int cloneableInt;
@Cloneable string cloneableStr;
On 2/3/2015 5:37 PM, Joel wrote:
How do you install Allegro 5 (OSX)? Like, using 'Home Brew'.
This really isn't the place for that. At allegro.cc there are
Allegro-specific forums [1] and an Allegro wiki info on
building/installing, where you can find [2].
[1] https://www.allegro.cc/forums/
On Monday, 2 February 2015 at 16:58:43 UTC, bearophile wrote:
The quality of the D GC is not important for a simple Life
implementation, you just need two arrays.
Here's my 30 minute sandwich-break version, sorry it's not very
arractive 'D'...
import std.stdio;
import std.random;
void ma
On Tuesday, 3 February 2015 at 13:35:37 UTC, Paul wrote:
On Monday, 2 February 2015 at 16:58:43 UTC, bearophile wrote:
The quality of the D GC is not important for a simple Life
implementation, you just need two arrays.
Here's my 30 minute sandwich-break version, sorry it's not very
arracti
Paul:
enum WORLDSIZE = 20;
enum INITIALPOP = 70; //experimental
enum DEAD = 0;
enum ALIVE = 1;
D enums don't need to be ALL UPPERCASE :-)
int world[WORLDSIZE][WORLDSIZE];
Don't forget to compile with warnings active (it's a design error
of the D
On Tuesday, 3 February 2015 at 14:01:51 UTC, bearophile wrote:
Paul:
enum WORLDSIZE = 20;
enum INITIALPOP = 70; //experimental
enum DEAD = 0;
enum ALIVE = 1;
D enums don't need to be ALL UPPERCASE :-)
int world[WORLDSIZE][WORLDSIZE];
Don't forget
Try variadic templates with recursion.
For example see http://dpaste.dzfl.pl/f49a97e35974
Paul:
Regarding the immutable loop variable, I've conditioned myself
never to interfere with loop control values
But adding "immutable" you don't risk modifying the variable by
mistake.
It's another design mistake of D. Variables (like foreach loop
indexes) must be immutable by default bec
I wrote my graphics engine with CodeBlocks, and I only used dub
when I complied the derelict SDL2 libs.
https://github.com/ZILtoid1991/VDP-engine
You can find the sources here.
Recently I've hooked my code up to coveralls.io using the
convenient doveralls[1]. At first, I just did a dub test command
before sending the data to coveralls, but my simulation code also
has runnable tests in addition to unittests, which reaches many
more lines.
Today I've added an option t
How can I do that without any GC allocation? Nothing in std.file
seems to be marked with @nogc
I'm asking since it seems very complicated to do that with C++,
maybe D is a better choice, then we would probably move our whole
project from C++ to D.
Is there any part of Dmd that keeps track of references to
symbols? If not do you have any advice on where and how to add
them?
On 2015-02-03 at 19:53, Foo wrote:
How can I do that without any GC allocation? Nothing in std.file seems to be
marked with @nogc
I'm asking since it seems very complicated to do that with C++, maybe D is a
better choice, then we would probably move our whole project from C++ to D.
Looks lik
On Tuesday, 3 February 2015 at 19:44:49 UTC, FG wrote:
On 2015-02-03 at 19:53, Foo wrote:
How can I do that without any GC allocation? Nothing in
std.file seems to be marked with @nogc
I'm asking since it seems very complicated to do that with
C++, maybe D is a better choice, then we would pr
On 2015-02-03 at 20:50, Tobias Pankrath wrote:
Use std.utf.validate instead of decode. It will only allocate one exception if
necessary.
Looks to me like it uses decode internally...
But Foo, do you have to use @nogc? It still looks like it's work in progress,
and lack of it doesn't mean that
On Tuesday, 3 February 2015 at 18:53:28 UTC, Foo wrote:
How can I do that without any GC allocation? Nothing in
std.file seems to be marked with @nogc
I'm asking since it seems very complicated to do that with C++,
maybe D is a better choice, then we would probably move our
whole project from
On Tuesday, 3 February 2015 at 19:56:37 UTC, FG wrote:
On 2015-02-03 at 20:50, Tobias Pankrath wrote:
Use std.utf.validate instead of decode. It will only allocate
one exception if necessary.
Looks to me like it uses decode internally...
But Foo, do you have to use @nogc? It still looks like
On Tuesday, 3 February 2015 at 19:44:49 UTC, FG wrote:
On 2015-02-03 at 19:53, Foo wrote:
How can I do that without any GC allocation? Nothing in
std.file seems to be marked with @nogc
I'm asking since it seems very complicated to do that with
C++, maybe D is a better choice, then we would pr
Hi,
I wanted to create my account at wiki.dlang.org:
Went to:
http://wiki.dlang.org/?title=Special:UserLogin&returnto=Wish+list&type=signup
And got:
"No questions found; set some in LocalSettings.php using the
format from QuestyCaptcha.php."
Anyone familiar with the issue?
Piotrek
On 2015-02-04 at 00:07, Foo wrote:
How would I use decoding for that? Isn't there a way to read the file as utf8
or event better, as unicode?
Well, apparently the utf-8-aware foreach loop still works just fine.
This program shows the file size and the number of unicode glyps, or whatever
they
On Tuesday, 3 February 2015 at 23:07:03 UTC, Foo wrote:
On Tuesday, 3 February 2015 at 19:44:49 UTC, FG wrote:
On 2015-02-03 at 19:53, Foo wrote:
How can I do that without any GC allocation? Nothing in
std.file seems to be marked with @nogc
I'm asking since it seems very complicated to do tha
Ok, thanks Mike.
On Tuesday, 3 February 2015 at 23:55:19 UTC, FG wrote:
On 2015-02-04 at 00:07, Foo wrote:
How would I use decoding for that? Isn't there a way to read
the file as utf8 or event better, as unicode?
Well, apparently the utf-8-aware foreach loop still works just
fine.
This program shows the file
On 2015-02-04 at 01:56, Namespace wrote:
FILE* f = fopen(filename.ptr, "rb");
fseek(f, 0, SEEK_END);
immutable size_t fsize = ftell(f);
fseek(f, 0, SEEK_SET);
That's quite a smart way to get the size of the file.
I started with std.file.getSize (which obviously isn't mark
On Tuesday, 3 February 2015 at 23:52:18 UTC, Piotrek wrote:
Hi,
I wanted to create my account at wiki.dlang.org:
Went to:
http://wiki.dlang.org/?title=Special:UserLogin&returnto=Wish+list&type=signup
And got:
"No questions found; set some in LocalSettings.php using the
format from QuestyCaptc
On Tuesday, 3 February 2015 at 10:32:47 UTC, Pena wrote:
How can I use this code or something similar to dynamically
construct a tuple containing types of fields marked as
@Cloneable?
import std.traits, std.typetuple;
template CloneableTypes(S) {
template IsCloneable(string M) {
enum Is
On Tuesday, 3 February 2015 at 23:52:18 UTC, Piotrek wrote:
Went to:
http://wiki.dlang.org/?title=Special:UserLogin&returnto=Wish+list&type=signup
And got:
"No questions found; set some in LocalSettings.php using the
format from QuestyCaptcha.php."
Anyone familiar with the issue?
Piotrek
V
28 matches
Mail list logo