On Sunday, 25 January 2015 at 08:39:42 UTC, Bayan Rafeh wrote:
On Sunday, 25 January 2015 at 00:43:43 UTC, Vladimir Panteleev
wrote:
On Saturday, 24 January 2015 at 12:16:38 UTC, Bayan Rafeh
wrote:
This problem is a tough one. I've been getting this error
when I run my unittests, and
On Sunday, 25 January 2015 at 08:41:25 UTC, Bayan Rafeh wrote:
The solution was just to remove the delete a from the
destructor if someone comes across this later. Could someone
tell me why though?
The non-reentrant bit applies to all GC operations, really -
not just allocations. Explicit
On Sunday, 25 January 2015 at 10:21:34 UTC, Suliman wrote:
But is it good practice to fail with exception during passing
unknown parameters? Maybe std.getopt.config.passThrough should
be as default?
I really can't remember Apps that crush if pass to in unknown
parameters.
Almost all
Vlad Levenfeld:
What's this about !`[]` and std.range.uniform?? It's not in the
documentation.
It's an enhancement I have proposed.
Bye,
bearophile
On Sunday, 25 January 2015 at 00:43:43 UTC, Vladimir Panteleev
wrote:
On Saturday, 24 January 2015 at 12:16:38 UTC, Bayan Rafeh wrote:
This problem is a tough one. I've been getting this error when
I run my unittests, and apparently it is caused by attempting
an allocation in the destructor
But is it good practice to fail with exception during passing
unknown parameters? Maybe std.getopt.config.passThrough should be
as default?
I really can't remember Apps that crush if pass to in unknown
parameters.
On Sunday, 25 January 2015 at 00:44:07 UTC, Vladimir Panteleev
wrote:
I created a wiki page which I hope will help you solve this
problem:
http://wiki.dlang.org/InvalidMemoryOperationError
Hope this helps.
Great! Thanks!
On 2015-01-25 at 11:42, Tobias Pankrath wrote:
On Sunday, 25 January 2015 at 10:21:34 UTC, Suliman wrote:
But is it good practice to fail with exception during passing unknown
parameters? Maybe std.getopt.config.passThrough should be as default?
I really can't remember Apps that crush if pass
On Sunday, 25 January 2015 at 10:42:51 UTC, bearophile wrote:
Vlad Levenfeld:
What's this about !`[]` and std.range.uniform?? It's not in
the documentation.
It's an enhancement I have proposed.
Hm. I had more something in mind like paramCast - a kind of big
scissors that cut everything a
On Sunday, 25 January 2015 at 12:25:35 UTC, Dominikus Dittes
Scherkl wrote:
map!(x = fn(cast(ParameterTypeTuple!fn[0])x)
but instead with
map!(paramCast!fn)
Because this is useful in more situations, e.g. in every place
where you know the values would fit into the parameter (and for
a
On Sunday, 25 January 2015 at 13:03:16 UTC, bearophile wrote:
Dominikus Dittes Scherkl:
Because this is useful in more situations,
Right, but it's still a cast. And in D you want to minimize the
number of usages of casts. The proposed syntax iota![] is
cast-safe.
I don't case too much,
On Sunday, 25 January 2015 at 15:11:33 UTC, AndyC wrote:
On Sunday, 25 January 2015 at 05:48:26 UTC, Vladimir Panteleev
wrote:
On my Ubuntu Server, I can't link any D program which uses
libraries other than Phobos.
Example:
//
import std.net.curl;
import
Thanks. I didn't realize that could conflict.
On Sunday, 25 January 2015 at 21:22:50 UTC, Ali Çehreli wrote:
On 01/25/2015 11:30 AM, Gan wrote:
Here's a screenshot: http://cl.ly/image/2n282v0B1X2M
The error is:
/Users/Matt/Projects/spacecraft/source/Game/Game.d(0,0):
Error: class
On 01/25/2015 02:06 PM, Bayan Rafeh wrote:
is invariant() called during the destruction phase?
Something is fishy.
import std.stdio;
void main(){
writeln(entered main);
auto a = new A();
writeln(leaving main);
}
class A {
File file;
this() {
writeln(this);
On Sunday, 25 January 2015 at 22:46:56 UTC, Ali Çehreli wrote:
On 01/25/2015 02:06 PM, Bayan Rafeh wrote:
is invariant() called during the destruction phase?
Something is fishy.
import std.stdio;
void main(){
writeln(entered main);
auto a = new A();
writeln(leaving main);
}
On Monday, 26 January 2015 at 03:36:32 UTC, Gan wrote:
With Xamarin Studio I create a D project and run it. It runs an
Executable Unix file through the terminal. How can I turn that
into an Application that doesn't open the Terminal?
Thanks.
Have you tried running your executable from the
I've been working on my game and am getting some pretty gnarly
memory problems. I think it's how I'm allocating.
Sometimes when I use variables I can do Color(255, 255, 255). But
why is that different than new Color(255, 255, 255)?
Same when I'm making arrays. new int[](0) vs [].
What's the
dub init name vibe.d
cd name
dub
Results in
Fetching libevent 2.0.1+2.0.16...
Error executing command upgrade: Failed to download
http://code.dlang.org/packages/libevent/2.0.1%252B2.0.16.zip: 404
Not Found
I'm not sure if the error is the file not being there or dub
looking there. Is there
On Sun, 25 Jan 2015 14:11:09 +, Dominikus Dittes Scherkl wrote:
On Sunday, 25 January 2015 at 13:03:16 UTC, bearophile wrote:
Dominikus Dittes Scherkl:
Because this is useful in more situations,
Right, but it's still a cast. And in D you want to minimize the number
of usages of casts.
I'd like to vary the query based on input but if I try to move
the string out of the sqlite3_exec call like this:
string sqlStatement = CREATE TABLE people(id INT PRIMARY KEY NOT
NULL, surname TEXT NOT NULL);;
result = sqlite3_exec(db, sqlStatement, aCallback, null, msg);
...it won't
On Sunday, 25 January 2015 at 18:15:21 UTC, Paul wrote:
I'd like to vary the query based on input but if I try to move
the string out of the sqlite3_exec call like this:
string sqlStatement = CREATE TABLE people(id INT PRIMARY KEY
NOT NULL, surname TEXT NOT NULL);;
result = sqlite3_exec(db,
On Sun, 25 Jan 2015 08:41:24 +, Bayan Rafeh wrote:
I tried what you said and I think I see the problem. I managed to
create an example program that duplicates the problem:
import std.stdio;
class A {
string path;
this(string p) {
path = p;
}
~this() {
On Sunday, 25 January 2015 at 18:19:47 UTC, Tobias Pankrath wrote:
Only string literals convert to const(char)*, because only for
them it is guaranteed that they are null terminated. For
everything else use toStringz.
So, as a trivial example, is this how it's done?:
string semiC = ;;
const
On Mon, 26 Jan 2015 05:25:48 +, Bayan Rafeh wrote:
There are 2 problems here:
1. By definition, after the destructor is called the object state is
destroyed. It makes no sense to check the invariant after the destructor
is called because there is no state for us to check.
i agree that
On Monday, 26 January 2015 at 06:37:34 UTC, tcak wrote:
On Monday, 26 January 2015 at 03:36:32 UTC, Gan wrote:
With Xamarin Studio I create a D project and run it. It runs
an Executable Unix file through the terminal. How can I turn
that into an Application that doesn't open the Terminal?
With Xamarin Studio I create a D project and run it. It runs an
Executable Unix file through the terminal. How can I turn that
into an Application that doesn't open the Terminal?
Thanks.
the thing is that your invariant is not a correct invariant at
all.
invariants are meant to check *internal* object consistency,
not external
conditions. compiler is free to call invariant block at any
time after
object is properly initialised (i.e. after ctor is complete)
and is not
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote:
Laeeth Isharc:
I think concatenation and append are used as synonyms (the
same meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
Perfect! Thank
On Monday, January 26, 2015 01:17:15 WhatMeWorry via Digitalmars-d-learn wrote:
Ok, I just made up that word. But what is the difference between
appending and concatenating? Page 100 of TPDL says The result
of the concatenation is a new array... and the section on
appending talks about
On Monday, 26 January 2015 at 03:36:32 UTC, Gan wrote:
With Xamarin Studio I create a D project and run it. It runs an
Executable Unix file through the terminal. How can I turn that
into an Application that doesn't open the Terminal?
Thanks.
I use MonoDevelop. I haven't tried that but in
On Sunday, 25 January 2015 at 05:48:26 UTC, Vladimir Panteleev
wrote:
On my Ubuntu Server, I can't link any D program which uses
libraries other than Phobos.
Example:
//
import std.net.curl;
import std.stdio;
void main()
{
writeln(get(dlang.org));
}
On Sunday, 25 January 2015 at 12:56:14 UTC, Tobias Pankrath wrote:
On Sunday, 25 January 2015 at 12:25:35 UTC, Dominikus Dittes
Scherkl wrote:
map!(x = fn(cast(ParameterTypeTuple!fn[0])x)
but instead with
map!(paramCast!fn)
Because this is useful in more situations, e.g. in every place
I finaly got managed to install Visual D on my Windows PC (thanks
to the new community version of Visual Studio), but the cool
point Compile and Run seems to have a problem with some of my
unittests:
I get the error template instance xy is not defined if a
specific instantiation is not used
Just doing my first moves around with D and I realize that I want to
structure my tests. Wondering what you are using as a test runner / test
framework on top of plain unittest support in D itself?
So far I am ending up with adding comments into my code to structure
things:
Dominikus Dittes Scherkl:
Because this is useful in more situations,
Right, but it's still a cast. And in D you want to minimize the
number of usages of casts. The proposed syntax iota![] is
cast-safe.
Bye,
bearophile
Adam, I understood how to select URLs, but how extract values of
attributes from such selection?
a href=/ class=post-tag title=show questions tagged
'javascript' rel=somedata
I need extract data inside rel (somedata)
On 01/25/2015 11:30 AM, Gan wrote:
Here's a screenshot: http://cl.ly/image/2n282v0B1X2M
The error is: /Users/Matt/Projects/spacecraft/source/Game/Game.d(0,0):
Error: class Game.Game.Game conflicts with import Game.Game.Game at
source/Game/Game.d(2) (spacecraft)
I figure it's because I did
On Sun, 25 Jan 2015 20:42:47 +, Dominikus Dittes Scherkl wrote:
But in a function you need the cast anyway:
ubyte swapNibbles(ubyte x) { return (x4) | (x4); } // compiler not
happy
sure, it can't be happy, as `x` is promoted to int in the expression, so
the expression result is `int`.
On Sunday, 25 January 2015 at 19:15:54 UTC, ketmar wrote:
On Sun, 25 Jan 2015 08:41:24 +, Bayan Rafeh wrote:
I tried what you said and I think I see the problem. I
managed to
create an example program that duplicates the problem:
import std.stdio;
class A {
string path;
On Sunday, 25 January 2015 at 21:24:06 UTC, Suliman wrote:
I need extract data inside rel (somedata)
string s = element.rel;
On Sun, 25 Jan 2015 22:06:26 +, Bayan Rafeh wrote:
This is another problematic example program:
import std.stdio;
void main(){
auto a = new A(/tmp/invalid);
}
class A {
File f;
string path;
this(string path) {
this.path = path;
//f =
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote:
Ok, I just made up that word. But what is the difference
between appending and concatenating? Page 100 of TPDL says
The result of the concatenation is a new array... and the
section on appending talks about possibly needing
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote:
Laeeth Isharc:
I think concatenation and append are used as synonyms (the
same meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
Thanks. That
On Sun, 25 Jan 2015 22:06:26 +, Bayan Rafeh wrote:
p.s. yet creating new `File` in invariant is wrong nevertheless, as it
changes the program state. invariant checks SHOULD NEVER CHANGE THE
PROGRAM STATE.
signature.asc
Description: PGP signature
Ok, I just made up that word. But what is the difference between
appending and concatenating? Page 100 of TPDL says The result
of the concatenation is a new array... and the section on
appending talks about possibly needing expansion and reallocation
of memory.
But I still don't feel like I
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote:
Ok, I just made up that word. But what is the difference
between appending and concatenating? Page 100 of TPDL says
The result of the concatenation is a new array... and the
section on appending talks about possibly needing
Laeeth Isharc:
I think concatenation and append are used as synonyms (the same
meaning is meant). a~=b or a=a~b
a=a~b always allocates a new array, while a~=b sometimes
re-allocates in place.
Bye,
bearophile
On 1/26/2015 5:45 AM, Roman wrote:
Stuff:
1. There are C code module.c and module.h
2. MinGW
3. DMD 2.066.1
4. Window 8.1
module.c:
#include module.h
int add(int a, int b) {return a + b;}
module.h:
int add(int,int);
I want to use function add from D
so i call
cc -shared module.c -o
On 1/26/2015 11:18 AM, Mike Parker wrote:
* Compile with another compiler and run implib (part of the free Basic
Utilities Package from Digital Mars, downloadable from [1]) on the dll
to generate an import library in OMF format.
[1] http://www.digitalmars.com/download/freecompiler.html
Stuff:
1. There are C code module.c and module.h
2. MinGW
3. DMD 2.066.1
4. Window 8.1
module.c:
#include module.h
int add(int a, int b) {return a + b;}
module.h:
int add(int,int);
I want to use function add from D
so i call
cc -shared module.c -o module.dll
Then D code
main.d:
import
Here's a screenshot: http://cl.ly/image/2n282v0B1X2M
The error is:
/Users/Matt/Projects/spacecraft/source/Game/Game.d(0,0): Error:
class Game.Game.Game conflicts with import Game.Game.Game at
source/Game/Game.d(2) (spacecraft)
I figure it's because I did imports wrong or something. I'm
So, it's been about a year since you asked this. Did you ever
determine which PostgreSQL library to use? Is there one that
makes any more sense than the others?
On Sunday, 25 January 2015 at 18:59:04 UTC, ketmar wrote:
auto x2 = (x4) | (x4); // swap nibbles - but result in an
int!
this is true for C and C++ too, as all three languages doing
integer
promotion. the only difference is that D forbids potentially
lossy
assigns.
you best bet is to
On Sunday, 25 January 2015 at 15:23:03 UTC, AndyC wrote:
On Sunday, 25 January 2015 at 15:11:33 UTC, AndyC wrote:
On Sunday, 25 January 2015 at 05:48:26 UTC, Vladimir Panteleev
wrote:
On my Ubuntu Server, I can't link any D program which uses
libraries other than Phobos.
Example:
On Sunday, 25 January 2015 at 05:57:37 UTC, weaselcat wrote:
So the only difference is that proxy doesn't have implicit
conversions? Hm. Might be worth pointing out on the docs.
I don't think it is the *only* difference - the implementations
are very different - but I do think it is the most
55 matches
Mail list logo