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
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?
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'.
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
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
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.
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?
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
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
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 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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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
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
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
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'.
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
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
Thanks Vladimir.
How do I print to a Windows printer from a console program?
Thanks for your assistance.
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
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
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;
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
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
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.
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
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
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
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();
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
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
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
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.
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
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
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
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
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
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
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:
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
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
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?
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
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
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.
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
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
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
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
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
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
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.
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){
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
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
@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
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
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
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
IS there such method get(key, default) for associative arrays,
like in Python?
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 :)
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
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
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
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 {
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]
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:
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
101 - 182 of 182 matches
Mail list logo