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, funcint, int: int f) int
RETURN f(a, b)
}
And call it with:
IO.writeLine(add: .. someprocedure(2, 3, { a, b = a + b }))
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, funcint, int: int f) int
RETURN f(a, b)
}
And call it with:
IO.writeLine(add: .. someprocedure(2, 3, { a, b = a + b
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, funcint, int: int f) int
RETURN f(a, b)
}
And
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, funcint, int:
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
What is the error?
e.g. try this:
auto someprocedure (int a, int b, int delegate (int, int) f)
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
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
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,
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()
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) {
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
On Wed, 11 Apr 2012 08:08:44 -0400, Xan xancor...@gmail.com 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
How can I redirect stdout / stderr to file (from D not shell)?
On Wednesday, 11 April 2012 at 12:19:06 UTC, Steven Schveighoffer
wrote:
On Wed, 11 Apr 2012 08:08:44 -0400, Xan xancor...@gmail.com
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
On Wed, 11 Apr 2012 08:53:00 -0400, Xan xancor...@gmail.com 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
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);
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
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.
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
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+,
On Tuesday, 10 April 2012 at 22:31:44 UTC, Andrej Mitrovic wrote:
On 4/10/12, vmars316 vmars...@live.com 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
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).
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
On Wednesday, 11 April 2012 at 13:04:01 UTC, Steven Schveighoffer
wrote:
On Wed, 11 Apr 2012 08:53:00 -0400, Xan xancor...@gmail.com
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
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
On 4/11/12, vmars316 vmars...@live.com 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
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
On 4/11/12, Xan xancor...@gmail.com 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
On Wed, 11 Apr 2012 15:33:56 -0400, Xan xancor...@gmail.com 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
* Mike Parker aldac...@gmail.com [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 Davisjmdavisp...@gmx.com wrote:
Posix positional arguments seem to work for writefln but not format for
whatever reason.
On Wednesday, 11 April 2012 at 18:39:40 UTC, Andrej Mitrovic
wrote:
On 4/11/12, vmars316 vmars...@live.com 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) :
On 4/12/12, vmars316 vmars...@live.com wrote:
What is looking for? *import* something?
Remove the space between '-I' and the import path.
33 matches
Mail list logo