On Monday, 2 September 2013 at 04:49:46 UTC, H. S. Teoh wrote:
You can't alias a type to this. You need to instantiate it
first, then alias the instance to this (because 'this' is an
object, not a type). For example:
struct S {}
struct T {
//alias S this; // NG
On Mon, Sep 02, 2013 at 06:21:18AM +0200, Era Scarecrow wrote:
> k here's the condensed test file. Seems related to an 'alias
> this', in theory the HandleFlags bit/flag handling you should be
> able to say 'state.def' and it would be the same as
> 'FlagStates.def' without actually having to name
On Mon, Sep 02, 2013 at 12:27:44AM +0200, Joseph Rushton Wakeling wrote:
> Hello all,
>
> I came across an interesting little pitfall of delegates recently
> which I thought I'd share.
>
> TL;DR: having reference types as struct members can be dangerous. ;-)
Yes.
> Suppose we have a fairly sim
k here's the condensed test file. Seems related to an 'alias
this', in theory the HandleFlags bit/flag handling you should be
able to say 'state.def' and it would be the same as
'FlagStates.def' without actually having to name it.
[code]
import std.traits;
///
struct HandleFlags(E, I)
if (is(
I feel like i need to fully re-learn and familiarize myself with
D now.
This is an interesting error I'm coming across, it's not
pointing to anything in particular. I've used the -v verbose flag
and it seems to appear each time after a struct declaration.
code subrecord
function smartm
John Carter:
"How easy is it to convert both C++ programs and C++
programmers to D?"
Porting C code to D is not hard, it's mostly mechanical work, you
just have to keep an eye on few things (like passing fixed-sized
arrays to functions by reference, global floating point data not
initialize
Thanks for your reply!
On Monday, 2 September 2013 at 00:32:52 UTC, bearophile wrote:
I didn't know it uses significant macros. Could you show some
of such code pieces?
Here is the documentation...
http://cimg.sourceforge.net/reference/group__cimg__loops.html
// Macros to perform various imag
On Monday, 2 September 2013 at 00:32:52 UTC, bearophile wrote:
I think no one has converted CImg to D. There is a graphics
project for D, perhaps named simplegraphics, that contains
about 0.01% of CImg.
If you mean my little libs, I'm not really aiming for complex
drawing. simpledisplay.d has
Added:
http://d.puremagic.com/issues/show_bug.cgi?id=10946
On Monday, 2 September 2013 at 01:19:44 UTC, bearophile wrote:
Era Scarecrow:
[code]
enum fieldEntryLength = 4;
//immutable fieldEntryLength = 4; //same issue
alias immutable(char[fieldEntryLength]) NString;
[/code]
test.d(10): Error: Integer constant expression expected
instead of fieldEnt
Era Scarecrow:
[code]
enum fieldEntryLength = 4;
//immutable fieldEntryLength = 4; //same issue
alias immutable(char[fieldEntryLength]) NString;
[/code]
test.d(10): Error: Integer constant expression expected instead
of fieldEntryLength
This breaks code that previously compiled. I re
[code]
enum fieldEntryLength = 4;
//immutable fieldEntryLength = 4; //same issue
alias immutable(char[fieldEntryLength]) NString;
[/code]
test.d(10): Error: Integer constant expression expected instead
of fieldEntryLength
This breaks code that previously compiled. I really don't see
t
John Carter:
We work in the embedded linux real time area,
I think you could use D for embedded area, but I think of D more
like a low level application language.
1) Which D compiler should we start with?
dmd is more updated and it's the reference one, it compiles fast,
but it produces
1) afaik you can't cross compile to arm with dmd. I know it's possible with
gdc.
2) There are people who successfully use d without gc. I think andrei
posted a stub gc that throws an exception every time the garbage collector
is tried to get used. You can't use whole phobos (yet) without gc.
2013
So I'm a reasonably experienced C/C++/Ruby/... programmer and D
is looking very Good to me...
So, time to get serious and sit down and learn it.
Ultimately it won't pay me to learn it unless I can ultimately
take my colleagues along.
Currently they are itching to move from C to C++, and I'm
Hello all,
I came across an interesting little pitfall of delegates recently which I
thought I'd share.
TL;DR: having reference types as struct members can be dangerous. ;-)
Suppose we have a fairly simple range which is supposed to count from 0 to some
maximum. The trick is that the count
On 08/31/2013 10:22 PM, gedaiu wrote:> Hi,
>
> i want to save data from an array of variants into a file. I saw that
> to!string format the array content in a nice way...
I don't think the format is sufficient for recreating the array:
import std.variant;
import std.conv;
import std.stdio;
stru
On Sunday, 1 September 2013 at 14:11:54 UTC, Adam D. Ruppe wrote:
On Sunday, 1 September 2013 at 14:07:00 UTC, Flamaros wrote:
Is there a simple way to extract from a string all Unicode
codes as uint values?
string foo = "whatever";
foreach(dchar ch; foo) {
// ch is the code point as a 32
On 1-9-2013 16:11, Adam D. Ruppe wrote:
On Sunday, 1 September 2013 at 14:07:00 UTC, Flamaros wrote:
Is there a simple way to extract from a string all Unicode codes as uint values?
string foo = "whatever";
foreach(dchar ch; foo) {
// ch is the code point as a 32 bit number
// use it
On Sunday, 1 September 2013 at 14:07:00 UTC, Flamaros wrote:
Is there a simple way to extract from a string all Unicode
codes as uint values?
string foo = "whatever";
foreach(dchar ch; foo) {
// ch is the code point as a 32 bit number
// use it directly or cast to uint here
}
Is there a simple way to extract from a string all Unicode codes
as uint values?
Bah, what would be the meaning of accepting the shebang syntax
then? SCripts are made to provide a quick way to hack: you edit
it for 5 mins, you run it. You change a parameter inside, you run
it. Otherwise, there would be no need for scripts, everything
could be compiled, even if you fill ever
22 matches
Mail list logo