Re: Multiple %s format specifiers with a single argument

2012-04-11 Thread Marco Leise
Am Thu, 12 Apr 2012 13:11:16 +1200 schrieb James Miller : > Its less using the email interface, and more people using braindead > email clients. Gmail and Mutt (the two I use most) seem to handle > replying well, setting the correct headers to indicate things. But I've > seen some odd postings fro

Re: Dear ChrisMiller: This is day 4 of me trying to Compile a (tutorial) myForm.d program with D/Dfl/Entice.

2012-04-11 Thread Andrej Mitrovic
On 4/12/12, vmars316 wrote: > What is looking for? *import* something? Remove the space between '-I' and the import path.

Re: Dear ChrisMiller: This is day 4 of me trying to Compile a (tutorial) myForm.d program with D/Dfl/Entice.

2012-04-11 Thread vmars316
On Wednesday, 11 April 2012 at 18:39:40 UTC, Andrej Mitrovic wrote: On 4/11/12, vmars316 wrote: Didn't you get this message: Andrej, Yes, I got it. But lost track of it, sorry. Anyways, yahoo, I am almost there. I now have a dfl.lib . I ran following (~myForm-compile-2.bat) : echo Compile myFor

Re: Multiple %s format specifiers with a single argument

2012-04-11 Thread James Miller
* Mike Parker [2012-04-10 18:46:42 +0900]: > On 4/10/2012 3:43 AM, Ali Çehreli wrote: > >On 04/09/2012 10:35 AM, Andrej Mitrovic wrote: > >>On 4/9/12, Jonathan M Davis wrote: > >>>Posix positional arguments seem to work for writefln but not format for > >>>whatever reason. Report it as a bug. > >>

Re: Name of files causes error. Why?

2012-04-11 Thread Steven Schveighoffer
On Wed, 11 Apr 2012 15:33:56 -0400, Xan wrote: Hi, With helloworld program named with score or underscore, I receive the following __annoying__ error: $ gdmd-4.6 hola-temp.d hola-temp.d: Error: module hola-temp has non-identifier characters in filename, use module declaration instead W

Re: Name of files causes error. Why?

2012-04-11 Thread Andrej Mitrovic
On 4/11/12, Xan wrote: > With helloworld program named with score or underscore, I receive > the following __annoying__ error: Underscores should work fine (and they do for me). Scores (or dashes) can't work because an indentifier with a dash is not a valid identifier, so a module declaration can

Name of files causes error. Why?

2012-04-11 Thread Xan
Hi, With helloworld program named with score or underscore, I receive the following __annoying__ error: $ gdmd-4.6 hola-temp.d hola-temp.d: Error: module hola-temp has non-identifier characters in filename, use module declaration instead Why? Can someone fix it. It's really annoying Thanks

Re: Dear ChrisMiller: This is day 4 of me trying to Compile a (tutorial) myForm.d program with D/Dfl/Entice.

2012-04-11 Thread Andrej Mitrovic
On 4/11/12, vmars316 wrote: > How do I build the dfl.lib (DFL_LIB & DFL_IMPORT), Didn't you get this message: msysgit: $ git clone https://github.com/Rayerd/dfl.git cmd.exe (set these paths to where DM and DMD are installed) $ set dmc_path=C:\dm $ set dmd_path=C:\DMD\dmd2 $ cd dfl\win32\dfl $ m

Re: Dear ChrisMiller: This is day 4 of me trying to Compile a (tutorial) myForm.d program with D/Dfl/Entice.

2012-04-11 Thread vmars316
On Tuesday, 10 April 2012 at 22:31:44 UTC, Andrej Mitrovic wrote: You can use the zip download: https://github.com/Rayerd/dfl/zipball/master ...ok, i downloaded PortableGit-1.7.10-preview20120409.7z and i put it here: C:\D\dmd2\windows\Dfl\import\dfl\win32\dflexe I am not sure if i need GTK

Re: Passing function as values and returning functions

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 13:04:01 UTC, Steven Schveighoffer wrote: On Wed, 11 Apr 2012 08:53:00 -0400, Xan wrote: Thanks, Steve, but another problem: [snip] void main() { |___writeln(g(f)(1)); } writeln(g(&f)(1)); Unlike C, you *must* take the address of a function symbol to g

Re: Higher-order functions?

2012-04-11 Thread H. S. Teoh
On Wed, Apr 11, 2012 at 07:29:20PM +0200, Jonas H. wrote: > Wow, thanks for all the answers! Seems to be a great community here. Welcome to the community! :-) > What do you guys think about adding the term "anonymous functions" > to the frontpage and features page? I think that one's a lot more

Re: Higher-order functions?

2012-04-11 Thread Jonas H.
Wow, thanks for all the answers! Seems to be a great community here. What do you guys think about adding the term "anonymous functions" to the frontpage and features page? I think that one's a lot more comman than "delegates" (even if it's not exactly the same thing).

Re: Dear ChrisMiller: This is day 4 of me trying to Compile a (tutorial) myForm.d program with D/Dfl/Entice.

2012-04-11 Thread vmars316
On Tuesday, 10 April 2012 at 22:31:44 UTC, Andrej Mitrovic wrote: On 4/10/12, vmars316 wrote: On Tuesday, 10 April 2012 at 20:07:41 UTC, Andrej Mitrovic You can use the zip download: https://github.com/Rayerd/dfl/zipball/master A couple years ago i learned HotBasic. An awesome language. (ww

Re: stdout redirect

2012-04-11 Thread Stefan
On Wednesday, 11 April 2012 at 13:00:45 UTC, Andrea Fontana wrote: On Wednesday, 11 April 2012 at 12:46:30 UTC, Andrea Fontana wrote: How can I redirect stdout / stderr to file (from D not shell)? Self-reply: It works using std.c way: import std.cstream; std.c.stdio.freopen(args[4].ptr, "w+"

Re: D Dll injection problem

2012-04-11 Thread Kagamin
On Wednesday, 11 April 2012 at 13:26:23 UTC, maarten van damme wrote: the code I use for injecting is /** * injectDLL injects a dll in a given process using the CreateRemoteThread function. * * arguments: * HANDLE proc = A HANDLE to the process * string dllName = A string containting the nam

Re: D Dll injection problem

2012-04-11 Thread Kagamin
On Wednesday, 11 April 2012 at 13:26:23 UTC, maarten van damme wrote: I went ahead and went back to as far as 2.045 and I still couldn't get a working dll. This would suggest something is wrong with my dll injection code but I've tested with a few other random dll's and that appears to work. ac

Re: D Dll injection problem

2012-04-11 Thread maarten van damme
I went ahead and went back to as far as 2.045 and I still couldn't get a working dll. This would suggest something is wrong with my dll injection code but I've tested with a few other random dll's and that appears to work. according to my debugger the problem is an access violation while executing

Re: stdout redirect

2012-04-11 Thread Andrea Fontana
On Wednesday, 11 April 2012 at 12:46:30 UTC, Andrea Fontana wrote: How can I redirect stdout / stderr to file (from D not shell)? Self-reply: It works using std.c way: import std.cstream; std.c.stdio.freopen(args[4].ptr, "w+", dout.file); std.c.stdio.freopen(args[4].ptr, "w+", derr.file);

Re: Passing function as values and returning functions

2012-04-11 Thread Steven Schveighoffer
On Wed, 11 Apr 2012 08:53:00 -0400, Xan wrote: Thanks, Steve, but another problem: [snip] void main() { |___writeln(g(f)(1)); } writeln(g(&f)(1)); Unlike C, you *must* take the address of a function symbol to get a function pointer. -Steve

Re: Passing function as values and returning functions

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 12:19:06 UTC, Steven Schveighoffer wrote: On Wed, 11 Apr 2012 08:08:44 -0400, Xan wrote: On Wednesday, 11 April 2012 at 11:59:14 UTC, Jacob Carlborg wrote: Use "delegate" or "function" both for the argument type and return type. How to do that? int funct

stdout redirect

2012-04-11 Thread Andrea Fontana
How can I redirect stdout / stderr to file (from D not shell)?

Re: Passing function as values and returning functions

2012-04-11 Thread Steven Schveighoffer
On Wed, 11 Apr 2012 08:08:44 -0400, Xan wrote: On Wednesday, 11 April 2012 at 11:59:14 UTC, Jacob Carlborg wrote: Use "delegate" or "function" both for the argument type and return type. How to do that? int function(int) g(int function(int a) p) { return p; } Should do the trick. dele

Re: Passing function as values and returning functions

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 11:59:14 UTC, Jacob Carlborg wrote: On 2012-04-11 13:10, Xan wrote: Hi, Following the thread of Higher-order functions, how can I do to pass a function as a parameter and return a function. That is a something like: import std.functional, std.stdio; int f (in

Re: Passing function as values and returning functions

2012-04-11 Thread Jacob Carlborg
On 2012-04-11 13:10, Xan wrote: Hi, Following the thread of Higher-order functions, how can I do to pass a function as a parameter and return a function. That is a something like: import std.functional, std.stdio; int f (int a) { return 2*a; } int delegate (int) g(int function(int a) p) { ret

Passing function as values and returning functions

2012-04-11 Thread Xan
Hi, Following the thread of Higher-order functions, how can I do to pass a function as a parameter and return a function. That is a something like: import std.functional, std.stdio; int f (int a) { return 2*a; } int delegate (int) g(int function(int a) p) { return p; } void main() {

Re: Higher-order functions?

2012-04-11 Thread Xan
Apparently your compiler does not support parameter type deduction yet. void main () { writeln("add: ", someprocedure(2, 3, (int a, int b) { return a + b; })); writeln("multiply: ", someprocedure(2, 3, (int a, int b) { return a * b; })); } Yes, now it works! Thanks,

Re: Higher-order functions?

2012-04-11 Thread Timon Gehr
On 04/11/2012 11:51 AM, Xan wrote: On Wednesday, 11 April 2012 at 09:43:27 UTC, Timon Gehr wrote: On 04/11/2012 11:37 AM, Xan wrote: On Wednesday, 11 April 2012 at 09:17:12 UTC, Jacob Carlborg wrote: On 2012-04-11 10:45, Xan wrote: Good answer. For the other hand, what is the simplest method

Re: Higher-order functions?

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 10:14:21 UTC, Mirko Pilger wrote: What is the error? e.g. try this: auto someprocedure (int a, int b, int delegate (int, int) f) I receive the same error

Re: Higher-order functions?

2012-04-11 Thread Mirko Pilger
What is the error? e.g. try this: auto someprocedure (int a, int b, int delegate (int, int) f)

Re: Higher-order functions?

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 09:43:27 UTC, Timon Gehr wrote: On 04/11/2012 11:37 AM, Xan wrote: On Wednesday, 11 April 2012 at 09:17:12 UTC, Jacob Carlborg wrote: On 2012-04-11 10:45, Xan wrote: Good answer. For the other hand, what is the simplest method for implementing this (in pseucod

Re: Higher-order functions?

2012-04-11 Thread Timon Gehr
On 04/11/2012 11:37 AM, Xan wrote: On Wednesday, 11 April 2012 at 09:17:12 UTC, Jacob Carlborg wrote: On 2012-04-11 10:45, Xan wrote: Good answer. For the other hand, what is the simplest method for implementing this (in pseucode) in D: Sure: FUNC someprocedure(int a, int b, func f) int RETU

Re: Higher-order functions?

2012-04-11 Thread Xan
On Wednesday, 11 April 2012 at 09:17:12 UTC, Jacob Carlborg wrote: On 2012-04-11 10:45, Xan wrote: Good answer. For the other hand, what is the simplest method for implementing this (in pseucode) in D: Sure: FUNC someprocedure(int a, int b, func f) int RETURN f(a, b) } And call it with: I

Re: Higher-order functions?

2012-04-11 Thread Jacob Carlborg
On 2012-04-11 10:45, Xan wrote: Good answer. For the other hand, what is the simplest method for implementing this (in pseucode) in D: Sure: FUNC someprocedure(int a, int b, func f) int RETURN f(a, b) } And call it with: IO.writeLine("add: " .. someprocedure(2, 3, { a, b => a + b })) IO.writ

Re: Higher-order functions?

2012-04-11 Thread Xan
Good answer. For the other hand, what is the simplest method for implementing this (in pseucode) in D: Sure: FUNC someprocedure(int a, int b, func f) int RETURN f(a, b) } And call it with: IO.writeLine("add: " .. someprocedure(2, 3, { a, b => a + b })) IO.writeLine("multiply: " .. som