Dynamically Sized Structs

2014-04-16 Thread Jeroen Bollen
Is it possible to have a structure with a dynamic size? The structure would contain an array. I know I can use templates, but the size won't be known at compile time. I also know I could just put a dynamic array into it, but that way it would just be a pointer. I know there would be major is

Re: Extern Keyword for Function Type

2014-04-15 Thread Jeroen Bollen
On Tuesday, 15 April 2014 at 20:19:36 UTC, Dicebot wrote: C has no knowledge of D ABI so this can't work. If you just want to store D function pointer to later retrieve it and call from D code, you can as well store it as void* (or extern(C) with similar signature to preserve part of type) and

Re: Extern Keyword for Function Type

2014-04-15 Thread Jeroen Bollen
On Tuesday, 15 April 2014 at 20:15:42 UTC, Jeroen Bollen wrote: exten(C) { testFunction(int function(int)); } testFunction now requires an external function as parameter. It can't be called with a pointer to a D function. Logical Solution: extern(C) { testFunction(extern(D

Extern Keyword for Function Type

2014-04-15 Thread Jeroen Bollen
exten(C) { testFunction(int function(int)); } testFunction now requires an external function as parameter. It can't be called with a pointer to a D function. Logical Solution: extern(C) { testFunction(extern(D) int function(int)); // DOES NOT COMPILE } How do you fix this without mov

Re: Modify Object Pointer during Initialzation

2014-04-08 Thread Jeroen Bollen
On Tuesday, 8 April 2014 at 14:26:46 UTC, Adam D. Ruppe wrote: On Tuesday, 8 April 2014 at 14:23:02 UTC, Jeroen Bollen wrote: Is there a documentation page about the 'uniform function call syntax'? http://dlang.org/function.html#pseudo-member Oh beat me to it.

Re: Modify Object Pointer during Initialzation

2014-04-08 Thread Jeroen Bollen
On Tuesday, 8 April 2014 at 14:23:02 UTC, Jeroen Bollen wrote: Is there a documentation page about the 'uniform function call syntax'? Never mind, I think I understand all there is to it.

Re: Modify Object Pointer during Initialzation

2014-04-08 Thread Jeroen Bollen
On Tuesday, 8 April 2014 at 14:13:10 UTC, Adam D. Ruppe wrote: On Tuesday, 8 April 2014 at 14:04:01 UTC, Jeroen Bollen wrote: Basically, why is this its own variable? Why doesn't D simply use the variable it was called with? A class reference is basically a pointer, passing it by refe

Modify Object Pointer during Initialzation

2014-04-08 Thread Jeroen Bollen
This topic is somewhat related to this question I asked yesterday on StackOverflow: http://stackoverflow.com/q/22921395/2558778 Basically, why is this its own variable? Why doesn't D simply use the variable it was called with? https://gist.github.com/Binero/10128826 I don't see why this need

Re: How to pass delegates to C functions?

2014-04-03 Thread Jeroen Bollen
On Friday, 4 April 2014 at 05:20:42 UTC, Mengu wrote: On Thursday, 3 April 2014 at 17:59:33 UTC, Jeroen Bollen wrote: After being downvoted on stackoverflow for no apperant reason, I figured I'd give it a shot here. How do I pass a delegate to an external C function taking a function po

Re: How to pass delegates to C functions?

2014-04-03 Thread Jeroen Bollen
On Thursday, 3 April 2014 at 18:13:31 UTC, Adam D. Ruppe wrote: On Thursday, 3 April 2014 at 17:59:33 UTC, Jeroen Bollen wrote: How do I pass a delegate to an external C function taking a function pointer? You can't do it directly in general, unless you can modify the C function, the

Re: How to pass delegates to C functions?

2014-04-03 Thread Jeroen Bollen
On Thursday, 3 April 2014 at 18:05:26 UTC, Justin Whear wrote: On Thu, 03 Apr 2014 17:59:30 +, Jeroen Bollen wrote: After being downvoted on stackoverflow for no apperant reason, I figured I'd give it a shot here. How do I pass a delegate to an external C function taking a fun

How to pass delegates to C functions?

2014-04-03 Thread Jeroen Bollen
After being downvoted on stackoverflow for no apperant reason, I figured I'd give it a shot here. How do I pass a delegate to an external C function taking a function pointer? If you want some extra rep on StackOverflow you can also answer here: http://stackoverflow.com/questions/22845175/p

Re: How to foreach over a DList?

2014-04-01 Thread Jeroen Bollen
Just for reference, this is the compiling code: https://gist.github.com/Binero/f30e56351baf05f1a2ec

Re: How to foreach over a DList?

2014-03-31 Thread Jeroen Bollen
Still no luck: import std.container; import std.stdio; void main() { DList!ubyte list1 = DList!ubyte(); list1 ~= cast(ubyte) 1; list1 ~= cast(ubyte) 2; list1 ~= cast(ubyte) 3; foreach(ubyte item; list1[]) { writeln(item); } } /usr

Re: How to foreach over a DList?

2014-03-31 Thread Jeroen Bollen
Still not working: https://gist.github.com/Binero/f30e56351baf05f1a2ec /usr/include/dlang/dmd/std/container.d(1925): Error: template std.container.DList!ubyte.DList.insertBeforeNode cannot deduce function from argument types !()(typeof(null), int), candidates are: /usr/include/dlang/dmd/std/co

Re: How to foreach over a DList?

2014-03-31 Thread Jeroen Bollen
On Monday, 31 March 2014 at 18:24:39 UTC, H. S. Teoh wrote: On Mon, Mar 31, 2014 at 05:50:16PM +, Jeroen Bollen wrote: I am trying to foreach over a std.container.DList but it isn't working. I have tried the following code: [...] Maybe try using opSlice: DList m

Re: How to foreach over a DList?

2014-03-31 Thread Jeroen Bollen
On Monday, 31 March 2014 at 19:26:23 UTC, Jeroen Bollen wrote: On Monday, 31 March 2014 at 18:24:39 UTC, H. S. Teoh wrote: On Mon, Mar 31, 2014 at 05:50:16PM +, Jeroen Bollen wrote: I am trying to foreach over a std.container.DList but it isn't working. I have tried the following

How to foreach over a DList?

2014-03-31 Thread Jeroen Bollen
I am trying to foreach over a std.container.DList but it isn't working. I have tried the following code: https://gist.github.com/Binero/f30e56351baf05f1a2ec I am getting the following errors: /usr/include/dlang/dmd/std/container.d(1925): Error: template std.container.DList!ubyte.DList.insertB

Re: Disabling the Garbage Collector

2014-03-03 Thread Jeroen Bollen
On Monday, 3 March 2014 at 02:33:49 UTC, Adam D. Ruppe wrote: On Sunday, 2 March 2014 at 23:21:49 UTC, Jeroen Bollen wrote: Is there maybe a way to disable the garbage collector from running unless you explicitly call it? That's really the default. The GC in D runs if and only if you do

Re: Disabling the Garbage Collector

2014-03-02 Thread Jeroen Bollen
On Sunday, 2 March 2014 at 23:17:12 UTC, bearophile wrote: Jeroen Bollen: I've read about ways to disable the garbage collector, but that'd mean it was initially enabled. You can disable and then enable the garbage collector like this: void main() { import core.memory;

Disabling the Garbage Collector

2014-03-02 Thread Jeroen Bollen
How to disable D's Garbage Collector? I have read stuff about editing Phobos and simply take it out, and replace it with your own to have stuff like the new keyword still work. Surely there must be an easier way, where you can still allocate like you normally would, as long as you deallocate too.

Re: Check if path is child of directory

2014-02-11 Thread Jeroen Bollen
On Monday, 10 February 2014 at 00:44:23 UTC, Jesse Phillips wrote: On Sunday, 9 February 2014 at 21:02:59 UTC, Jeroen Bollen wrote: I'm building a webserver using the Vibe.d library. Whenever the user requests a page inside my /images/ folder; I want them to output this file. Because

Re: Check if path is child of directory

2014-02-09 Thread Jeroen Bollen
On Sunday, 9 February 2014 at 21:02:59 UTC, Jeroen Bollen wrote: I'm building a webserver using the Vibe.d library. Whenever the user requests a page inside my /images/ folder; I want them to output this file. Because there will be a lot of images present, and because these are like

Check if path is child of directory

2014-02-09 Thread Jeroen Bollen
I'm building a webserver using the Vibe.d library. Whenever the user requests a page inside my /images/ folder; I want them to output this file. Because there will be a lot of images present, and because these are likely to change in the future, I would like to just get the URL from the reque

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra Is that your actual code? "MersenneTwisterEngine(seed)" is not valid code, you have to provide the template arguments. I meant to answer to this by the way, sorry. (in need of edit feature :P )

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra wrote: On Tuesday, 21 January 2014 at 17:13:39 UTC, Jeroen Bollen wrote: On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still isn't answered by the way. Come on, surely someone knows h

Re: Is continuously seeding a random number generator performance intensive?

2014-01-17 Thread Jeroen Bollen
On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still isn't answered by the way.

Re: Is continuously seeding a random number generator performance intensive?

2014-01-16 Thread Jeroen Bollen
On Wednesday, 15 January 2014 at 21:23:03 UTC, Frustrated wrote: Anyways, now that you have your RND2D you don't ever have to pre-generate your noise. Obviously it is more computationally expensive though. Thing is, the image is finite so I figured it'd be best to pre-generate a set of seeds,

Re: Is continuously seeding a random number generator performance intensive?

2014-01-15 Thread Jeroen Bollen
How do you correctly create a MersenneTwisterEngine with a ulong as seed?

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
On Sunday, 5 January 2014 at 01:23:58 UTC, Adam D. Ruppe wrote: On Sunday, 5 January 2014 at 01:10:29 UTC, Jeroen Bollen wrote: Is there a way to tell it to not initialize it? I'm not sure of any except using the primitives. You can malloc GC memory from GC.malloc (works the same way

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
Also about the previous C style malloc, to free it, I just use the c style delete?

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
On Sunday, 5 January 2014 at 00:28:00 UTC, Adam D. Ruppe wrote: On Sunday, 5 January 2014 at 00:17:12 UTC, Jeroen Bollen wrote: Also a somewhat unrelated question, variables in D get initialized by default, do they also when you define them right after? Something like: Maybe. Logically, it

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
Also a somewhat unrelated question, variables in D get initialized by default, do they also when you define them right after? Something like: int[] iryy = new int[](50); // Will the array elements be initialized to 0? foreach(int i; irry) { i = 20; }

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 21:48:02 UTC, bearophile wrote: Jeroen Bollen: Divisions for every result would be expensive, and shifting the output wouldn't return a uniform distribution. If the ulong is uniform, then every of its ubytes is uniform. So "& ubyte.max"

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 20:16:31 UTC, Jeroen Bollen wrote: Also where is UIntType defined? Alright, turns out it was just a template. One more question though, I have my Engine set to have 'ulong' as a seed through the template, which means that it'll also return 

Re: Is continuously seeding a random number generator performance intensive?

2014-01-04 Thread Jeroen Bollen
Also where is UIntType defined?

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 17:24:24 UTC, Adam D. Ruppe wrote: And GC.addRange is in core.memory if you want that. http://dlang.org/phobos/core_memory.html#addRange Would that work with structs too? Struct* i = malloc(Struct.sizeof); i = &Struct(params);

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 17:22:44 UTC, Adam D. Ruppe wrote: On Saturday, 4 January 2014 at 17:19:30 UTC, Jeroen Bollen wrote: Do I get malloc from the C library or does D also have a function for this? import core.stdc.stdlib; // malloc and free are in here it uses it from the C

Re: Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
On Saturday, 4 January 2014 at 17:16:53 UTC, Adam D. Ruppe wrote: On Saturday, 4 January 2014 at 17:15:12 UTC, Jeroen Bollen wrote: Is there a way to prevent the Garbage collector from running on one particular object? Something like: I would just malloc it. int* CreatePermanentInt

Prevent Garbage Collector

2014-01-04 Thread Jeroen Bollen
Is there a way to prevent the Garbage collector from running on one particular object? Something like: int* CreatePermanentInt() { int i = 5; return &i; } And i wouldn't be collected after this.

Re: Linux DLL

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 20:48:29 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 20:37:06 UTC, Mineko wrote: On Friday, 3 January 2014 at 20:34:17 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 20:31:09 UTC, Mineko wrote: So, I was doing some stuff with shared libraries and

Re: Linux DLL

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 20:37:06 UTC, Mineko wrote: On Friday, 3 January 2014 at 20:34:17 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 20:31:09 UTC, Mineko wrote: So, I was doing some stuff with shared libraries and need some confirmation on what's going on with

Re: Linux DLL

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 20:31:09 UTC, Mineko wrote: So, I was doing some stuff with shared libraries and need some confirmation on what's going on with http://dlang.org/dll-linux.html Is that page recent, or really old? It's using printf and stuff so uhh.. Seems old. Could anyone here p

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 18:23:23 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 17:41:48 UTC, Jeroen Bollen wrote: On Friday, 3 January 2014 at 13:42:19 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 13:42:19 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 13:30:09 UTC, Jeroen Bollen wrote: I already considered this, but the problem is, I need to smoothen the noise, and to do that I need all surrounding 'checkpoints' too. This means that it&

Re: Is continuously seeding a random number generator performance intensive?

2014-01-03 Thread Jeroen Bollen
On Friday, 3 January 2014 at 10:06:27 UTC, monarch_dodra wrote: On Friday, 3 January 2014 at 01:43:09 UTC, Chris Cain wrote: So, it sounds like the OP is using the x and y coords for a seed to generate a single number and he was curious to whether it costs too much to reseed like this for every

Is continuously seeding a random number generator performance intensive?

2014-01-02 Thread Jeroen Bollen
D provides a set of Random Number Generators in std.random. I am writing an application which would create a 2D map of noise. To do this though, I'll have to calculate the same random numbers over and over again. (I cannot store them, that'd take a horrible amount of RAM. ) Is it good to re-s

Re: how to detect OS architecture?

2013-12-16 Thread Jeroen Bollen
On Monday, 16 December 2013 at 10:54:15 UTC, Hugo Florentino wrote: Hi, I am writing a launcher to make a Windows application portable, but since this application supports both x86 and x86_64, I would like to detect the architecture of the OS my launcher is being run on, in order to launch th

Re: WinAPI Wide Functions

2013-12-15 Thread Jeroen Bollen
On Sunday, 15 December 2013 at 14:26:26 UTC, Marco Leise wrote: Am Sun, 15 Dec 2013 15:17:39 +0100 schrieb "Jeroen Bollen" : Are there default bindings to the WinAPI's Wide Functions? I'm talking about for example 'CreateWindowW'. I know of this project: h

WinAPI Wide Functions

2013-12-15 Thread Jeroen Bollen
Are there default bindings to the WinAPI's Wide Functions? I'm talking about for example 'CreateWindowW'.

How to load a derelict program in D?

2013-12-06 Thread Jeroen Bollen
;dub generate visuald"; this is my project.json: { "name": "testing", "description": "testing", "authors": ["Jeroen Bollen"], "dependencies": { "derelict-sfml2" : "~master", } }

Re: Binary Data Serialization Libraries

2013-12-06 Thread Jeroen Bollen
On Friday, 6 December 2013 at 14:40:54 UTC, Max Klyga wrote: On 2013-12-06 13:33:44 +, Jeroen Bollen said: Are there any Binary Data Serialization Libraries available written in D2? I'm looking for something like a BSON read/write library. (Although can be any other binary lan

Binary Data Serialization Libraries

2013-12-06 Thread Jeroen Bollen
Are there any Binary Data Serialization Libraries available written in D2? I'm looking for something like a BSON read/write library. (Although can be any other binary language really)

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-24 Thread Jeroen Bollen
On Sunday, 24 November 2013 at 12:07:18 UTC, Dejan Lekic wrote: On Saturday, 23 November 2013 at 23:47:11 UTC, Adam D. Ruppe wrote: On Saturday, 23 November 2013 at 23:30:09 UTC, Jeroen Bollen wrote: I added the code to my GitHub repo; there don't seem to be any uncommon associative a

Re: Read Byte Array to Integer

2013-11-24 Thread Jeroen Bollen
On Friday, 22 November 2013 at 21:17:56 UTC, monarch_dodra wrote: On Friday, 22 November 2013 at 19:44:56 UTC, Jeroen Bollen wrote: On Friday, 22 November 2013 at 19:22:16 UTC, Ali Çehreli wrote: import std.bitmanip; import std.system; void main() { ubyte[] data = [ 1, 2, 3, 4 ]; assert

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 23:47:11 UTC, Adam D. Ruppe wrote: On Saturday, 23 November 2013 at 23:30:09 UTC, Jeroen Bollen wrote: I added the code to my GitHub repo; there don't seem to be any uncommon associative arrays: Yea, it is the immutable string[string], I used the same pa

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 23:47:11 UTC, Adam D. Ruppe wrote: On Saturday, 23 November 2013 at 23:30:09 UTC, Jeroen Bollen wrote: I added the code to my GitHub repo; there don't seem to be any uncommon associative arrays: Yea, it is the immutable string[string], I used the same pa

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
I added the code to my GitHub repo; there don't seem to be any uncommon associative arrays: https://github.com/SanePumpkins/FastCGI.D

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 22:49:54 UTC, Adam D. Ruppe wrote: On Saturday, 23 November 2013 at 21:05:59 UTC, Jeroen Bollen wrote: I am getting this weird linker error when compiling my code; what does it mean? I saw this on stackoverflow first and answered there, let me link it: http

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 22:34:54 UTC, bearophile wrote: Jeroen Bollen: I am getting this weird linker error when compiling my code; what does it mean? Is your code not compiling since switching to a newer compiler? What system and compilers are you using? How many modules are in

Re: undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 21:32:13 UTC, bearophile wrote: Jeroen Bollen: I am getting this weird linker error when compiling my code; what does it mean? If your code used to work, and you have just tried dmd 2.064 then as try to compile with -allinst. Bye, bearophile No luck with

undefined reference to `_D16TypeInfo_HAyayAa6__initZ'

2013-11-23 Thread Jeroen Bollen
I am getting this weird linker error when compiling my code; what does it mean?

Re: Read Byte Array to Integer

2013-11-23 Thread Jeroen Bollen
On Saturday, 23 November 2013 at 15:21:02 UTC, Ali Çehreli wrote: On 11/23/2013 04:08 AM, Jeroen Bollen wrote: On Friday, 22 November 2013 at 23:12:25 UTC, Ali Çehreli wrote: That means that the slice itself cannot be modified, meaning that it cannot be consumed by read. Can't

Re: Read Byte Array to Integer

2013-11-23 Thread Jeroen Bollen
On Friday, 22 November 2013 at 23:12:25 UTC, Ali Çehreli wrote: That means that the slice itself cannot be modified, meaning that it cannot be consumed by read. Can't work... :) Why does read need to be able to change the byte array?

Re: Class Array in D?

2013-11-20 Thread Jeroen Bollen
On Wednesday, 20 November 2013 at 18:23:37 UTC, Ali Çehreli wrote: On 11/20/2013 10:12 AM, Jeroen Bollen wrote: > is there a way I can pass a TypeTulip to a function? alias TypeTulip = TypeTuple; ;) > Something like: > > Can I create a class array in D? Something like: >

Class Array in D?

2013-11-20 Thread Jeroen Bollen
is there a way I can pass a TypeTulip to a function? Something like: Can I create a class array in D? Something like: interface A {} class AA: A {} class AB: A {} class AC: A {} ClassList!A list = new ClassList!A {AA, AB, AC}; void testf(ulong testv) { A a = new list[testv]; } I know abou

Re: Class References

2013-11-20 Thread Jeroen Bollen
On Monday, 18 November 2013 at 19:12:03 UTC, Ali Çehreli wrote: On 11/18/2013 10:28 AM, Jeroen Bollen wrote: Is it possible to do something like: TestInterface testi = new classReferenceList[integer]; We still don't know what the use case is :) but it is possible to store types

Re: MSG_WAITALL for Sockets

2013-11-20 Thread Jeroen Bollen
On Tuesday, 19 November 2013 at 23:36:57 UTC, Rob T wrote: On Tuesday, 19 November 2013 at 18:35:08 UTC, Jeroen Bollen wrote: Is there a way I can call a receive method on a socket with MSG_WAITALL as a flag? There doesn't seem to be an enum for that. module core.sys.posix.sys.s

MSG_WAITALL for Sockets

2013-11-19 Thread Jeroen Bollen
Is there a way I can call a receive method on a socket with MSG_WAITALL as a flag? There doesn't seem to be an enum for that.

Re: How does noexcept work?

2013-11-19 Thread Jeroen Bollen
On Tuesday, 19 November 2013 at 18:09:29 UTC, Namespace wrote: On Tuesday, 19 November 2013 at 18:01:19 UTC, Jeroen Bollen wrote: If I have a function: @safe pure void functionName() { return; } Where do I put the noexcept? Did you mean nothrow? You can put it

How does noexcept work?

2013-11-19 Thread Jeroen Bollen
If I have a function: @safe pure void functionName() { return; } Where do I put the noexcept?

Re: Calling Base Class Overriden Methods

2013-11-18 Thread Jeroen Bollen
On Monday, 18 November 2013 at 19:34:56 UTC, Adam D. Ruppe wrote: On Monday, 18 November 2013 at 19:32:39 UTC, Jeroen Bollen wrote: How do I call a parent class's overidden method? super.method so abstract class SuperClass { public pure void methodA() { } } class Sub

Calling Base Class Overriden Methods

2013-11-18 Thread Jeroen Bollen
How do I call a parent class's overidden method? module test; abstract class SuperClass { public pure void methodA() { } } class SubClass { public override pure void methodB() { // How do I call the parent methodA() from here? } }

Re: Class References

2013-11-18 Thread Jeroen Bollen
Is it possible to do something like: TestInterface testi = new classReferenceList[integer];

Re: Cannot pass by reference

2013-11-18 Thread Jeroen Bollen
On Saturday, 16 November 2013 at 16:34:31 UTC, Ali Çehreli wrote: The problem with your example is that unlike main.c in my example, what you pass is an rvalue, which may not be bound to the ref parameter. Thanks, this is what I needed!

Re: Cannot pass by reference

2013-11-16 Thread Jeroen Bollen
On Saturday, 16 November 2013 at 14:28:45 UTC, bearophile wrote: Jeroen Bollen: Why is that? It's caused by the cast. The solution is to use an auxiliary value inside the main, or remove the cast. Bye, bearophile Same error, but "is not callable using argument types (TcpSocket)"...

Cannot pass by reference

2013-11-16 Thread Jeroen Bollen
I cannot seem to pass values to functions by referece. -- @safe public nothrow this(ref Socket socket) { // Inside class modulename.classname this.socket = socket; } ---

Array Defenitions

2013-11-13 Thread Jeroen Bollen
I feel there is a lack of resources/documentation on array definitions. I cannot believe the official documentation tries to explain how D handles arrays without defining an array a single time. http://dlang.org/arrays.html

Re: Embed JavaScript into D

2013-11-04 Thread Jeroen Bollen
On Monday, 4 November 2013 at 22:22:32 UTC, Max Klyga wrote: On 2013-11-04 21:20:46 +, Adam D. Ruppe said: On Monday, 4 November 2013 at 19:35:55 UTC, Jeroen Bollen wrote: Is there a way I can embed javascript into my D application? You could use any C javascript lib too, but for ones

Re: Embed JavaScript into D

2013-11-04 Thread Jeroen Bollen
On Monday, 4 November 2013 at 20:43:46 UTC, John Colvin wrote: On Monday, 4 November 2013 at 20:18:19 UTC, Jeroen Bollen wrote: On Monday, 4 November 2013 at 19:45:23 UTC, Dicebot wrote: On Monday, 4 November 2013 at 19:35:55 UTC, Jeroen Bollen wrote: Is there a way I can embed javascript into

Re: Embed JavaScript into D

2013-11-04 Thread Jeroen Bollen
On Monday, 4 November 2013 at 19:45:23 UTC, Dicebot wrote: On Monday, 4 November 2013 at 19:35:55 UTC, Jeroen Bollen wrote: Is there a way I can embed javascript into my D application? I basically want to create a modular application which allows adding and removing plugins by dragging and

Embed JavaScript into D

2013-11-04 Thread Jeroen Bollen
Is there a way I can embed javascript into my D application? I basically want to create a modular application which allows adding and removing plugins by dragging and dropping them into a folder. I love the idea of them being editable on the fly.

Class References

2013-10-28 Thread Jeroen Bollen
Is it possible in D to create an enum of class references? Something around the lines of: enum ClassReferences : Interface { CLASS1 = &ClassOne, CLASS2 = &ClassTwo }