On Thursday, 1 January 2015 at 18:58:04 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, Tobias Pankrath via Digitalmars-d-learn
wrote:
You could implement an OrderedMap!(Key, Value) via
RedBlackTree!(Tuple!(Key, Value), (a,b) => a[0] < b[0]).
We could add this as an alias into
On Thu, 01 Jan 2015 17:51:45 +
novice2 via Digitalmars-d-learn
wrote:
> I want to use external or C function.
> It used only one time from one D function.
> I want do declare C function inside D function.
> I don't want to declare C function in global scope.
>
> Is my wish correct?
> Reduced
On Thu, 01 Jan 2015 12:32:33 +
Idan Arye via Digitalmars-d-learn
wrote:
> If I have an associative array and I only modify it's values,
> without changing the keys, can I assume that the order won't
> change?
please, don't: this is implementation-specific. druntime code can
change (for exam
On Friday, 2 January 2015 at 00:08:02 UTC, anonymous wrote:
Apparently dmd thinks that the result of f must be a nested
struct. I.e. it needs a context pointer. And I guess hell would
break loose if you'd use a nested struct with a null context
pointer. At least when the context pointer is actu
On Thursday, 1 January 2015 at 23:06:30 UTC, Peter Alexander
wrote:
Can someone please explain this behaviour? I find it totally
bizarre.
auto f(T)(T x) {
struct S {
T y;
this(int) { }
}
return S(0);
}
void main() {
f(f(0));
}
E
On Thursday, 1 January 2015 at 22:15:52 UTC, Suliman wrote:
I have instance of class, that need data from 2 another
classes. So I decided that I need to create it only after I get
the data from both instance.
auto mysql = new MySQL(parseconfig, seismoDownload); // the
problem is here! (LOC 17
Can someone please explain this behaviour? I find it totally
bizarre.
auto f(T)(T x) {
struct S {
T y;
this(int) { }
}
return S(0);
}
void main() {
f(f(0));
}
Error: constructor f376.f!(S).f.S.this field y must be
initialized in
On Thursday, 1 January 2015 at 21:15:27 UTC, Ali Çehreli wrote:
On 01/01/2015 09:35 AM, Basile Burg wrote:
> On Tuesday, 30 December 2014 at 19:18:41 UTC, Basile Burg
wrote:
> an ICE (every
> compiler crash is an ICE right ?),
Yes, the compiler should never crash but produce an error
message.
I have instance of class, that need data from 2 another classes.
So I decided that I need to create it only after I get the data
from both instance.
auto mysql = new MySQL(parseconfig, seismoDownload); // the
problem is here! (LOC 170)
mysql need settings form parseconfig, and link from inst
On 01/01/2015 05:09 AM, Suliman wrote:
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection string?
Walter Bright explains the reasons in his "Value Range Propagation" article:
http://www.drdobbs.com/tools/value-range-prop
On 01/01/2015 09:35 AM, Basile Burg wrote:
> On Tuesday, 30 December 2014 at 19:18:41 UTC, Basile Burg wrote:
> an ICE (every
> compiler crash is an ICE right ?),
Yes, the compiler should never crash but produce an error message.
Please report it preferably with a reduced code sample:
http
Suliman:
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection
string?
Because value range analysis now propagates the range even across
expressions if they are const. It's a recent improvement to make
the D compile a bit
On Thursday, 1 January 2015 at 17:51:46 UTC, novice2 wrote:
I want to use external or C function.
It used only one time from one D function.
I want do declare C function inside D function.
I don't want to declare C function in global scope.
Is my wish correct?
Reduced code:
extern (C) int get
On Wednesday, 31 December 2014 at 00:36:36 UTC, Damian wrote:
Append and Prepend would be very useful additions to Phobos it's
quite surprising there not already there? In any case would love
to see some pull requests :)
Do we really need Append and Prepend (along with append and
prepend) here
On 1/1/15, Tobias Pankrath via Digitalmars-d-learn
wrote:
> You could implement an OrderedMap!(Key, Value) via
> RedBlackTree!(Tuple!(Key, Value), (a,b) => a[0] < b[0]).
We could add this as an alias into Phobos or perhaps as just a
documentation line on the website.
On Thursday, 1 January 2015 at 18:08:52 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, H. S. Teoh via Digitalmars-d-learn
wrote:
If you need consistent ordering of values, you probably want a
different
data structure, like an ordered map
This one works nicely on D1, I'd imagi
Am Thu, 01 Jan 2015 16:07:06 +
schrieb "thedeemon" :
> Solution in this case: call rmdir not from destructor.
Thanks (also to Daniel Kozak) for the information. I moved the functionality to
an explicitly called method.
Best regards,
Timo
On 1/1/15, H. S. Teoh via Digitalmars-d-learn
wrote:
> If you need consistent ordering of values, you probably want a different
> data structure, like an ordered map
This one works nicely on D1, I'd imagine the D2 port works just the same:
https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/
I want to use external or C function.
It used only one time from one D function.
I want do declare C function inside D function.
I don't want to declare C function in global scope.
Is my wish correct?
Reduced code:
extern (C) int getch();
void main() {
getch();
}
//compiled OK
void main()
On Tuesday, 30 December 2014 at 19:18:41 UTC, Basile Burg wrote:
On Tuesday, 30 December 2014 at 19:05:23 UTC, Ali Çehreli wrote:
On 12/30/2014 09:42 AM, Basile Burg wrote:
Ok, thx. I see the trick:
mixin (propertyInjections!C);
Introspection inside each class. I don't find this solution
u
On Thu, Jan 01, 2015 at 04:17:39PM +, Idan Arye via Digitalmars-d-learn
wrote:
[...]
> My use case is that I have a large AA where the values are numbers and
> the keys are strings, and I need to send it over network again and
> again. The values constantly change but the keys should remain th
On 1/1/15, Peter Alexander via Digitalmars-d-learn
wrote:
> The order is unspecified, but an iteration must iterate in *some*
> order. The question (if I've understood it correctly), is whether
> that order of iteration changes when the keys aren't changed.
Hmm yeah, that definitely wasn't ever s
On Thursday, 1 January 2015 at 13:39:57 UTC, Peter Alexander
wrote:
On Thursday, 1 January 2015 at 13:13:10 UTC, Andrej Mitrovic
via Digitalmars-d-learn wrote:
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
If I have an associative array and I only modify it's values,
without changing the
On Thursday, 1 January 2015 at 15:14:41 UTC, Timo Gransch wrote:
Hi,
I have a class which unzips an archive into a temporary
directory below the system temp folder. I want to delete this
temporary directory in the class's destructor, but when I call
rmdir there, I get an
core.exception.Inva
Timo Gransch via Digitalmars-d-learn píše v Čt 01. 01. 2015 v 16:14
+0100:
> Hi,
>
> I have a class which unzips an archive into a temporary directory below the
> system temp folder. I want to delete this temporary directory in the class's
> destructor, but when I call rmdir there, I get an
>
>
Hi,
I have a class which unzips an archive into a temporary directory below the
system temp folder. I want to delete this temporary directory in the class's
destructor, but when I call rmdir there, I get an
core.exception.InvalidMemoryOperationError@(0)
The effect is not limited to this specia
On Wednesday, 31 December 2014 at 11:19:36 UTC, Laeeth Isharc
wrote:
Argh - no way to edit.
What's best practice here?
D strings are not null-terminated.
===
cpling.c
char* cpling(char *s)
{
s[0]='!';
return s;
}
===
dcaller.d
extern(C) char* cpling(char* s);
void callC()
{
writefln("%
On Thursday, 1 January 2015 at 13:13:10 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
If I have an associative array and I only modify it's values,
without changing the keys, can I assume that the order won't
change?
Associative arrays
On Thursday, 1 January 2015 at 13:09:21 UTC, Suliman wrote:
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection
string?
As I said the compiler infers that 5432 is between short.min and
short.max. Try it with something out
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
> If I have an associative array and I only modify it's values,
> without changing the keys, can I assume that the order won't
> change?
Associative arrays are not ordered at all.
See the first note here: http://dlang.org/hash-map.html
But why variant:
static const int PGSQL_UNITTEST_PORT = 5432;
do not require of implicit convert to!short() at connection
string?
So it's look like that it can accept strings and ints without
problem.
And I really can't understand why it's accept only "static
const string" constructions...
int does not implicitly convert to short. It does in the
hardcoded version, because the compi
If I have an associative array and I only modify it's values,
without changing the keys, can I assume that the order won't
change?
I need to pass some config to ddbc driver. When I use static
const all work ok.
static const string PGSQL_UNITTEST_HOST = "localhost";
static const intPGSQL_UNITTEST_PORT = 5432;
static const string PGSQL_UNITTEST_USER = "postgres";
static const string PGSQL_UNITTEST_PASSWORD = "Infinity8"
34 matches
Mail list logo