Am 09.01.2012 22:08, schrieb Manfred Nowak:
dennis luehring wrote:
why is there an exception/error neeeded if missing?
Exceptions or errors are not _needed_.
Their existence stems from the modell under which the user of the
operation _has_ to think about the operation, especially whether it
Hi Alex,
Thanks for the answer.
As for the allocation, you mention malloc: is that malloc from the C
runtime library? You also imply alternatives to this allocator; what would
these be?
As for deletion, does on then invoke delete on the malloc'ed data pointer?
Pointing me to some example woul
On Monday, 9 January 2012 at 13:41:08 UTC, hope wrote:
http://www.digitalmars.com/d/archives/digitalmars/D/announce/Learning_With_D_20566.html
any new news about it?
it is a very nice tutorial
Hi, it is still on my plate, but hasn't seen a lot of progress.
One major point is that I don't ex
On Monday, 9 January 2012 at 15:05:53 UTC, Joshua Reusch wrote:
Hello,
I checked out the phobos git repo and found a std.csv module.
Is it ready to use or should I stay to my own (but incomplete
and whithout any "good" error messages) csv reading function ?
Thank you
Yep, no known reason it
On Tuesday, January 10, 2012 03:55:35 Jesse Phillips wrote:
> Maybe I missed something, but the last I knew Safe D is not
> completely implemented. I think checking that you don't call
> system functions is the only piece implemented, and Phobos isn't
> annotated with it.
Yeah. I'm not sure how we
Maybe I missed something, but the last I knew Safe D is not
completely implemented. I think checking that you don't call
system functions is the only piece implemented, and Phobos isn't
annotated with it.
Scratch that, in X11 apparently the Display structure is an incomplete
type (so sizeof won't work). This means you most probably *have* to
use pass it around as an opaque pointer. It's kind of odd because you
can still access some of its fields (so it's not totally opaque), but
you can't do copies.
On 01/10/12 01:02, bioinfornatics wrote:
> Dear i do not understand why the first example works and the second
> segfault. Thanks
>
> EXAMPLE 1 ---
Display* display = XOpenDisplay(getenv("DISPLAY"));
> char** fonts = XListFonts( display, pattern.dup.ptr,
Jesus christ, sorry about that my keyboard script went crazy and posted that.
What I was going to say is it's likely a mismatch of the struct sizes.
In the second example you are dereferencing the pointer on the D size,
which does a field-by-field copy of the pointed-to struct. But D will
only rea
It's likely a module Gmail - Problem with interfacing C code to D -
Mozilla Firefo;
import std.algorithm;
import std.array;
import std.stdio;
void main()
{
}
On 1/10/12, bioinfornatics wrote:
> Le mardi 10 janvier 2012 à 01:26 +0100, Trass3r a écrit :
>> What's the definition of Display?
>
>
Le mardi 10 janvier 2012 à 01:26 +0100, Trass3r a écrit :
> What's the definition of Display?
This one:
_
struct _XDisplay{
XExtData* ext_data; /* hook for
extension to hang data */
_XPrivate* private1;
What's the definition of Display?
Dear i do not understand why the first example works and the second
segfault. Thanks
EXAMPLE 1 ---
// ldc2 -L=/usr/lib64/libXlib.so -L-lX11 -g -w xtest.d
import std.string;
import std.stdio;
import std.conv;
import std.c.stdlib : getenv;
import std.exception : Exce
On Mon, 09 Jan 2012 22:33:28 +0100, Juan Campanas wrote:
On Monday, 9 January 2012 at 21:14:05 UTC, Robert Clipsham wrote:
Are exceptions in safe D possible? I started trying to make my code
@safe (there's no reason why it can't be as far as I'm aware), but I
hit the following issue:
Hello,
I need to connect to a network location and read a file but I also need
some way of waiting around until the connection is established. Currently
I use the following snippet to do this:
while (!std.file.exists("/Volumes/mountedDir/myfile.txt") && timeout < 30)
{
core.thread.Thread
On Monday, 9 January 2012 at 21:14:05 UTC, Robert Clipsham wrote:
Are exceptions in safe D possible? I started trying to make my
code @safe (there's no reason why it can't be as far as I'm
aware), but I hit the following issue:
@safe
class MyException : Exception
{
this()
{
Are exceptions in safe D possible? I started trying to make my code
@safe (there's no reason why it can't be as far as I'm aware), but I hit
the following issue:
@safe
class MyException : Exception
{
this()
{
super("");
}
}
void main()
{
throw new MyException("");
dennis luehring wrote:
> why is there an exception/error neeeded if missing?
Exceptions or errors are not _needed_.
Their existence stems from the modell under which the user of the
operation _has_ to think about the operation, especially whether it
is
a:only the outcome of the operation or
On 09-01-2012 20:41, Adrian Mercieca wrote:
Hi,
Can someone please provide an example regarding overloading new and delete
for a class?
Thanks a lot.
This is deprecated.
What you should be doing is using std.conv.emplace() with whatever
allocator (say, malloc()) you wish to use.
- Alex
On 1/9/12, Steven Schveighoffer wrote:
> Could this be you?
Ah, yes. I didn't even notice you've replied to that, sorry. Yes, I'm
ok with it.
On Mon, 09 Jan 2012 14:57:36 -0500, Andrej Mitrovic
wrote:
Ok, allow me to temporarily hijack again and ask: Would you mind
adding opIn_r (or rather the newer opBinaryRight with "in") that
forwards to contains() for the HashSet and similar hash-based classes
that define contains()? It would m
Ok, allow me to temporarily hijack again and ask: Would you mind
adding opIn_r (or rather the newer opBinaryRight with "in") that
forwards to contains() for the HashSet and similar hash-based classes
that define contains()? It would make porting code that uses builtin
hashes to your own implementat
On 01/09/2012 05:41 AM, hope wrote:
http://www.digitalmars.com/d/archives/digitalmars/D/announce/Learning_With_D_20566.html
any new news about it?
it is a very nice tutorial
I hope it has actually grown but we haven't heard the news yet! :)
On a related note, I am continuing to translate my
Hi,
Can someone please provide an example regarding overloading new and delete
for a class?
Thanks a lot.
On Mon, 09 Jan 2012 13:35:26 -0500, Andrej Mitrovic
wrote:
On 1/9/12, Steven Schveighoffer wrote:
BTW, dcollections' HashMap, HashSet, and HashMultiset do guarantee that
adding elements does not invalidated cursors (dcollections' safe version
of pointers) as long as you use the default Hash
On 1/9/12, Steven Schveighoffer wrote:
> BTW, dcollections' HashMap, HashSet, and HashMultiset do guarantee that
> adding elements does not invalidated cursors (dcollections' safe version
> of pointers) as long as you use the default Hash implementation. However,
> I just noticed this is not stat
Am 09.01.2012 16:19, schrieb simendsjo:
On 09.01.2012 16:05, Joshua Reusch wrote:
Hello,
I checked out the phobos git repo and found a std.csv module.
Is it ready to use or should I stay to my own (but incomplete and
whithout any "good" error messages) csv reading function ?
Thank you
It sho
Sweeet, thanks Joshua!
On 1/9/12, Joshua Reusch wrote:
> Am 09.01.2012 18:00, schrieb Andrej Mitrovic:
>> I need to get the name of the executable but without using a string[]
>> from main. I'm wrapping a 3rd party library that requires me to
>> initialize it by calling an extern function to pass
On Monday, January 09, 2012 09:25:14 Steven Schveighoffer wrote:
> Actually, not invalid for the current implementation. I don't know if
> it's stated whether an AA specifically requires that elements do not
> re-associate on a rehash.
Well, like I said, it depends on the current implementation. T
Am 09.01.2012 18:00, schrieb Andrej Mitrovic:
I need to get the name of the executable but without using a string[]
from main. I'm wrapping a 3rd party library that requires me to
initialize it by calling an extern function to pass the executable
name.
However I don't want to force the user to p
I need to get the name of the executable but without using a string[]
from main. I'm wrapping a 3rd party library that requires me to
initialize it by calling an extern function to pass the executable
name.
However I don't want to force the user to pass args from main when
constructing a class, so
On 09.01.2012 16:05, Joshua Reusch wrote:
Hello,
I checked out the phobos git repo and found a std.csv module.
Is it ready to use or should I stay to my own (but incomplete and
whithout any "good" error messages) csv reading function ?
Thank you
It should be ready for production work, but if
On Mon, 09 Jan 2012 09:27:06 -0500, bearophile
wrote:
Steven Schveighoffer:
With new => syntax (in git head), this would probably be:
@property ref tile => map[y*w+x];
That's not currently supported:
http://d.puremagic.com/issues/show_bug.cgi?id=7176
The given function is not a method,
Hello,
I checked out the phobos git repo and found a std.csv module.
Is it ready to use or should I stay to my own (but incomplete and
whithout any "good" error messages) csv reading function ?
Thank you
Steven Schveighoffer:
> With new => syntax (in git head), this would probably be:
>
> @property ref tile => map[y*w+x];
That's not currently supported:
http://d.puremagic.com/issues/show_bug.cgi?id=7176
Bye,
bearophile
On Sun, 08 Jan 2012 08:40:27 -0500, Jonathan M Davis
wrote:
On Sunday, January 08, 2012 14:24:32 simendsjo wrote:
Thanks for your clarifications.
Does this mean even this is undefined?
aa["a"] = new C();
auto c = "a" in aa;
aa["b"] = new C();
// Using c here is undefined as an element was a
On Sun, 08 Jan 2012 12:54:13 -0500, Ben Davis wrote:
Hi,
Is there a reason 'ref' is disallowed for local variables? I want to
write something like:
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
My actual case is more complicated, so in
http://www.digitalmars.com/d/archives/digitalmars/D/announce/Learning_With_D_20566.html
any new news about it?
it is a very nice tutorial
On 05/01/2012 05:26, Andrej Mitrovic wrote:
The first call doesn't do anything because the delegate is wrapped
inside of another delegate. I want this template to be versatile
enough to be used by both lazy expressions and delegate literals, but
I don't know how.
If you have a delegate you wa
assert(key in aa);
aa.remove(key);
So, as far as I can tell, the current situation is more efficient, and it
doesn't cost you any expressiveness. You can still have an exception thrown
when remove fails if you use enforce before the call if you want an exception
thrown when the element isn't ther
Looks like this is fixed for 2.058.
https://github.com/D-Programming-Language/dmd/commit/3e23b0f5834acb32eaee20d88c30ead7e03bb2f4
On 08/01/2012 3:43 AM, Jonathan M Davis wrote:
On Sunday, January 08, 2012 03:24:22 Kapps wrote:
Ah, found the bug / pull request.
https://github.com/D-Programming
41 matches
Mail list logo