Hi guys,
I've the following code:
abstract class a {}
class b : a { this(a* myAttr = null) {} }
class c : a { this(a* myAttr = null) {} }
void main()
{
auto myb = new b();
auto myc = new c(&myb);
}
DMD says "Constructor c.this(a* myAttr = null) is not callable
using argument types (b*
Hi all,
I've the following code snipped:
import std.bigint;
void main(string[] args)
{
BigInt i = "12345";
if (args.length > 1)
{
goto Exit;
}
i = BigInt("67890");
Exit:
return;
}
When I try to compile this sample a
On Monday, 18 August 2014 at 17:47:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Mon, 18 Aug 2014 13:51:12 +
nrgyzer via Digitalmars-d-learn
wrote:
When I try to compile this sample application I'm getting the
following error:
sample.d(7): Error: goto skips declaration of var
On Tuesday, 19 August 2014 at 20:33:00 UTC, monarch_dodra wrote:
On Monday, 18 August 2014 at 13:51:14 UTC, nrgyzer wrote:
Hi all,
I've the following code snipped:
import std.bigint;
void main(string[] args)
{
BigInt i = "12345";
if (args.length > 1)
{
g
On Thursday, 21 August 2014 at 17:39:16 UTC, Ali Çehreli wrote:
On 08/21/2014 04:12 AM, nrgyzer wrote:
> I'm using the goto-command to exit my function
> if an error (not necessarily an exception) occured.
Sorry to repeat myself but if an exception occurs in code
before the goto, the exit code
Hi everyone,
I'm facing a problem with the JSON functions. I've to communicate
with another PC using JSON. Here's a simple snipped which shows
my problem:
import std.json;
import std.stdio;
void main()
{
double d = 1.23456789;
JSONValue j = d;
sendToRemote(toJSON(&j));
}
On Thursday, 21 August 2014 at 23:29:56 UTC, Idan Arye wrote:
On Thursday, 21 August 2014 at 23:05:48 UTC, Ali Çehreli wrote:
I don't think it is a concern as JSON does not encode types.
It is up to the receiver how to interpret the data. Here is
the output of the program above:
{"value":"1.2
Hi guys,
I'm having some trouble using the treeset implementation of
Steven (dcollections) in conjunction with __gshared. When I do
the following:
class Entry
{
int value;
this(int v)
{
value = v;
}
int opCmp(Object o)
{
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example("example1", 1)
void myFunction()
{
// do something
}
module mod.example2;
@example("example2", 2)
void myFunction()
{
// do something
}
I'm using the struct to
On Thursday, 16 October 2014 at 19:19:21 UTC, John Colvin wrote:
On Thursday, 16 October 2014 at 18:39:50 UTC, nrgyzer wrote:
Hi,
I'm using structs to describe my functions:
struct example
{
string name;
uint someValue;
}
module mod.example1;
@example("example1", 1)
void myFunction()
{
//
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import my.static.library.binding;
static this()
{
foreach ( m; __traits(allMembers, example) )
{
static if ( isCallable!(mixing(m) )
{
// ... do something here
}
}
}
void ma
On Sunday, 19 October 2014 at 14:48:18 UTC, monarch_dodra wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
static if ( isCallable!(mixing(m) )
"mixing" ?
void main() { /* do something here */ }
What exactly are you doing here?
...
On Sunday, 19 October 2014 at 17:14:14 UTC, monarch_dodra wrote:
On Sunday, 19 October 2014 at 16:09:41 UTC, nrgyzer wrote:
"mixing" should be replaced with "mixin": static if (
isCallable!(mixin(m) )
My main is empty in both cases. So nothing done in my main
(currently).
Posting full code
On Sunday, 19 October 2014 at 22:22:05 UTC, Joakim wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import my.static.library.binding;
static this()
{
foreach ( m; __traits(allMembers, examp
On Monday, 20 October 2014 at 16:05:14 UTC, nrgyzer wrote:
On Sunday, 19 October 2014 at 22:22:05 UTC, Joakim wrote:
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote:
Hi guys,
when I do the following:
module myMain;
import example;
import std.traits;
import my.static.library.binding
This solved the problem for the first time, BUT - I don't know if
it's a bug or a feature - I ran into another problem. I'm having
the following few lines:
module example;
private
{
string[string] myPrivateArray;
}
static this()
{
foreach ( m; __traits(allMembers, example) )
{
On Monday, 20 October 2014 at 17:37:34 UTC, nrgyzer wrote:
This solved the problem for the first time, BUT - I don't know
if it's a bug or a feature - I ran into another problem. I'm
having the following few lines:
module example;
private
{
string[string] myPrivateArray;
}
static this()
{
Hi,
I've the following source:
import std.array : split;
import std.stdio : writeln;
void main()
{
string myString = "Hello World";
string[] splitted = myString.split(" ");
}
But when I compile the code above, I'm getting the following
error:
Error: template instance std.array.split!(
On Saturday, 18 April 2015 at 08:13:00 UTC, Rikki Cattermole
wrote:
On 18/04/2015 8:08 p.m., nrgyzer wrote:
Hi,
I've the following source:
import std.array : split;
import std.stdio : writeln;
void main()
{
string myString = "Hello World";
string[] splitted = myString.split(" ");
}
But
On Saturday, 18 April 2015 at 13:00:59 UTC, Steven Schveighoffer
wrote:
On 4/18/15 4:18 AM, nrgyzer wrote:
array.d(1510): Error not a property splitter(range, sep).array
sample.d(6): Error template instance std.array.split!(string,
char)
error instantiating
Are you using -property switch?
Hi,
I'm looking for a function that converts my hex-string to a
binary representation. In Python I write the following:
myHex = "123456789ABCDEF"
myBin = myHex.decode('hex')
But how to do the same in D? Is there any function?
Thanks for suggestions!
On Friday, 24 April 2015 at 18:45:55 UTC, Jesse Phillips wrote:
On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote:
Hi,
I'm looking for a function that converts my hex-string to a
binary representation. In Python I write the following:
myHex = "123456789ABCDEF"
myBin = myHex.decode('hex
22 matches
Mail list logo