Fractal generators in D?

2019-02-18 Thread Michelle Long via Digitalmars-d-learn
Are their any fractal generators in D, ideally using the GPU and possibly supporting 3D/4D generation?

Re: dub ldc error _d_array_slice_copy

2019-02-18 Thread kinke via Digitalmars-d-learn
On Monday, 18 February 2019 at 19:10:50 UTC, SrMordred wrote: dub --compiler=ldc2 //app.d:4: error: undefined reference to '_d_array_slice_copy' Dub has nothing to do with it, it's the -betterC flag, and LDC expecting that druntime function to be available for slice copies. Quick workaround:

Re: dub ldc error _d_array_slice_copy

2019-02-18 Thread SrMordred via Digitalmars-d-learn
On Monday, 18 February 2019 at 23:40:20 UTC, kinke wrote: On Monday, 18 February 2019 at 19:10:50 UTC, SrMordred wrote: dub --compiler=ldc2 //app.d:4: error: undefined reference to '_d_array_slice_copy' Dub has nothing to do with it, it's the -betterC flag, and LDC expecting that druntime

Is there a way to replace Exception with as a macro in C?

2019-02-18 Thread yisooan via Digitalmars-d-learn
I wonder there is the way as I said in the title. For instance, in C, #define indexInvalidException Exception("The index is invalid") /* Do something with the macro here */ if (false) indexInvalidException; This is allowed. But I want to do the exact same thing in D. I have already tried

Re: Is there a way to replace Exception with as a macro in C?

2019-02-18 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 19 February 2019 at 06:16:59 UTC, Mike Parker wrote: ``` Exception invalidIndexException() { throw new Exception("Index is invalid"); } Eh, that should be: void invalidIndexException() {...}

Re: Is there a way to replace Exception with as a macro in C?

2019-02-18 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 19 February 2019 at 05:50:04 UTC, yisooan wrote: This is allowed. But I want to do the exact same thing in D. I have already tried some expressions with alias? but it doesn't work. alias can't be used for expressions. Would you help me, please? There's nothing exactly

Re: Is there a way to replace Exception with as a macro in C?

2019-02-18 Thread Marco de Wild via Digitalmars-d-learn
On Tuesday, 19 February 2019 at 05:50:04 UTC, yisooan wrote: I wonder there is the way as I said in the title. For instance, in C, #define indexInvalidException Exception("The index is invalid") /* Do something with the macro here */ if (false) indexInvalidException; This is allowed. But

Re: Error with matplotlib

2019-02-18 Thread Samir via Digitalmars-d-learn
On Monday, 18 February 2019 at 21:50:25 UTC, Andre Pany wrote: In the meantime you could adapt the python script on your local file system in the dub packages cache folder as described here https://github.com/koji-kojiro/matplotlib-d/pull/11/files Andre, Thank you very much for your help

Re: Error with matplotlib

2019-02-18 Thread Andre Pany via Digitalmars-d-learn
On Monday, 18 February 2019 at 21:28:14 UTC, Samir wrote: On Monday, 18 February 2019 at 20:30:23 UTC, Andre Pany wrote: [...] Thank you for that! After installing the version of matplotlib for python2 and rerunning dub build, I now get the following error: $ dub build Performing "debug"

Re: Linux & DMD & GtkD

2019-02-18 Thread Peter Jacobs via Digitalmars-d-learn
On Monday, 18 February 2019 at 14:24:46 UTC, Ron Tarrant wrote: On Monday, 18 February 2019 at 10:38:10 UTC, Peter Jacobs wrote: Being an old linux user, I prefer make to dub, however, I do use dub to build GtkD and then I just use dmd to build my application program. This appeals to me,

Re: Linux & DMD & GtkD

2019-02-18 Thread Peter Jacobs via Digitalmars-d-learn
On Saturday, 16 February 2019 at 13:35:57 UTC, Ron Tarrant wrote: Hi guys, I finally got a Linux Mint installation happening (very impressed, BTW) and did the usual HelloWorld.d compile with dmd, but I'm having trouble working out how to link to GtkD. dmd -de -w -m64 -L+gtkd

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 18 February 2019 at 13:34:22 UTC, Ron Tarrant wrote: You've saved me a ton of time and effort. This can be interpreted as: flailing about, bashing my shell against the terminal.

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 18 February 2019 at 06:29:54 UTC, Russel Winder wrote: Hopefully the above has helped, do feel free to ask further questions. I am a day-in, day-out Debian Sid user and so may still be making assumptions tht aren't working for you… I really appreciate all the time and effort you

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 18 February 2019 at 13:55:41 UTC, Ron Tarrant wrote: But some day I shall reclaim my Super Cow Powers. :) Oh, I guess I misspelled 'seardh.' That may explain why my attempt to run aptitude was 'put out to pasture.'

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 16 February 2019 at 19:11:03 UTC, Antonio Corbi wrote: For one-file programs, dub usage is very easy. Placing a minimal comment-header between /+ +/ symbol comments, gets your job done like in this example ( I think the gtkd code is from one of your examples in the blog):

Zero length arrays in D

2019-02-18 Thread Eduard Staniloiu via Digitalmars-d-learn
Hello According to the spec[0], D supports zero length arrays [1]. I have given this a shot at https://run.dlang.io/is/PwbPxJ Attempting to use the zero-length array results in a compiler error `a.contents[2]` -> Error: array index 2 is out of bounds (*a).contents[0 .. 0] The way I've

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Sunday, 17 February 2019 at 14:19:35 UTC, Jordi Sayol wrote: To add this repository to your Linux Mint just run this two lines from command line: Jordi Thanks, Jordi. This is going straight into my notes. You've saved me a ton of time and effort.

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 18 February 2019 at 10:38:10 UTC, Peter Jacobs wrote: Being an old linux user, I prefer make to dub, however, I do use dub to build GtkD and then I just use dmd to build my application program. This appeals to me, too. dub clean dub build Got this bit working after generating

Windows Defender won't let me install DMD

2019-02-18 Thread belkin via Digitalmars-d-learn
I am trying to install the compiler and get started on learning D again ( attempted and stopped way back ) This is the error message I am getting. I am on Windows 10. Windows Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk. App:

Re: Zero length arrays in D

2019-02-18 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 18, 2019 at 01:34:37PM +, Eduard Staniloiu via Digitalmars-d-learn wrote: > Hello > > According to the spec[0], D supports zero length arrays [1]. Huh. I didn't even know D was supposed to support this. I found a few examples of this usage in Adam Ruppe's arsd code, where the

Re: DMD: can't get extern __gshared to work right (vs. LDC)

2019-02-18 Thread DanielG via Digitalmars-d-learn
In the meantime, while I'm waiting for this bug to be noticed by anybody with the skills to address it, what would be the most elegant way of working around it? Obviously I could do a: version(Windows) { export extern __gshared ... } else { extern __gshared ... } But what's the minimal

Re: Linux & DMD & GtkD

2019-02-18 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 16 February 2019 at 19:11:03 UTC, Antonio Corbi wrote: /+ dub.sdl: name "gtkhello" dflags "-dip25" "-dip1000" dependency "gtk-d:gtkd" version="~>3.8.0" +/ /* dub run --single gtkhello.d dub build --single gtkhello.d. dub gtkhello.d . */ This is

Re: DMD: can't get extern __gshared to work right (vs. LDC)

2019-02-18 Thread rikki cattermole via Digitalmars-d-learn
On 19/02/2019 6:26 AM, DanielG wrote: In the meantime, while I'm waiting for this bug to be noticed by anybody with the skills to address it, what would be the most elegant way of working around it? Obviously I could do a: version(Windows) {   export extern __gshared ... } else {   extern

Re: Error with matplotlib

2019-02-18 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 17 February 2019 at 20:19:23 UTC, Samir wrote: I am trying to run the code from the "Simple Example" listed in the matplotlib-d package page[1] and am running into the following error: [...] This dub packages enables you to call python coding from D. In this specific case

dub ldc error _d_array_slice_copy

2019-02-18 Thread SrMordred via Digitalmars-d-learn
On ubuntu: void test(size_t l) { char* a; a[0 .. l] = a[0 .. l]; } extern(C) void main(){ test(0); } ldc2 source/app.d //compiles dub --compiler=ldc2 //app.d:4: error: undefined reference to '_d_array_slice_copy'

Re: dub ldc error _d_array_slice_copy

2019-02-18 Thread SrMordred via Digitalmars-d-learn
oh, and: DUB version 1.13.0, built on Feb 17 2019 LDC - the LLVM D compiler (1.14.0): based on DMD v2.084.1 and LLVM 7.0.1

Re: Error with matplotlib

2019-02-18 Thread Samir via Digitalmars-d-learn
On Monday, 18 February 2019 at 18:27:17 UTC, Andre Pany wrote: Therefore python needs to be installed and also matplotlib.pyplot. Hi Andre, I do have both python3 and matplotlib installed: $ python3 Python 3.6.7 (default, Jan 10 2019, 01:15:48) [GCC 4.2.1 Compatible FreeBSD Clang 6.0.0

Re: Windows Defender won't let me install DMD

2019-02-18 Thread Seb via Digitalmars-d-learn
On Monday, 18 February 2019 at 16:32:26 UTC, belkin wrote: I am trying to install the compiler and get started on learning D again ( attempted and stopped way back ) This is the error message I am getting. I am on Windows 10. Windows Defender SmartScreen prevented an unrecognized app from

Re: Windows Defender won't let me install DMD

2019-02-18 Thread Samir via Digitalmars-d-learn
On Monday, 18 February 2019 at 16:32:26 UTC, belkin wrote: Obviously I need a compiler (which one is best ). I too am a beginner (both at programming and at D). I have been sticking to the dmd compiler (over others such as gdc or ldc) mainly because that is what the two reference books[1] I

Re: Windows Defender won't let me install DMD

2019-02-18 Thread Samir via Digitalmars-d-learn
On Monday, 18 February 2019 at 19:44:56 UTC, Samir wrote: that is what the two reference books[1] I am using to learn D have been using. Idiot me forgot to mention the two resources I have been using: (1) "Programming in D", by Ali Çehreli, available at http://ddili.org/ders/d.en/index.html

Re: dub ldc error _d_array_slice_copy

2019-02-18 Thread SrMordred via Digitalmars-d-learn
On Monday, 18 February 2019 at 19:14:42 UTC, SrMordred wrote: oh, and: DUB version 1.13.0, built on Feb 17 2019 LDC - the LLVM D compiler (1.14.0): based on DMD v2.084.1 and LLVM 7.0.1 Sorry, both give the same error, the problem is related to -betterC flag (which i forgot to add on first

Re: Error with matplotlib

2019-02-18 Thread Andre Pany via Digitalmars-d-learn
On Monday, 18 February 2019 at 19:24:52 UTC, Samir wrote: On Monday, 18 February 2019 at 18:27:17 UTC, Andre Pany wrote: Therefore python needs to be installed and also matplotlib.pyplot. Hi Andre, I do have both python3 and matplotlib installed: $ python3 Python 3.6.7 (default, Jan 10

Re: Error with matplotlib

2019-02-18 Thread Samir via Digitalmars-d-learn
On Monday, 18 February 2019 at 20:30:23 UTC, Andre Pany wrote: The issue is, the dub package is using python 2 (it executes application python) while you have installed matplotlib for Python 3 (application python3). Thank you for that! After installing the version of matplotlib for python2