Re: std.stdio.File.seek error

2016-03-13 Thread stunaep via Digitalmars-d-learn
It seems my lacking knowledge of C has gotten the best of me and longs in C only have a signed int range? It looks like in C, fseeko() is needed on linux and _fseeki64() is needed on windows, but I dont see either of these in stdc.stdio.

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Adam Wilson via Digitalmars-d
thedeemon wrote: On Monday, 14 March 2016 at 01:38:50 UTC, Adam Wilson wrote: Lastly, Rainer seemed to think a precise GC could be done, and he then went and did it ... so "can't reasonably have a precise collector" is a factually incorrect assertion. IIRC, Rainer called it "mostly precise",

Re: std.stdio.File.seek error

2016-03-13 Thread stunaep via Digitalmars-d-learn
On Monday, 14 March 2016 at 03:07:05 UTC, Nicholas Wilson wrote: On Monday, 14 March 2016 at 00:12:46 UTC, stunaep wrote: On Sunday, 13 March 2016 at 12:21:11 UTC, Nicholas Wilson wrote: [...] I'm on 64 bit but it needs to work on both. It works for anything between 0 and 2147483647.

Re: Where do I learn to use GtkD

2016-03-13 Thread Gerald via Digitalmars-d-learn
On Sunday, 13 March 2016 at 19:53:35 UTC, karabuta wrote: On Sunday, 13 March 2016 at 19:34:36 UTC, WebFreak001 wrote: and in the (not quite complete) documentation you can find widgets you might want to use. Its a great place for getting ideas on which widgets to use imo.

Re: Where do I learn to use GtkD

2016-03-13 Thread Gerald via Digitalmars-d-learn
On Sunday, 13 March 2016 at 19:28:57 UTC, karabuta wrote: Any help on where I can get better leaning materials(GtkD)? Repo, blogs post, etc please I starting learning both D and GTK back in October, I found that a combination of looking at an example D GtkD app, Grestful

Re: Potential GSoC project - GC improvements

2016-03-13 Thread thedeemon via Digitalmars-d
On Monday, 14 March 2016 at 01:38:50 UTC, Adam Wilson wrote: Lastly, Rainer seemed to think a precise GC could be done, and he then went and did it ... so "can't reasonably have a precise collector" is a factually incorrect assertion. IIRC, Rainer called it "mostly precise", and for a good

Re: the most D-ish GUI library

2016-03-13 Thread Gerald via Digitalmars-d
On Sunday, 13 March 2016 at 22:26:48 UTC, Saša Janiška wrote: a) dlangui (https://github.com/buggins/dlangui I've never tried it, however having been down this road before (i.e. non-native widgets) with Java Swing I have no great desire to try something in a similar vein, so that ruled it

Re: std.stdio.File.seek error

2016-03-13 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 14 March 2016 at 00:12:46 UTC, stunaep wrote: On Sunday, 13 March 2016 at 12:21:11 UTC, Nicholas Wilson wrote: On Sunday, 13 March 2016 at 10:32:41 UTC, stunaep wrote: I have a very large file I need to read data from at certain positions, but I have run into this error [...] when

Re: the most D-ish GUI library

2016-03-13 Thread thedeemon via Digitalmars-d
On Sunday, 13 March 2016 at 22:49:30 UTC, Chris Wright wrote: dlangui will be consistent on different platforms. However, what I've seen in it doesn't support antialiasing, so it's kind of ugly. DLangUI has several backends for drawing things in general (OpenGL / WinAPI / SFML / SDL...) and

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Adam Wilson via Digitalmars-d
deadalnix wrote: On Sunday, 13 March 2016 at 23:34:44 UTC, Adam Wilson wrote: Is there an implementation of a conservative moving (compacting) GC out there? I'm not aware of one, but there are a lot of GC's out there. Boehm isn't. That is impossible, you need to know what is and isn't a

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Adam Wilson via Digitalmars-d
Chris Wright wrote: On Sun, 13 Mar 2016 16:34:44 -0700, Adam Wilson wrote: Is this a debate about precise vs. non-precise GC or are we just bikeshedding about terminology and technical details? You made a large number of assertions about garbage collection and they were almost all wrong.

Re: Programming in D vs The D Programming Language

2016-03-13 Thread Ali Çehreli via Digitalmars-d-learn
On 03/13/2016 02:40 PM, Saša Janiška wrote: >> quality of the softcover by CreateSpace > Have you seen this one: > > http://www.amazon.com/gp/customer-reviews/R1WWT9EIV3UDI0/ref=cm_cr_arp_d_rvw_ttl?ie=UTF8=0692599436 Yes, I had seen that one. It is unfortunate... :-/ >> I've gone all the

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Chris Wright via Digitalmars-d
On Sun, 13 Mar 2016 16:34:44 -0700, Adam Wilson wrote: > Is this a debate about precise vs. non-precise GC or are we just > bikeshedding about terminology and technical details? You made a large number of assertions about garbage collection and they were almost all wrong. It's not about

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Chris Wright via Digitalmars-d
On Sun, 13 Mar 2016 23:46:51 +, deadalnix wrote: > On Sunday, 13 March 2016 at 23:34:44 UTC, Adam Wilson wrote: >> Is there an implementation of a conservative moving (compacting) GC out >> there? I'm not aware of one, but there are a lot of GC's out there. >> Boehm isn't. >> >> > That is

Re: std.stdio.File.seek error

2016-03-13 Thread stunaep via Digitalmars-d-learn
On Sunday, 13 March 2016 at 12:21:11 UTC, Nicholas Wilson wrote: On Sunday, 13 March 2016 at 10:32:41 UTC, stunaep wrote: I have a very large file I need to read data from at certain positions, but I have run into this error std.conv.ConvOverflowException@std\conv.d(1328): Conversion positive

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread anonymous via Digitalmars-d-learn
On Sunday, 13 March 2016 at 22:34:54 UTC, Chris Wright wrote: In theory, it can't be modified. As a practical matter, unions and casts will allow people to modify it. Saying that it *can't* be modified is slightly besides the point, yeah. It *must* not be modified. Casting away const and then

Re: Potential GSoC project - GC improvements

2016-03-13 Thread deadalnix via Digitalmars-d
On Sunday, 13 March 2016 at 23:34:44 UTC, Adam Wilson wrote: Is there an implementation of a conservative moving (compacting) GC out there? I'm not aware of one, but there are a lot of GC's out there. Boehm isn't. That is impossible, you need to know what is and isn't a pointer to be able

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Adam Wilson via Digitalmars-d
Chris Wright wrote: On Sun, 13 Mar 2016 12:43:37 -0700, Adam Wilson wrote: A "partially moving" GC does not exist, as far as I know. Yep, it's a Bad Idea. It's not a standard term. Google's only seeing about four references to the term, none of them authoritative or definitive. Since it's

Re: the most D-ish GUI library

2016-03-13 Thread FreeSlave via Digitalmars-d
On Sunday, 13 March 2016 at 22:26:48 UTC, Saša Janiška wrote: Hello, After long pause and trying some other languages, I've decided to try (again) with D for writing open-source multi-platform desktop (GUI) application. I've selected three different libraries: a) dlangui

Re: the most D-ish GUI library

2016-03-13 Thread Chris Wright via Digitalmars-d
On Sun, 13 Mar 2016 23:26:48 +0100, Saša Janiška wrote: > which of > the above mentioned libraries are the most D-ish in sense to provide > things like more D-idiomatic API, properly taking care about memory > management I'm guessing dlangui will be best here, but GtkD is pretty good. > (in

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread Chris Wright via Digitalmars-d-learn
On Sun, 13 Mar 2016 21:14:59 +, anonymous wrote: > On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: >> ref const(Array!Type) view(){} >> >> Unless the result is explicitly cast later it can't me modified. > > No, it can't be modified, period. Casting away const and then mutating >

Re: the most D-ish GUI library

2016-03-13 Thread WebFreak001 via Digitalmars-d
On Sunday, 13 March 2016 at 22:26:48 UTC, Saša Janiška wrote: a) dlangui (https://github.com/buggins/dlangui b) GtkD (https://github.com/gtkd-developers/GtkD and c) tkd (https://github.com/nomad-software/tkd) I prefer GtkD, its the most system native one on linux and its well tested as its

the most D-ish GUI library

2016-03-13 Thread Saša Janiška via Digitalmars-d
Hello, After long pause and trying some other languages, I've decided to try (again) with D for writing open-source multi-platform desktop (GUI) application. I've selected three different libraries: a) dlangui (https://github.com/buggins/dlangui b) GtkD (https://github.com/gtkd-developers/GtkD

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Chris Wright via Digitalmars-d
On Sun, 13 Mar 2016 12:43:37 -0700, Adam Wilson wrote: >> A "partially moving" GC does not exist, as far as I know. >> >> > Yep, it's a Bad Idea. It's not a standard term. Google's only seeing about four references to the term, none of them authoritative or definitive. Since it's non- standard,

Re: Programming in D vs The D Programming Language

2016-03-13 Thread Saša Janiška via Digitalmars-d-learn
Ali Çehreli writes: > You may find that D has changed since TDPL was printed but it's still > a great read. In some places it explains tradeoffs in language design > in general. Yeah, I like, based on what I've seen some portions which explains 'why'. > PiD starts as a

Re: Is D a good choice for embedding python/octave/julia

2016-03-13 Thread Laeeth Isharc via Digitalmars-d-learn
On Sunday, 13 March 2016 at 18:42:59 UTC, Bastien wrote: The sticking point is unless I commit the rest of my life to maintaining this software, I can't write it all in D. The algorithms change/are improved yearly; the output format from the instrument changes once in a while and therefore

Re: Pitching D to a gang of Gophers

2016-03-13 Thread cym13 via Digitalmars-d
On Sunday, 13 March 2016 at 21:16:45 UTC, Dmitry Olshansky wrote: On 13-Mar-2016 22:13, kdmult wrote: On Saturday, 12 March 2016 at 08:09:41 UTC, Dmitry Olshansky wrote: On 05-Mar-2016 14:05, Dmitry Olshansky wrote: Obligatory slides: http://slides.com/dmitryolshansky/deck/fullscreen/ There

Re: Pitching D to a gang of Gophers

2016-03-13 Thread Dmitry Olshansky via Digitalmars-d
On 13-Mar-2016 22:13, kdmult wrote: On Saturday, 12 March 2016 at 08:09:41 UTC, Dmitry Olshansky wrote: On 05-Mar-2016 14:05, Dmitry Olshansky wrote: Obligatory slides: http://slides.com/dmitryolshansky/deck/fullscreen/ There are 2 bugs in

running D on AWS lambda

2016-03-13 Thread Laeeth Isharc via Digitalmars-d-announce
http://awslambda-d.readthedocs.org/ http://code.dlang.org/packages/awslambda_d https://github.com/kaleidicpublic/awslambda_d AWS Lambda is a 'compute service that runs your code in response to events and automatically manages the new compute resources for you, making it easy to build

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread anonymous via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: ref const(Array!Type) view(){} Unless the result is explicitly cast later it can't me modified. No, it can't be modified, period. Casting away const and then mutating is not allowed, it has undefined behavior.

Re: How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:16:36 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 16:28:50 UTC, Iakh wrote: On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:28:33 UTC, JR wrote: On Sunday, 13 March 2016 at 20:13:03 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: [...] Basile beat me to it. Yes, ref const(Array!T) accessor. http://dpaste.dzfl.pl/cb2bc5cf9917 Thank you very much,

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread JR via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:13:03 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: [...] Basile beat me to it. Yes, ref const(Array!T) accessor. http://dpaste.dzfl.pl/cb2bc5cf9917

Re: Pattern matching as a library

2016-03-13 Thread Jacob Carlborg via Digitalmars-d
On 13/03/16 03:33, Simen Kjaeraas wrote: The match function goes through the list of patterns and for each one asks the tuple if opMatch returns true for that pattern. If it does, the function assigned that pattern is called with the values assigned to args. opMatch here is checking for each

Re: How to list all version identifiers?

2016-03-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 March 2016 at 16:28:50 UTC, Iakh wrote: On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will try. But it was a joke actually. It works but this is not

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: Unless the result is explicitly cast later it can't me modified. import std.stdio, std.container.array; struct Foo { private Array!int arr; ref const(Array!int) view() { return arr; } } void main(string[]

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 March 2016 at 19:37:42 UTC, ParticlePeter wrote: I have a struct that privately warps an std.container.array. I would like to return a read-only reference of this array, it should not be duplicated. How can I do this? Cheers, ParticlePeter ref const(Array!Type) view(){}

Re: My whereabouts

2016-03-13 Thread crimaniak via Digitalmars-d
On Friday, 11 March 2016 at 08:25:12 UTC, Nordlöw wrote: On Thursday, 10 March 2016 at 15:25:54 UTC, Andrei Alexandrescu wrote: What ever happened to that Big O library you were writing? Does this mean the container-library? If so what does the "Big O" stand for? Thread related:

Re: Where do I learn to use GtkD

2016-03-13 Thread karabuta via Digitalmars-d-learn
On Sunday, 13 March 2016 at 19:34:36 UTC, WebFreak001 wrote: On Sunday, 13 March 2016 at 19:28:57 UTC, karabuta wrote: Any help on where I can get better leaning materials(GtkD)? Repo, blogs post, etc please there isn't much about GtkD specificly, but as a start there is this:

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Adam Wilson via Digitalmars-d
Chris Wright wrote: On Sat, 12 Mar 2016 13:23:35 -0800, Adam Wilson wrote: To start off, let's talk terminology. You seem to be using nonstandard terminology and possibly misunderstanding standard terminology. A GC scan is the mark phase of a mark/sweep collector (and specifically the part

How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread ParticlePeter via Digitalmars-d-learn
I have a struct that privately warps an std.container.array. I would like to return a read-only reference of this array, it should not be duplicated. How can I do this? Cheers, ParticlePeter

Re: Where do I learn to use GtkD

2016-03-13 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 19:28:57 UTC, karabuta wrote: Any help on where I can get better leaning materials(GtkD)? Repo, blogs post, etc please there isn't much about GtkD specificly, but as a start there is this: https://sites.google.com/site/gtkdtutorial/ If you get the basics from

[Issue 15353] std.experimental.allocator cannot free memory in its destructor if the GC is an ancestor

2016-03-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15353 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 15353] std.experimental.allocator cannot free memory in its destructor if the GC is an ancestor

2016-03-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15353 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/1113bf1476ca66bac8a25bea4598daf6fb4bd598 fix Issue 15353 -

Where do I learn to use GtkD

2016-03-13 Thread karabuta via Digitalmars-d-learn
Gtk3 from python3 has got I nice book with examples that are not so advanced but enough to get you doing real work(from a beginner point of view). GtkD seem to have changed the API structure compared to python3 Gtk3 and the demo examples just "show-off" IMO :). The documentation is really^ not

Re: Pitching D to a gang of Gophers

2016-03-13 Thread kdmult via Digitalmars-d
On Saturday, 12 March 2016 at 08:09:41 UTC, Dmitry Olshansky wrote: On 05-Mar-2016 14:05, Dmitry Olshansky wrote: Obligatory slides: http://slides.com/dmitryolshansky/deck/fullscreen/ There are 2 bugs in http://slides.com/dmitryolshansky/deck/fullscreen/#/4/1 --- zzz0.d 2016-03-13

Re: Is D a good choice for embedding python/octave/julia

2016-03-13 Thread Bastien via Digitalmars-d-learn
On Sunday, 13 March 2016 at 18:12:07 UTC, cym13 wrote: On Sunday, 13 March 2016 at 13:02:16 UTC, Bastien wrote: Hi, apologies for what may be a fairly obvious question to some. ## The background: I have been tasked with building software to process data output by scientific instruments for

Re: Pattern matching as a library

2016-03-13 Thread Simen Kjaeraas via Digitalmars-d
On Sunday, 13 March 2016 at 02:33:49 UTC, Simen Kjaeraas wrote: http://dpaste.dzfl.pl/7360ee90b344 Dammit, 3:30AM was apparently too late, and some bad code leaked through. I managed to sidestep a problem by writing nonsense code. The problem I get can be reduced to this: struct S {

[Issue 15794] New: Lambda mangled differently after being passed as template argument

2016-03-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15794 Issue ID: 15794 Summary: Lambda mangled differently after being passed as template argument Product: D Version: D2 Hardware: x86_64 OS: Windows

Re: Is D a good choice for embedding python/octave/julia

2016-03-13 Thread cym13 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 13:02:16 UTC, Bastien wrote: Hi, apologies for what may be a fairly obvious question to some. ## The background: I have been tasked with building software to process data output by scientific instruments for non-experts - basically with GUI, menus, easy config

Re: Get address of object in constructor.

2016-03-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 13 March 2016 at 16:16:55 UTC, MGW wrote: void* thisAddr = cast(void*) This doesn't really make sense anyway, this is a local variable, you want to do cast(void*) this in a class if you need the address (which btw, you shouldn't actually, the reference itself ought to be enough)

Re: Potential GSoC project - GC improvements

2016-03-13 Thread Dmitry Olshansky via Digitalmars-d
On 11-Mar-2016 18:13, Jeremy DeHaan wrote: Thank you all for the feedback. I think I might still need a little more feedback as to what the project should actually entail, but here's what it's looking like so far: Implement lock free allocation using std.experimental.allocator's freelists

Re: Pitching D to a gang of Gophers

2016-03-13 Thread Dmitry Olshansky via Digitalmars-d
On 12-Mar-2016 11:56, Russel Winder via Digitalmars-d wrote: On Sat, 2016-03-12 at 11:09 +0300, Dmitry Olshansky via Digitalmars-d wrote: On 05-Mar-2016 14:05, Dmitry Olshansky wrote: I'm having an opportunity to do a small tech-talk on things D in a eCommerce shop that is currently sold on

Re: Programming in D vs The D Programming Language

2016-03-13 Thread Ali Çehreli via Digitalmars-d-learn
On 03/13/2016 09:27 AM, gour wrote: > a) how much is Andrei's book still relevant? You may find that D has changed since TDPL was printed but it's still a great read. In some places it explains tradeoffs in language design in general. > b) whether PiD is recommended one to start with D

Re: GSoC

2016-03-13 Thread Rainer Schuetze via Digitalmars-d-debugger
You probably have noticed by now, but just in case: you have posted to a very specialized forum that not a lot of people monitor. You might want to repost on the general forum: https://forum.dlang.org/group/general On 11.03.2016 21:52, Saurabh Mishra via Digitalmars-d-debugger wrote: I am

[Issue 15793] Change !is error to warning

2016-03-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15793 Steven Schveighoffer changed: What|Removed |Added CC|

Re: Programming in D vs The D Programming Language

2016-03-13 Thread _d0s_ via Digitalmars-d-learn
On Sunday, 13 March 2016 at 16:27:07 UTC, gour wrote: Hello, after quite some time I'm returning to D being fed up with some other languages to become more ready for writing open-source multi-platform desktop app(s)... I already own copy of Andrei's The D Programming Language book, but

Re: Is D a good choice for embedding python/octave/julia

2016-03-13 Thread Chris Wright via Digitalmars-d-learn
On Sun, 13 Mar 2016 13:02:16 +, Bastien wrote: > The sticking point is unless I commit the rest of my life to maintaining > this software, I can't write it all in D. The algorithms change/are > improved yearly; the output format from the instrument changes once in a > while and therefore these

Re: Creating template libraries from C++/Boost template libraries

2016-03-13 Thread Chris Wright via Digitalmars-d
On Sun, 13 Mar 2016 12:11:12 +, Lyle Moffitt wrote: > is it > possible to specialize this template for a C++API version of D's Object That idea would work. You probably need to define your own base class as extern(C++), though. On the plus side, that lets you add whatever you want to the

Re: How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will try.

Programming in D vs The D Programming Language

2016-03-13 Thread gour via Digitalmars-d-learn
Hello, after quite some time I'm returning to D being fed up with some other languages to become more ready for writing open-source multi-platform desktop app(s)... I already own copy of Andrei's The D Programming Language book, but never went fully through it, but I see in the meantime

Re: Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
On Sunday, 13 March 2016 at 16:02:07 UTC, WebFreak001 wrote: However note that this is not the same as that function. cast(void*)this and are 2 different things. So if you want to do the same as saveThis just do void* thisAddr = cast(void*) instead void* thisAddr = cast(void*) Error

Re: Is D a good choice for embedding python/octave/julia

2016-03-13 Thread Lass Safin via Digitalmars-d-learn
On Sunday, 13 March 2016 at 13:02:16 UTC, Bastien wrote: Hi, apologies for what may be a fairly obvious question to some. ## The background: I have been tasked with building software to process data output by scientific instruments for non-experts - basically with GUI, menus, easy config

Re: D vs Rust

2016-03-13 Thread gour via Digitalmars-d
On Saturday, 30 January 2016 at 20:48:01 UTC, bearophile wrote: Hello bearophile, In Ada you can be productive if you use it for the purposes it was invented for, but most times you don't write that kind of code. I miss some Ada features, and I've missed the strictness of the Ada compiler

Re: Get address of object in constructor.

2016-03-13 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:43:02 UTC, MGW wrote: Cfoo foo = new Cfoo(); foo.saveThis(); However note that this is not the same as that function. cast(void*)this and are 2 different things. So if you want to do the same as saveThis just do void* thisAddr = cast(void*) instead

Re: Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:49:20 UTC, WebFreak001 wrote: On Sunday, 13 March 2016 at 15:43:02 UTC, MGW wrote: I want to get address of object Cfoo in constructor. Whether it is possible? class Cfoo { void* adrThis; this() { adrThis = cast(void*) this;

Re: How to list all version identifiers?

2016-03-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:15:22 UTC, Iakh wrote: There is trick for gcc: gcc -dM -E - < /dev/null It shows all default #defines Is there way to show all version identifiers for D? For all or any compiler you know trivial answer, let's say you have dcd-server running in the background:

Re: Get address of object in constructor.

2016-03-13 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:43:02 UTC, MGW wrote: I want to get address of object Cfoo in constructor. Whether it is possible? class Cfoo { void* adrThis; this() { adrThis = cast(void*) this; } } ... Cfoo foo = new Cfoo(); "this" should work (pun

Get address of object in constructor.

2016-03-13 Thread MGW via Digitalmars-d-learn
I want to get address of object Cfoo in constructor. Whether it is possible? now: - class Cfoo { void* adrThis; void saveThis(void* adr) { adrThis = adr; } } ... Cfoo foo = new Cfoo(); foo.saveThis(); shall be -- class Cfoo { void* adrThis;

Re: In D, lexically, which are the chars that can follow $, exactly ?

2016-03-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 March 2016 at 14:55:36 UTC, Marc Schütz wrote: On Sunday, 13 March 2016 at 14:07:31 UTC, Basile B. wrote: '$' is only valid in an indexExpression (https://dlang.org/spec/grammar.html#IndexExpression), so it can only be followed by - ' ' - ']' - operators , usually '-' but also

How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
There is trick for gcc: gcc -dM -E - < /dev/null It shows all default #defines Is there way to show all version identifiers for D? For all or any compiler you know

Re: In D, lexically, which are the chars that can follow $, exactly ?

2016-03-13 Thread Marc Schütz via Digitalmars-d-learn
On Sunday, 13 March 2016 at 14:07:31 UTC, Basile B. wrote: '$' is only valid in an indexExpression (https://dlang.org/spec/grammar.html#IndexExpression), so it can only be followed by - ' ' - ']' - operators , usually '-' but also '/', '+', '>>' etc Is that right ? I'd like to relax the

Re: Clearing associative array.

2016-03-13 Thread ciechowoj via Digitalmars-d-learn
On Sunday, 13 March 2016 at 13:42:02 UTC, cym13 wrote: The problem was brought up a few days ago (can't remember where) and it happens to be a documentation mistake: there is a clear() method planned but for a future release (the next one?). That would be great : )

Re: Is there a sorted map?

2016-03-13 Thread cym13 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 14:11:14 UTC, Anonymouse wrote: On Sunday, 13 March 2016 at 13:44:35 UTC, cym13 wrote: Note that implementing an (admitedly not perfect) ordered associative array yourself really isn't much work: https://github.com/cym13/miscD/blob/master/ordered_aa.d Unsigned

Re: Is there a sorted map?

2016-03-13 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 13 March 2016 at 13:44:35 UTC, cym13 wrote: Note that implementing an (admitedly not perfect) ordered associative array yourself really isn't much work: https://github.com/cym13/miscD/blob/master/ordered_aa.d Unsigned integer comparison with -1 in the remove function, by the way.

In D, lexically, which are the chars that can follow $, exactly ?

2016-03-13 Thread Basile B. via Digitalmars-d-learn
'$' is only valid in an indexExpression (https://dlang.org/spec/grammar.html#IndexExpression), so it can only be followed by - ' ' - ']' - operators , usually '-' but also '/', '+', '>>' etc Is that right ? I'd like to relax the lexical rule for C.E static macros which currently is -

Re: Filling an array

2016-03-13 Thread user42 via Digitalmars-d-learn
On Saturday, 12 March 2016 at 18:33:16 UTC, Alex wrote: On Saturday, 12 March 2016 at 16:37:25 UTC, user42 wrote: On Saturday, 12 March 2016 at 14:33:19 UTC, Alex wrote: /snip I thought this was supposed to halt with an error rather than compile and set all members to 1. The syntax, to me

Re: Is there a sorted map?

2016-03-13 Thread cym13 via Digitalmars-d-learn
On Sunday, 13 March 2016 at 10:06:24 UTC, stunaep wrote: On Sunday, 13 March 2016 at 08:33:43 UTC, Jonathan M Davis wrote: On Sunday, March 13, 2016 02:35:27 stunaep via Digitalmars-d-learn wrote: [...] The closest that we have in Phobos at the moment is RedBlackTree in std.container. Its

Re: Clearing associative array.

2016-03-13 Thread cym13 via Digitalmars-d-learn
On Saturday, 12 March 2016 at 12:59:02 UTC, ciechowoj wrote: On Saturday, 12 March 2016 at 12:42:04 UTC, Adam D. Ruppe wrote: On Saturday, 12 March 2016 at 12:34:16 UTC, ciechowoj wrote: If above doesn't work how am I supposed to clear the array? `x = string[string].init;` is somewhat ugly.

[Issue 7361] No documentation for front tuple expansion in foreach over range

2016-03-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7361 Nick Treleaven changed: What|Removed |Added CC|

Gdmd compiling error

2016-03-13 Thread Orkhan via Digitalmars-d-learn
Hello. I need your help ! I am struggling to compile and install ca Xcom server files which is using gdmd . It is in linux system , and when I type make command it returns error like: /bin/sh: 1: gdmd: not found Makefile:35: recipe for target 'protocol-daemon' failed make:

Is D a good choice for embedding python/octave/julia

2016-03-13 Thread Bastien via Digitalmars-d-learn
Hi, apologies for what may be a fairly obvious question to some. ## The background: I have been tasked with building software to process data output by scientific instruments for non-experts - basically with GUI, menus, easy config files (JSON or similar) - and the ability to do some serious

Re: std.stdio.File.seek error

2016-03-13 Thread Nicholas Wilson via Digitalmars-d-learn
f.seek(173445340 , SEEK_SET); f.seek(173445340 , SEEK_REL); oops that should be 3173445340.

Re: std.stdio.File.seek error

2016-03-13 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 13 March 2016 at 10:32:41 UTC, stunaep wrote: I have a very large file I need to read data from at certain positions, but I have run into this error std.conv.ConvOverflowException@std\conv.d(1328): Conversion positive overflow when seeking to 6346890680. Seeking to smaller values

Creating template libraries from C++/Boost template libraries

2016-03-13 Thread Lyle Moffitt via Digitalmars-d
I recently discovered D and absolutely love it. However, I feel like I can't really be productive with it yet because of the profound lack of libraries. I understand that linking to C libraries is trivial and linking to C++ libraries is possible (eventually easy with tools like LDC'c

std.stdio.File.seek error

2016-03-13 Thread stunaep via Digitalmars-d-learn
I have a very large file I need to read data from at certain positions, but I have run into this error std.conv.ConvOverflowException@std\conv.d(1328): Conversion positive overflow when seeking to 6346890680. Seeking to smaller values such as 3580720 work with no problem. The file is well over

Re: Is there a sorted map?

2016-03-13 Thread stunaep via Digitalmars-d-learn
On Sunday, 13 March 2016 at 08:33:43 UTC, Jonathan M Davis wrote: On Sunday, March 13, 2016 02:35:27 stunaep via Digitalmars-d-learn wrote: [...] The closest that we have in Phobos at the moment is RedBlackTree in std.container. Its API is geared towards sets, not maps, but you can get it

Re: Is there a sorted map?

2016-03-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 13, 2016 02:35:27 stunaep via Digitalmars-d-learn wrote: > Is there any sorted map in D? I need a map and I need to be able > to get the highest key in the map. In java I would use a TreeMap > and use map.lastKey(), but since associative arrays are not > sorted that would be O(n).