tkd - basic compilation problem

2015-06-30 Thread Paul via Digitalmars-d-learn
I downloaded the archive from https://github.com/nomad-software/tkd and files are same as in the git repo. Tcl/tk is installed on this machine (test 'hello world' script works fine) but I get this error when compiling the example from the github page: tkd/interpreter/tcl.d(16): Error: module

Re: tkd - basic compilation problem

2015-06-30 Thread Paul via Digitalmars-d-learn
Using dub I get this during linking: Building tkd-test ~master configuration application, build type debug. Compiling using dmd... Linking... /usr/bin/ld: cannot find -ltcl /usr/bin/ld: cannot find -ltk ...any suggestions please?

Re: Array declaration warning

2015-06-03 Thread Paul via Digitalmars-d-learn
On Wednesday, 3 June 2015 at 20:33:02 UTC, Ali Çehreli wrote: pathList[][n] ~= CoOrd(cX, cY); I don't think you need the empty [] there. pathList[n] is one of the paths and you are adding a coordinate to it: Urgh, *that* is how I was confusing myself, the rest of the code 'looks right'.

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 20:03:36 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote: On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 12:41:21 UTC, wobbles wrote: On Monday, 4 May 2015 at 20:34:32 UTC, Paul wrote: Can some one tell me what this linker command means (or point me at some docs) please: dmd example.d -L-L. $@ AFAIK $@ is 'all the supplied arguments' so I don't understand what it

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote: On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker.

Re: Linker command

2015-05-06 Thread Paul via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote: On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote: but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? Passes '-L.' to the linker. :D I can see that, but what does '-L.' mean exactly?

Linker command

2015-05-04 Thread Paul via Digitalmars-d-learn
Can some one tell me what this linker command means (or point me at some docs) please: dmd example.d -L-L. $@ AFAIK $@ is 'all the supplied arguments' so I don't understand what it achieves. (it's from the DAllegro5 example program, on Linux). Cheers, Paul

Re: Implicit conversion error

2015-05-01 Thread Paul via Digitalmars-d-learn
On Thursday, 30 April 2015 at 22:24:15 UTC, bearophile wrote: Paul: When compiled on a 64 bit machine, this line int r = uniform(0, mobs.length); .length returns a size_t, and 0 is an int. uniform() probably decides to unify those types to a size_t. A size_t is 32 bit on 32 bit machines

Implicit conversion error

2015-04-30 Thread Paul via Digitalmars-d-learn
When compiled on a 64 bit machine, this line int r = uniform(0, mobs.length); gives me an error: Error: cannot implicitly convert expression (uniform(0, mobs.length)) of type ulong to int but it compiles ok on a 32 bit machine. I thought it was the expression on the righthand side returning

How to output ascii character using terminal.d

2015-04-24 Thread Paul via Digitalmars-d-learn
How do I output a single ascii character specified numerically, via terminal.d's writef() function which expects a string? Bound to be something obvious but I just can't see it atm! Paul

Re: How to output ascii character using terminal.d

2015-04-24 Thread Paul via Digitalmars-d-learn
On Friday, 24 April 2015 at 15:46:15 UTC, Adam D. Ruppe wrote: Try terminal.writef(%s, cast(char) your_ascii_character); it should work. Thank you, it works for the standard ascii characters but not the extended set - maybe that has something to do with my terminal settings...? (not that I

Re: string-int[] array

2015-03-08 Thread Paul via Digitalmars-d-learn
On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote: Is it possible to create such an array in which you can store strings and numbers at the same time? string-int[] array = [4, five]; As there's no mention of performance, what's wrong with a plain old string array with a bit of

Re: string-int[] array

2015-03-08 Thread Paul via Digitalmars-d-learn
On Sunday, 8 March 2015 at 21:18:31 UTC, Max Klyga wrote: On 2015-03-08 21:11:42 +, Paul said: On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote: Is it possible to create such an array in which you can store strings and numbers at the same time? string-int[] array = [4,

Error: getenv cannot be interpreted at compile time

2015-02-17 Thread Paul via Digitalmars-d-learn
I'd like to create a Terminal using terminal.d and make it available across several source files (as a global rather than having to pass it around) but when I define it like this in global scope: Terminal Screen = Terminal(ConsoleOutputType.cellular); I get this error: Error: getenv cannot

Re: Error: getenv cannot be interpreted at compile time

2015-02-17 Thread Paul via Digitalmars-d-learn
On Tuesday, 17 February 2015 at 19:35:27 UTC, H. S. Teoh wrote: On Tue, Feb 17, 2015 at 07:17:41PM +, Paul via Digitalmars-d-learn wrote: I'd like to create a Terminal using terminal.d and make it available across several source files (as a global rather than having to pass it around

Re: Error: getenv cannot be interpreted at compile time

2015-02-17 Thread Paul via Digitalmars-d-learn
On Tuesday, 17 February 2015 at 19:29:52 UTC, Adam D. Ruppe wrote: On Tuesday, 17 February 2015 at 19:17:42 UTC, Paul wrote: I don't understand the error and Google doesn't help - can it be fixed or am I just using the wrong approach? Trying to create it as a global tries to make it as a

Re: Ncurses deprecated ~master issue

2015-02-11 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 23:39:56 UTC, Adam D. Ruppe wrote: On Tuesday, 10 February 2015 at 21:11:14 UTC, Paul wrote: Yes, I noted the default values, even if I don't understand what they do at present(!). They allow overriding of the input/output files. fdIn normally refers to

Re: Ncurses deprecated ~master issue

2015-02-11 Thread Paul via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 18:37:49 UTC, Adam D. Ruppe wrote: On Wednesday, 11 February 2015 at 18:13:10 UTC, Paul wrote: How do I get/process input? Construct the real time input struct outside your loop then use getch if you're only interested in the core keyboard ascii stuff or

Re: Ncurses deprecated ~master issue

2015-02-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 20:57:43 UTC, Adam D. Ruppe wrote: On Tuesday, 10 February 2015 at 20:50:28 UTC, Paul wrote: test.o: In function `_Dmain': test.d:(.text._Dmain+0x13): undefined reference to `_D8terminal8Terminal6__initZ' If you see 'undefined reference' it means some library

Re: Ncurses deprecated ~master issue

2015-02-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 21:05:08 UTC, Meta wrote: On Tuesday, 10 February 2015 at 20:50:28 UTC, Paul wrote: On Tuesday, 10 February 2015 at 19:49:26 UTC, ketmar wrote: On Tue, 10 Feb 2015 19:37:59 +, Meta wrote: I can't answer your question, but if you're just prototyping you

Re: Ncurses deprecated ~master issue

2015-02-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 3 December 2014 at 19:37:03 UTC, Paul wrote: On Wednesday, 3 December 2014 at 17:37:18 UTC, Matt Soucy wrote: On 12/03/2014 07:07 AM, Paul wrote: Sorry if this is a little off-topic, I posted this in the Dub forum on 23/11/14 but have had no reply yet: --- I read that the use

Re: Conway's game of life

2015-02-03 Thread Paul via Digitalmars-d-learn
On Monday, 2 February 2015 at 16:58:43 UTC, bearophile wrote: The quality of the D GC is not important for a simple Life implementation, you just need two arrays. Here's my 30 minute sandwich-break version, sorry it's not very arractive 'D'... import std.stdio; import std.random; void

Re: Conway's game of life

2015-02-03 Thread Paul via Digitalmars-d-learn
On Tuesday, 3 February 2015 at 13:35:37 UTC, Paul wrote: On Monday, 2 February 2015 at 16:58:43 UTC, bearophile wrote: The quality of the D GC is not important for a simple Life implementation, you just need two arrays. Here's my 30 minute sandwich-break version, sorry it's not very

Re: Conway's game of life

2015-02-03 Thread Paul via Digitalmars-d-learn
On Tuesday, 3 February 2015 at 14:01:51 UTC, bearophile wrote: Paul: enum WORLDSIZE = 20; enum INITIALPOP = 70; //experimental enum DEAD = 0; enum ALIVE = 1; D enums don't need to be ALL UPPERCASE :-) int world[WORLDSIZE][WORLDSIZE]; Don't

Re: Input error with readf()

2015-01-30 Thread Paul via Digitalmars-d-learn
On Friday, 30 January 2015 at 15:03:55 UTC, Ali Çehreli wrote: Not the best error message... Saying '5' is unexpected for 'int' is confusing, right? Unfortunately, I can't come up with a good explanation for that error message in the book. :) Maybe just remove the section with the

std.algorithm sort() and reverse() confusion

2015-01-30 Thread Paul via Digitalmars-d-learn
Given that myVals is a dynamic array of ints... writeln(Array contents: , myVals); writeln(Sorted: , sort(myVals)); writeln(Sorted, reversed: , reverse(myVals)); Gives me... Error: template std.stdio.writeln cannot deduce function from argument types !()(string, void) But, if I bring the

Re: std.algorithm sort() and reverse() confusion

2015-01-30 Thread Paul via Digitalmars-d-learn
On Friday, 30 January 2015 at 16:21:24 UTC, Kagamin wrote: writeln(Sorted, reversed: , retro(sort(myVals))); ? Or... writeln(Reverse sorted: , sort!(a b)(vals)); but I still don't understand the original 'error'.

Re: std.algorithm sort() and reverse() confusion

2015-01-30 Thread Paul via Digitalmars-d-learn
On Friday, 30 January 2015 at 18:46:55 UTC, Ali Çehreli wrote: there is no such benefit with reverse, so there's no need to return anything. Still, returning the original range would help with chaining calls: arr.reverse.map!sqrt Side note: There is the confusion between the .reverse

Input error with readf()

2015-01-30 Thread Paul via Digitalmars-d-learn
If I run the following example program from the 'Programming in D' book, the input doesn't 'get stuck' as stated in the book but instead produces the error message given. Have things changed since that part of the book was written or is it some other issue? The version that uses %s in the call

Re: Print to Win Printer

2015-01-28 Thread Paul via Digitalmars-d-learn
Thanks Vladimir.

Print to Win Printer

2015-01-27 Thread Paul via Digitalmars-d-learn
How do I print to a Windows printer from a console program? Thanks for your assistance.

Re: Sqlite

2015-01-25 Thread Paul via Digitalmars-d-learn
I'd like to vary the query based on input but if I try to move the string out of the sqlite3_exec call like this: string sqlStatement = CREATE TABLE people(id INT PRIMARY KEY NOT NULL, surname TEXT NOT NULL);; result = sqlite3_exec(db, sqlStatement, aCallback, null, msg); ...it won't

Re: Sqlite

2015-01-25 Thread Paul via Digitalmars-d-learn
On Sunday, 25 January 2015 at 18:19:47 UTC, Tobias Pankrath wrote: Only string literals convert to const(char)*, because only for them it is guaranteed that they are null terminated. For everything else use toStringz. So, as a trivial example, is this how it's done?: string semiC = ;; const

Sqlite

2015-01-11 Thread Paul via Digitalmars-d-learn
Can someone please tell me what I'm doing wrong here, the sql INSERT statement fails for some reason. I don't fully understand the callback function yet (I borrowed this from a C tutorial on the subject), maybe that is the source of the problem? import etc.c.sqlite3; import std.stdio;

Re: Sqlite

2015-01-11 Thread Paul via Digitalmars-d-learn
On Sunday, 11 January 2015 at 20:20:21 UTC, ketmar via Digitalmars-d-learn wrote: note the single quotes in your code: that is where it all goes wrong. i don't know where you got that quotes from, but this is not a valid SQL syntax for `CREATE TABLE`. ;-) Thank you, I thought it might be

Re: Sqlite

2015-01-11 Thread Paul via Digitalmars-d-learn
On Sunday, 11 January 2015 at 22:19:28 UTC, Tobias Pankrath wrote: Hint: Put the SQL in a file create_people.sql and import it into your code via the import statement: string sql = import(create_people.sql); // you'll need a correct -J compiler switch That way you can easily test if it's

Re: Segmentation fault after having a certain number of elements in an array?

2014-12-13 Thread Paul via Digitalmars-d-learn
On Saturday, 13 December 2014 at 08:59:19 UTC, Jeremy DeHaan wrote: for(int i = 0; isamples.length; ++i) m_samples.length +=1; You are testing i against an ever-increasing limit aren't you, so it's an infinite loop.

Re: Global array

2014-12-12 Thread Paul via Digitalmars-d-learn
On Thursday, 11 December 2014 at 21:35:43 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Thu, Dec 11, 2014 at 08:56:00PM +, Paul via Digitalmars-d-learn wrote: Is there any merit (or folly!) in storing a large array, that frequently needs to be accessed globally, within a class like so

Re: Derelict / SDL error

2014-12-11 Thread Paul via Digitalmars-d-learn
On Thursday, 11 December 2014 at 00:36:08 UTC, Mike Parker wrote: More evidence pointing toward the system configuration on the problem machines. I'm quite far from being a Linux guru, but at this point I would be looking at removing the binaries I've compiled myself and installing the binary

Global array

2014-12-11 Thread Paul via Digitalmars-d-learn
Is there any merit (or folly!) in storing a large array, that frequently needs to be accessed globally, within a class like so: public class classMap{ public static int[MAPSIZE][MAPSIZE] map; } Or is there a proper 'D' way to do this? TIA

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 22:27:43 UTC, anonymous wrote: On Tuesday, 9 December 2014 at 16:12:35 UTC, Paul wrote: import derelict.sdl2.sdl; import std.stdio; import std.conv; void main() { scope(exit) { SDL_Quit(); } DerelictSDL2.load();

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:10:23 UTC, Mike Parker wrote: Also, though this is unrelated (I just noticed it when looking at your code again), I strongly recommend you move the line scope( exit ) SDL_Quit(); to somewhere after DerelictSDL2.load(). If the SDL shared library fails to

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 09:07:56 UTC, ketmar via Digitalmars-d-learn wrote: do you have the corresponding libraries installed? SDL_Image uses libpng and libjpeg for decoding images, so if you don't have those installed (with corresponding -dev if your system needs that) you will not

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned. Maybe not. The trouble is that others have been able to

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:06:08 UTC, Paul wrote: On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned.

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:58:15 UTC, Paul wrote: The two machines on which errors occur are a Mint 13 (32 bit) box and an ageing laptop with Lubuntu 14.04. I've followed the same procedures but the 64 bit obviously has the 64 bit dmd compiler. Just added SDL_image to this 64 bit

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 21:01:40 UTC, Paul wrote: On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 13:34:56 UTC, Jack wrote: Can't really think of anything that can solve your problem. Only time I had a seg fault is calling a method from an uninitialized class. You can try to get a debugger and/or a gui that comes with it(personally I use gdb with ddd) to find

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:40:00 UTC, Mike Parker wrote: On 12/10/2014 12:19 AM, Paul wrote: dub doesn't know anything about DerelictSDL2Image (and even if it did, just importing it isn't going to tell dub about it -- you would need to add it to your dub.json as a dependency). That's

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:48:32 UTC, Paul wrote: On Tuesday, 9 December 2014 at 15:40:00 UTC, Mike Parker wrote: On 12/10/2014 12:19 AM, Paul wrote: dub doesn't know anything about DerelictSDL2Image (and even if it did, just importing it isn't going to tell dub about it -- you would

Re: Derelict / SDL error

2014-12-09 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 15:53:11 UTC, Paul wrote: Whoa, I read that wrong - I'm sure I tried just adding DerelictSDL2Image.load() to my program an it didnt work. Trying again. The top of my app.d looks like this: import derelict.sdl2.sdl; import std.stdio; import std.conv; void

Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from a terminal). The problem line is:

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:23:12 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! Any ideas where to look for the source of the problem?

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:47:47 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: besides, i don't think that you'll get something sane from `SDL_GetError()` in the case of segfault

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:35:17 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been an outdated piece of software that's been making the fuss.

Ncurses deprecated ~master issue

2014-12-03 Thread Paul via Digitalmars-d-learn
Sorry if this is a little off-topic, I posted this in the Dub forum on 23/11/14 but have had no reply yet: --- I read that the use of a branch spec like ~master in dub.json is deprecated. I also read that it could be overriden on a per-project basis by editing the project's

Re: Ncurses deprecated ~master issue

2014-12-03 Thread Paul via Digitalmars-d-learn
On Wednesday, 3 December 2014 at 17:37:18 UTC, Matt Soucy wrote: On 12/03/2014 07:07 AM, Paul wrote: Sorry if this is a little off-topic, I posted this in the Dub forum on 23/11/14 but have had no reply yet: --- I read that the use of a branch spec like ~master in dub.json is deprecated. I

Re: How to initialise array of ubytes?

2014-11-30 Thread Paul via Digitalmars-d-learn
On Sunday, 30 November 2014 at 11:13:56 UTC, bearophile wrote: Daniel Kozak: I don't know. But this works too: I have added an ER: https://issues.dlang.org/show_bug.cgi?id=13799 Bye, bearophile Glad to hear it's not just me being dense for a change :D

How to initialise array of ubytes?

2014-11-29 Thread Paul via Digitalmars-d-learn
I'm trying to do this: ubyte[MAPSIZE][MAPSIZE] map = 1; but it doesn't work and I can't seem to cast the value to a ubyte (which looks rather ugly and out of place in D anyway). Is there a way to do this other than using a couple of loops? Cheers Paul

Re: How to initialise array of ubytes?

2014-11-29 Thread Paul via Digitalmars-d-learn
On Saturday, 29 November 2014 at 20:22:40 UTC, bearophile wrote: This works: enum MAPSIZE = 3; void main() { ubyte[MAPSIZE][MAPSIZE] map2 = 1; } This doesn't work: enum MAPSIZE = 3; ubyte[MAPSIZE][MAPSIZE] map1 = ubyte(1); void main() {} Why isn't this working? I'm afraid I don't

Re: Dub / Derelict confusion

2014-11-25 Thread Paul via Digitalmars-d-learn
On Sunday, 23 November 2014 at 00:37:07 UTC, Mike Parker wrote: On 11/23/2014 3:52 AM, Paul wrote: Whenever I try to learn a new language I always seem to end up fighting the OS or the IDE rather than spending time where I should. Therefore, I'm going to put this idea on hold and stick to

Re: Dub / Derelict confusion

2014-11-22 Thread Paul via Digitalmars-d-learn
On Friday, 21 November 2014 at 01:23:55 UTC, Mike Parker wrote: On 11/21/2014 10:22 AM, Mike Parker wrote: You are adding anything You /aren't/ The problem is 'no available video device' when trying to init SDL. I've recently wiped/re-installed this machine so something must be missing.

Re: Dub / Derelict confusion

2014-11-21 Thread Paul via Digitalmars-d-learn
On Friday, 21 November 2014 at 01:22:34 UTC, Mike Parker wrote: On 11/21/2014 5:57 AM, Paul wrote: This is a tad off topic now but I'm struggling to get a window on screen as SDL_CreateWindow is failing, here's what I've got: try{ DerelictSDL2.load(); }catch(Exception e){

Re: Dub / Derelict confusion

2014-11-20 Thread Paul via Digitalmars-d-learn
On Wednesday, 19 November 2014 at 10:07:56 UTC, Mike Parker wrote: On 11/19/2014 6:12 PM, Paul wrote: I would like to create a simple program using SDL. I've read this page http://dblog.aldacron.net/derelict-help/using-derelict/ and this one http://code.dlang.org/about and decided that using

Dub / Derelict confusion

2014-11-19 Thread Paul via Digitalmars-d-learn
I would like to create a simple program using SDL. I've read this page http://dblog.aldacron.net/derelict-help/using-derelict/ and this one http://code.dlang.org/about and decided that using 'dub' would be the sensible option for a beginner so I downloaded the dub executable and put it in the

Re: Dub / Derelict confusion

2014-11-19 Thread Paul via Digitalmars-d-learn
@wobbles: Sorry, should have said, I built SDL and the libraries are installed in /usr/local/lib could you give some more details? Full package.json, the file-structure of your project and the full output from dub would help. @John Colvin The entire contents of dub.json are as above. My

Re: Dub / Derelict confusion

2014-11-19 Thread Paul via Digitalmars-d-learn
On Wednesday, 19 November 2014 at 10:07:56 UTC, Mike Parker wrote: On 11/19/2014 6:12 PM, Paul wrote: I would like to create a simple program using SDL. I've read this page http://dblog.aldacron.net/derelict-help/using-derelict/ and this one http://code.dlang.org/about and decided that using

Simple timing

2014-11-17 Thread Paul via Digitalmars-d-learn
I'm trying to write a program that involves simple timing; I like to be able to execute some function at a point no sooner than, say, 3500 milliseconds from now so I need to read the current 'system time' in ticks and calculate the required point in the future using ticks per sec. In other

Re: Simple timing [solved]

2014-11-17 Thread Paul via Digitalmars-d-learn
Thank you both, I'm sure that answers my question. Paul On Monday, 17 November 2014 at 16:38:45 UTC, Rene Zwanenburg wrote: On Monday, 17 November 2014 at 16:24:10 UTC, Paul wrote: I'm trying to write a program that involves simple timing; I like to be able to execute some function at a

assocArray.get(key, default) exists?

2014-06-21 Thread Paul via Digitalmars-d-learn
IS there such method get(key, default) for associative arrays, like in Python?

Re: assocArray.get(key, default) exists?

2014-06-21 Thread Paul via Digitalmars-d-learn
On Saturday, 21 June 2014 at 18:14:15 UTC, bearophile wrote: Paul: IS there such method get(key, default) for associative arrays, like in Python? Try it. Bye, bearophile Wow! Thank you! It exists. Excuse my silly question :)

Re: Some kind of RPC exists for D?

2014-06-21 Thread Paul via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 19:24:03 UTC, Bienlein wrote: Hello, I'm looking for a way to do some kind of RPC in D. Some way of being able to say aFoo.bar(int i, ...) with receiver object and method being marshalled at the sender's site and being unmarshalled and invoked at the receiver's

Re: Subclass of Exception

2014-06-15 Thread Paul via Digitalmars-d-learn
On Sunday, 15 June 2014 at 09:23:36 UTC, FreeSlave wrote: I don't think you always need documentation for all exception classes, since the most of them have the same interface. Usually it's worth to describe where is some exception able to be thrown from, not exception itself. And it's covered

Subclass of Exception

2014-06-14 Thread Paul via Digitalmars-d-learn
One stupid question: in Python subclassing of Exception looks like: class MyError(Exception): pass but in D, if I'm right, we should write more code: class MyError : Exception { this(string msg) { super(msg); } } (without constructor we get error: ...Cannot implicitly generate a

Re: Subclass of Exception

2014-06-14 Thread Paul via Digitalmars-d-learn
On Saturday, 14 June 2014 at 12:17:46 UTC, FreeSlave wrote: On Saturday, 14 June 2014 at 11:59:53 UTC, Paul wrote: One stupid question: in Python subclassing of Exception looks like: class MyError(Exception): pass but in D, if I'm right, we should write more code: class MyError : Exception {

Re: Conversion string-int

2014-06-07 Thread Paul via Digitalmars-d-learn
On Saturday, 7 June 2014 at 21:15:37 UTC, monarch_dodra wrote: On Saturday, 7 June 2014 at 20:53:03 UTC, Paul wrote: I can not understand, why this code works: char s[2] = ['0', 'A']; string ss = to!string(s); writeln(parse!uint(ss, 16)); but this can deduces template: char s[2]

Re: array as parameter

2014-06-07 Thread Paul via Digitalmars-d-learn
On Saturday, 7 June 2014 at 21:17:41 UTC, monarch_dodra wrote: On Saturday, 7 June 2014 at 20:56:14 UTC, Paul wrote: Dynamic array is really reference. Right? But why modification of parameter in this case does not work: void some_func(string[] s) { s ~= xxx; s ~= yyy; } but this works:

Re: array as parameter

2014-06-07 Thread Paul via Digitalmars-d-learn
On Saturday, 7 June 2014 at 21:32:08 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Sat, 07 Jun 2014 20:56:13 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Dynamic array is really reference. Right? But why modification of parameter in this case does

<    1   2