On Friday, 6 November 2015 at 18:34:45 UTC, Cauterite wrote:
On Friday, 6 November 2015 at 13:16:46 UTC, Suliman wrote:
On Windows 7 it's work fine. On Windows 10 (clean install)
it's do not start and require MSVCR120.dll
D doesn't make particularly heavy use of the C runtime, so
there's a go
On Wednesday, 18 January 2017 at 03:36:39 UTC, Nicholas Wilson
wrote:
Alternatively use %a to print in hex to verify exact bit
patterns.
+1, if it doesn't have to be human-readable.
On Wednesday, 18 January 2017 at 09:54:43 UTC, Suliman wrote:
On Friday, 6 November 2015 at 18:34:45 UTC, Cauterite wrote:
On Friday, 6 November 2015 at 13:16:46 UTC, Suliman wrote:
On Windows 7 it's work fine. On Windows 10 (clean install)
it's do not start and require MSVCR120.dll
D doesn't
On Tuesday, 17 January 2017 at 23:41:27 UTC, Nordlöw wrote:
On Tuesday, 17 January 2017 at 23:38:46 UTC, Ali Çehreli wrote:
Found'em! :)
https://dlang.org/phobos/std_math.html#.nextUp
Thanks!
(Shouts into the soundless void)
https://github.com/pineapplemachine/mach.d/blob/master/mach/mat
On Wednesday, 18 January 2017 at 01:15:05 UTC, Ali Çehreli wrote:
Not available but it should be possible to parse the produced
code:
import std.bitmanip;
string makeBitFieldPrinter(string fieldImpl) {
return q{
void printBitFields() const {
import std.stdio: writeln;
I've "solved" the same problem by using AliasSeq to generate bitfields
so that for iterating over bitfields I can iterate over alias sequence
and mixin code. Not very good but it works.
On Wednesday, 18 January 2017 at 04:25:42 UTC, Mike Parker wrote:
extern(C), not simply extern. It turns off the name mangling.
But really, the proper thing to do is to drop the prototype and
import the module with the implementation. It's tge way modules
are intended to be used. Unless you'r
Hi
I am having problems using stored procedures that return results.
Example procedure:
CREATE PROCEDURE GetUsers()
SELECT * FROM users;
When I use this procedure from the MySQL command line everything
works fine. However, when I use it from the mysql-native library
i get into problems.
i
On Wednesday, 18 January 2017 at 19:40:12 UTC, TheFlyingFiddle
wrote:
Hi
I am having problems using stored procedures that return
results.
Update: I am using the SvrCapFlags.MULTI_RESULTS flag when
initiating the connection and have also tried using the
SvrCapFlags.MULTI_STATEMENTS flag.
I have a simple comparison function:
struct Foo {
string bar;
}
auto sameGroup(T,S) (T a, S b) {
static assert (is(T == string) || is(T == Foo));
static assert (is(S == string) || is(S == Foo));
string aStr;
string bStr;
static if (is(T == string)){
aStr = a;
I've done a whole bunch of looking around, and I don't see any
mention of returning a dynamic array from a function. When I try
it though, it just returns the .length value of the array, rather
than the contents of the array. Does anyone know why this is, and
what I can do to make it behave the
On Wednesday, 18 January 2017 at 19:28:20 UTC, Samwise wrote:
On Wednesday, 18 January 2017 at 04:25:42 UTC, Mike Parker
wrote:
extern(C), not simply extern. It turns off the name mangling.
But really, the proper thing to do is to drop the prototype
and import the module with the implementati
What code do you have now?
On 01/18/2017 02:02 PM, Jordan Wilson wrote:
I have a simple comparison function:
struct Foo {
string bar;
}
auto sameGroup(T,S) (T a, S b) {
static assert (is(T == string) || is(T == Foo));
static assert (is(S == string) || is(S == Foo));
string aStr;
string bStr;
stat
On Wednesday, 18 January 2017 at 22:37:25 UTC, Adam D. Ruppe
wrote:
What code do you have now?
This is the basic function. It takes all those boolean arguments
and does things depending on them, and then takes any extra args
that getopt didn't parse and reads them into numbs. That code
works
On Wednesday, 18 January 2017 at 22:39:02 UTC, Ali Çehreli wrote:
On 01/18/2017 02:02 PM, Jordan Wilson wrote:
[...]
Yes, can be better with something similar to the following:
struct Foo {
string bar;
}
string value(U : Foo)(U u) {
return u.bar;
}
string value(U : string)(U u) {
Is it undefined behavior to assign &this to a pointer in the
constructor of a struct?
On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote:
Is it undefined behavior to assign &this to a pointer in the
constructor of a struct?
Yes:
http://dlang.org/spec/struct.html
"A struct is defined to not have an identity; that is, the
implementation is free to make bit copies of
On Wednesday, 18 January 2017 at 22:51:17 UTC, Samwise wrote:
numbs[] = getInp(help, file, inp, args);
This is wrong, try just `numbs = getImp(...);`
numbs[] = xxx will copy stuff into the existing array, which is
empty right now. You want to jut keep the slice the function
passes ba
On Wednesday, 18 January 2017 at 19:28:20 UTC, Samwise wrote:
Alright, so I misunderstood what ketmar was saying. His
solution did work. I'm just not sure I understand what you are
trying to say here:
But really, the proper thing to do is to drop the prototype
and import the module with the
On Wednesday, 18 January 2017 at 23:12:15 UTC, Mike Parker wrote:
(source files), then use the import statement to make the
declarations in other modules.
Sorry, this should read "make the implementations available to
other modules".
Thanks loads. I got it working using those modules.
~Sam
On Wednesday, 18 January 2017 at 23:09:15 UTC, Adam D. Ruppe
wrote:
On Wednesday, 18 January 2017 at 22:51:17 UTC, Samwise wrote:
numbs[] = getInp(help, file, inp, args);
This is wrong, try just `numbs = getImp(...);`
numbs[] = xxx will copy stuff into the existing array, which is
em
On Wednesday, 18 January 2017 at 23:08:07 UTC, Adam D. Ruppe
wrote:
On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote:
Is it undefined behavior to assign &this to a pointer in the
constructor of a struct?
Yes:
http://dlang.org/spec/struct.html
"A struct is defined to not have an
A compilation of
struct T
{
int x;
@disable this(this); // this has no effect on the issue
ref inout(T) memberFun() inout
{
pragma(msg, "memberFun:", __traits(isRef, this) ? "ref" :
"non-ref", " this");
return this;
}
}
void freeFun()(auto ref const T x)
On Wednesday, 18 January 2017 at 23:08:07 UTC, Adam D. Ruppe
wrote:
On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote:
Is it undefined behavior to assign &this to a pointer in the
constructor of a struct?
Yes:
http://dlang.org/spec/struct.html
"A struct is defined to not have an
On Thursday, 19 January 2017 at 00:55:42 UTC, NotSpooky wrote:
You already answered on the IRC so thanks X2.
So, it's problematic to have pointers to structs in all cases
according to spec?
Maybe... though in practice (and with C compatibility), pointers
to ones where you know the memory mana
Somehow I can't use ubyte variables behind 'case', but ulong
works fine. Why is that?
void main() {
alias TestType = ulong; // won't compile if = ubyte
import std.stdio;
TestType a,b,c;
readf("%s %s %s ", &a, &b, &c);
switch(c){
case a: wri
On Thursday, 19 January 2017 at 00:44:51 UTC, Nordlöw wrote:
Any clues on how to retrieve this information?
Another much more common use case:
Chained property setters could be optimized iff the property
setter is called on an r-value, that is when
`__traits(isRef,this)` is `false`
Typ
On 01/18/2017 05:22 PM, Yuxuan Shui wrote:
Somehow I can't use ubyte variables behind 'case', but ulong works fine.
Why is that?
void main() {
alias TestType = ulong; // won't compile if = ubyte
import std.stdio;
TestType a,b,c;
readf("%s %s %s ", &a, &b, &c);
switch(c){
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
}
Yet X ~= 3; fails.
3 should be implicitly convertible to Y and then ~ should assign
it.
?
On 19/01/2017 3:08 PM, Ignacious wrote:
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
}
Yet X ~= 3; fails.
3 should be implicitly convertible to Y and then ~ should assign it.
?
This should not fail:
X x = new X;
x ~= 3;
This should fail as x is a member of
On Thursday, 19 January 2017 at 02:00:10 UTC, Ali Çehreli wrote:
On 01/18/2017 05:22 PM, Yuxuan Shui wrote:
Somehow I can't use ubyte variables behind 'case', but ulong
works fine.
Why is that?
case expressions must be constants:
"The case expressions must all evaluate to a constant value
On Thursday, 19 January 2017 at 02:15:04 UTC, rikki cattermole
wrote:
On 19/01/2017 3:08 PM, Ignacious wrote:
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
}
This should not fail:
X x = new X;
x ~= 3;
Yes, it should fail. 3 is not implicitly convertible to
On 19/01/2017 3:25 PM, Adam D. Ruppe wrote:
On Thursday, 19 January 2017 at 02:15:04 UTC, rikki cattermole wrote:
On 19/01/2017 3:08 PM, Ignacious wrote:
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
}
This should not fail:
X x = new X;
x ~= 3;
Yes, it sho
On Thursday, 19 January 2017 at 02:25:44 UTC, Adam D. Ruppe wrote:
On Thursday, 19 January 2017 at 02:15:04 UTC, rikki cattermole
wrote:
On 19/01/2017 3:08 PM, Ignacious wrote:
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
}
This should not fail:
X x = new X;
On 19/01/2017 3:35 PM, Ignacious wrote:
On Thursday, 19 January 2017 at 02:25:44 UTC, Adam D. Ruppe wrote:
On Thursday, 19 January 2017 at 02:15:04 UTC, rikki cattermole wrote:
On 19/01/2017 3:08 PM, Ignacious wrote:
class Y
{
int y;
alias y this;
}
class X
{
Y[] x;
alias x this;
On Thursday, 19 January 2017 at 02:51:03 UTC, rikki cattermole
wrote:
On 19/01/2017 3:35 PM, Ignacious wrote:
On Thursday, 19 January 2017 at 02:25:44 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 January 2017 at 02:15:04 UTC, rikki
cattermole wrote:
On 19/01/2017 3:08 PM, Ignacious wrote:
class
I have the need to create an enum flag like structure to specify
certain properties of a type easily.
e.g.,
enum properties
{
Red,
Blue,
Hot,
Sexy,
Active,
...
}
But some properties will be mutually exclusive. I would like to
contain all those rules for in the enum itself fo
On Thursday, 19 January 2017 at 02:51:03 UTC, rikki cattermole
wrote:
Now, lets say Y was a struct, then yeah it can work.
In theory, it can work with either (the compiler could just
insert the function call to alloc+construct), but it won't in D
since we don't have implicit construction.
On Thursday, 19 January 2017 at 02:35:08 UTC, Ignacious wrote:
But this is alias this, the whole point of alias this is to
treat the type as as the alias?
No, alias this is for subtyping. Similar to a child class, a
subtype can be used as its parent type, but must be constructed.
class A {}
On Thursday, 19 January 2017 at 02:59:04 UTC, Ignacious wrote:
I have the need to create an enum flag like structure to
specify certain properties of a type easily.
e.g.,
enum properties
{
Red,
Blue,
Hot,
Sexy,
Active,
...
}
But some properties will be mutually exclusive. I
On Thursday, 19 January 2017 at 03:47:34 UTC, Ignacious wrote:
On Thursday, 19 January 2017 at 02:59:04 UTC, Ignacious wrote:
I have the need to create an enum flag like structure to
specify certain properties of a type easily.
e.g.,
enum properties
{
Red,
Blue,
Hot,
Sexy,
Acti
alias a = myarray[k];
fails
myarray is a multidimensial array that I want to reduce writing
it every time but D complains that it can't alias it.
I simply want it to do a direct substitution, nothing fancy, just
to reducing typing.
44 matches
Mail list logo