Re: Getting backtrace

2014-01-08 Thread yazd
On Wednesday, 8 January 2014 at 20:25:28 UTC, Xavier Bigand wrote: Is there a way to get backtrace outside exceptions? If you're on Linux, you can try this library: https://github.com/yazd/backtrace-d

Re: Learning D as main systems programming language

2014-01-08 Thread Jakob Ovrum
On Thursday, 9 January 2014 at 03:36:30 UTC, Rikki Cattermole wrote: You won't have access to the GC so a lot of language features (like slices) are out of the question. Slices are fine, it's just the slice concatenation operators that must be disabled. This is easily accomplished by simply no

Re: opDispatch() is pretty damn great

2014-01-08 Thread Jakob Ovrum
On Thursday, 9 January 2014 at 00:02:00 UTC, Szymon Gatner wrote: On Wednesday, 8 January 2014 at 23:46:28 UTC, bearophile wrote: Or even: void main() { ... } Bye, bearophile Thanks, was not aware, main() was actually generated by VisualD Yeah, VisualD was guilty of propagating that poor

Re: Learning D as main systems programming language

2014-01-08 Thread Adam D. Ruppe
On Thursday, 9 January 2014 at 03:36:30 UTC, Rikki Cattermole wrote: I don't know how easy it would be to get a bootloader to call a D kernel although it has been done. Pretty easy if you use GRUB. You can just compile a regular linux program with a linker script and load it right up. My min

Re: Learning D as main systems programming language

2014-01-08 Thread Rikki Cattermole
On Wednesday, 8 January 2014 at 23:38:31 UTC, Goran Petrevski wrote: I'm new in the programming, systems programming especially, but I want to learn D more as a systems programming language and by that I mean avoiding libraries at all. My goal is to write a simple operating system totaly in D (

Re: Forward Difference Algorithm

2014-01-08 Thread Nordlöw
On Wednesday, 8 January 2014 at 19:40:34 UTC, Nordlöw wrote: Is/Are there a function(s) in `std.algorithm` or `std.range` with which to lazily compute a forward difference? I need this to differentially pack sorted elements (integers) in a range. The integers happen to be `SysTime` timestamps.

Re: opDispatch() is pretty damn great

2014-01-08 Thread Szymon Gatner
On Wednesday, 8 January 2014 at 23:46:28 UTC, bearophile wrote: Szymon Gatner: Two small improvements in your code: writeln("Base : " ~ text); => writeln("Base : ", text); int main(string[] argv) { ... return 0; } => void main(string[] argv) { ... } Or even: void main()

Re: opDispatch() is pretty damn great

2014-01-08 Thread Szymon Gatner
On Wednesday, 8 January 2014 at 23:27:37 UTC, Brad Anderson wrote: On Wednesday, 8 January 2014 at 23:20:06 UTC, Szymon Gatner wrote: Still exploring what D has to offer but this blew my mind: I don't quite understand why "enum name" part is necessary (as my understanding is that "op" is com

Re: opDispatch() is pretty damn great

2014-01-08 Thread Szymon Gatner
On Wednesday, 8 January 2014 at 23:26:26 UTC, Adam D. Ruppe wrote: On Wednesday, 8 January 2014 at 23:20:06 UTC, Szymon Gatner wrote: I don't quite understand why "enum name" part is necessary It isn't! Indeed, I don't know why it didn't compile for me the first time.

Re: opDispatch() is pretty damn great

2014-01-08 Thread bearophile
Szymon Gatner: Two small improvements in your code: writeln("Base : " ~ text); => writeln("Base : ", text); int main(string[] argv) { ... return 0; } => void main(string[] argv) { ... } Or even: void main() { ... } Bye, bearophile

Learning D as main systems programming language

2014-01-08 Thread Goran Petrevski
I'm new in the programming, systems programming especially, but I want to learn D more as a systems programming language and by that I mean avoiding libraries at all. My goal is to write a simple operating system totaly in D (using Assembly wherever is needed) and by progressing in that project

Re: opDispatch() is pretty damn great

2014-01-08 Thread Brad Anderson
On Wednesday, 8 January 2014 at 23:20:06 UTC, Szymon Gatner wrote: Still exploring what D has to offer but this blew my mind: I don't quite understand why "enum name" part is necessary (as my understanding is that "op" is compile-time constant anyway) but since I am crap at D that is what wo

Re: opDispatch() is pretty damn great

2014-01-08 Thread Adam D. Ruppe
On Wednesday, 8 January 2014 at 23:20:06 UTC, Szymon Gatner wrote: I don't quite understand why "enum name" part is necessary It isn't!

opDispatch() is pretty damn great

2014-01-08 Thread Szymon Gatner
Still exploring what D has to offer but this blew my mind: import std.stdio; struct Base { void print(string text) { writeln("Base : " ~ text); } int add(int a, int b) { return a + b; } } struct Wrap { auto opDispatch(string op, Args...)(Args args) { enum name = op;

Re: Forward Difference Algorithm

2014-01-08 Thread Ali Çehreli
On 01/08/2014 11:40 AM, "Nordlöw" wrote: Is/Are there a function(s) in `std.algorithm` or `std.range` with which to lazily compute a forward difference? I need this to differentially pack sorted elements (integers) in a range. The integers happen to be `SysTime` timestamps. There is a forward d

Re: Pure

2014-01-08 Thread Ali Çehreli
On 01/08/2014 12:20 PM, John Carter wrote: >>> Very well written, a pleasure to read. > >> And very hard to translate! :) > > Leaping off the immediate topic of computer language D into the realm > of human languages English and Turkish... > > With the Sapir–Whorf hypothesis in the back of my min

Re: Pure

2014-01-08 Thread Ali Çehreli
On 01/08/2014 11:39 AM, "Ola Fosheim Grøstad" " wrote:> On Wednesday, 8 January 2014 at 19:26:28 UTC, Ali Çehreli wrote: >> And very hard to translate! :) In case a Turkish reader is interested, >> here is the translation: >> >> http://ddili.org/makale/saflik.html > > > So, "saflik" is "pure"

Re: Getting backtrace

2014-01-08 Thread Benjamin Thaut
Am 08.01.2014 21:25, schrieb Xavier Bigand: Is there a way to get backtrace outside exceptions? On which plattform?

Re: Getting backtrace

2014-01-08 Thread Adam D. Ruppe
On Wednesday, 8 January 2014 at 20:25:28 UTC, Xavier Bigand wrote: Is there a way to get backtrace outside exceptions? Yes http://arsdnet.net/dcode/stacktrace.d works at least on linux

Getting backtrace

2014-01-08 Thread Xavier Bigand
Is there a way to get backtrace outside exceptions?

Re: Getting backtrace

2014-01-08 Thread Benjamin Thaut
Am 08.01.2014 21:25, schrieb Xavier Bigand: Is there a way to get backtrace outside exceptions? Found a plattform independend way: import core.runtime; import std.stdio; void main(string[] args) { auto trace = defaultTraceHandler(null); foreach(t; trace) {

Re: Pure

2014-01-08 Thread John Carter
> > Very well written, a pleasure to read. > And very hard to translate! :) Leaping off the immediate topic of computer language D into the realm of human languages English and Turkish... With the Sapir–Whorf hypothesis in the back of my mind... What makes it harder to translate? Is there a hu

Forward Difference Algorithm

2014-01-08 Thread Nordlöw
Is/Are there a function(s) in `std.algorithm` or `std.range` with which to lazily compute a forward difference? I need this to differentially pack sorted elements (integers) in a range. The integers happen to be `SysTime` timestamps.

Re: Pure

2014-01-08 Thread Ola Fosheim Grøstad
On Wednesday, 8 January 2014 at 19:26:28 UTC, Ali Çehreli wrote: And very hard to translate! :) In case a Turkish reader is interested, here is the translation: http://ddili.org/makale/saflik.html So, "saflik" is "pure" in turkish, cool! I like the sound of it. 8-D

Re: Pure

2014-01-08 Thread Ali Çehreli
On 01/08/2014 11:09 AM, Paolo Invernizzi wrote: > This one is a good introduction, or at least the best one I can remember: > > http://klickverbot.at/blog/2012/05/purity-in-d/ > > Very well written, a pleasure to read. And very hard to translate! :) In case a Turkish reader is interested, here

Re: Pure

2014-01-08 Thread Paolo Invernizzi
On Wednesday, 8 January 2014 at 19:04:24 UTC, John Colvin wrote: On Wednesday, 8 January 2014 at 18:40:46 UTC, Ola Fosheim Grøstad wrote: Is pure meant to be a compiler hint so that it is up to the programmer to enforce it? It is sometimes useful to maintain hidden state for lazy evaluation, th

Re: Pure

2014-01-08 Thread bearophile
Ola Fosheim Grøstad: Is pure meant to be a compiler hint so that it is up to the programmer to enforce it? Nope, it's enforced by the compiler. (But its rules are not immediately obvious, there are three kinds of purity, strong, weak and constant purity, etc). There are several corners cases

Re: Pure

2014-01-08 Thread John Colvin
On Wednesday, 8 January 2014 at 18:40:46 UTC, Ola Fosheim Grøstad wrote: Is pure meant to be a compiler hint so that it is up to the programmer to enforce it? It is sometimes useful to maintain hidden state for lazy evaluation, that does not affect purity optimizations: e.g. a = foo(1) // ev

Pure

2014-01-08 Thread Ola Fosheim Grøstad
Is pure meant to be a compiler hint so that it is up to the programmer to enforce it? It is sometimes useful to maintain hidden state for lazy evaluation, that does not affect purity optimizations: e.g. a = foo(1) // evaluates, caches and returns value b = foo(1) // returns cached value c = f

Re: Is it possible to handle 'magic' property assignments a'la PHP?

2014-01-08 Thread H. S. Teoh
On Wed, Jan 08, 2014 at 08:32:15AM +0100, Jacob Carlborg wrote: > On 2014-01-07 21:44, H. S. Teoh wrote: [...] > >I like the alias idea, so here's the revised proposal: > > > >1) Argumentless trailing-delegate syntax: > > > > // Given this declaration: > > void foo(alias dg)(); > > > >

Re: dub and ddox

2014-01-08 Thread Kelet
On Wednesday, 8 January 2014 at 09:47:03 UTC, Sönke Ludwig wrote: In that particular case (dub build --build=ddox), you can just have your own versions of the style files in your docs/styles/ folder (copy and modify from ddox/public/styles). That won't work for "dub run --build=ddox" as it will

Re: inheritance from abstract broken?

2014-01-08 Thread evilrat
On Wednesday, 8 January 2014 at 14:01:43 UTC, Gary Willoughby wrote: On Wednesday, 8 January 2014 at 12:40:39 UTC, evilrat wrote: ok. gotta using mixins :( Just use another ctor. class MyObjectA : MyObject { this(MyContext mc) { super(mc); } } i do this in template. just

Re: inheritance from abstract broken?

2014-01-08 Thread Gary Willoughby
On Wednesday, 8 January 2014 at 12:40:39 UTC, evilrat wrote: ok. gotta using mixins :( Just use another ctor. class MyObjectA : MyObject { this(MyContext mc) { super(mc); } }

Re: inheritance from abstract broken?

2014-01-08 Thread Jacob Carlborg
On 2014-01-08 13:22, evilrat wrote: Greetings everyone, i have the code where i have to keep pointers to so storage(context dependent stuff), so i tried declare abstract class with ctors and it didn't worked. --- [code] class MyContext; abstract class MyObject { // yet another bug? al

Re: inheritance from abstract broken?

2014-01-08 Thread evilrat
On Wednesday, 8 January 2014 at 12:29:48 UTC, Mike Parker wrote: On 1/8/2014 9:22 PM, evilrat wrote: Greetings everyone, i have the code where i have to keep pointers to so storage(context dependent stuff), so i tried declare abstract class with ctors and it didn't worked. --- [code] c

Re: inheritance from abstract broken?

2014-01-08 Thread Mike Parker
On 1/8/2014 9:22 PM, evilrat wrote: Greetings everyone, i have the code where i have to keep pointers to so storage(context dependent stuff), so i tried declare abstract class with ctors and it didn't worked. --- [code] class MyContext; abstract class MyObject { // yet another bug? al

inheritance from abstract broken?

2014-01-08 Thread evilrat
Greetings everyone, i have the code where i have to keep pointers to so storage(context dependent stuff), so i tried declare abstract class with ctors and it didn't worked. --- [code] class MyContext; abstract class MyObject { // yet another bug? all descendants errors no default cto

Re: dub and ddox

2014-01-08 Thread Sönke Ludwig
Am 07.01.2014 21:15, schrieb Kelet: Also, I cannot find any documentation on ddox arguments (ddoxFilterArgs). Is this currently not available? I had to look through the source code and vibe.d to figure them out. Regards, Kelet Running just "ddox filter" or "dub run ddox -- filter" will print t

Re: dub and ddox

2014-01-08 Thread Sönke Ludwig
Am 07.01.2014 21:14, schrieb Kelet: Hello, I'm working on a library, and I'm trying to write the documentation with Sönke's ddox software[1]. As I understand, it works with the Ddoc documentation format[2]. The first problem I came across is that documented unit tests weren't being converted in