I have a question about this example code;
import std.stdio;
string getByName(string name)
{
return smth;
}
template getByName(string name)
{
enum
//string
getByName = getByName(name);
}
void main()
{
writeln(getByName!(name));
}
This produces
A bit late, but you should also be able to do:
import scriptlike;
alias Config = std.process.Config;
On Thursday, 26 June 2014 at 17:07:30 UTC, JJDuck wrote:
On Thursday, 26 June 2014 at 16:33:57 UTC, JJDuck wrote:
I tried to use phobos , but there is no such function exists
for posting to https too
With Phobos, you can use
http://dlang.org/phobos/std_net_curl.html#post. Depending on
On 2014-06-29 06:47, Jeremy Sorensen wrote:
I found an example of boilerplate code for Win32 programming in D here:
http://wiki.dlang.org/D_for_Win32
I have some questions.
1. It appears that the call to myWinMain from WinMain is to ensure that
any exception or error is caught. At first glance
On Sunday, 29 June 2014 at 07:16:10 UTC, Uranuz wrote:
Is there any reason why function and template conflict. They
using different syntax to *call*. For template we have *!* but
for function we don't have it. So why compiler is not able to
see the difference?
I suspect this is by design.
import std.stdio;
string getByName(string name)
{
return smth;
}
template getByName(string name)
{
enum getByName = .getByName(name);
}
void main()
{
writeln(getByName!(name));
}
Thanks a lot! Very interesting. Do you see any reasoning why this
happens?
On Sunday, 29 June 2014 at 08:52:36 UTC, Uranuz wrote:
import std.stdio;
string getByName(string name)
{
return smth;
}
template getByName(string name)
{
enum getByName = .getByName(name);
}
void main()
{
writeln(getByName!(name));
}
Thanks a lot! Very interesting.
On 06/29/2014 11:31 AM, Rene Zwanenburg wrote:
On Sunday, 29 June 2014 at 08:52:36 UTC, Uranuz wrote:
import std.stdio;
string getByName(string name)
{
return smth;
}
template getByName(string name)
{
enum getByName = .getByName(name);
}
void main()
{
writeln(getByName!(name));
I am trying to define custom format specifiers (as described here [1])
for the following wrapper struct :
import std.stdio;
import std.format: formattedWrite, FormatSpec;
import std.string: format;
struct wrapper(T) {
private T val;
public this(T newVal) pure { val = newVal;
On 06/29/2014 04:55 AM, Element 126 wrote:
I've certainly missed something
formatValue passes your tests:
import std.stdio;
import std.format: formattedWrite, FormatSpec, formatValue;
import std.string: format;
struct wrapper(T) {
private T val;
public this(T newVal) pure { val =
On Sunday, 29 June 2014 at 07:51:50 UTC, Jacob Carlborg wrote:
You don't need to use WinMain. You can use a plain D main
function and add the -L/SUBSYSTEM:WINDOWS:4.0 link flag to
suppress the console. There are API's to get access to the
arguments passed to WinMain, if necessary.
OK so I
The only question I have is what happens when you use
SUBSYSTEM:WINDOWS:4.0 (Which I understand means XP or higher)
and the program runs on something older?
WinXP is dead :)
On 06/29/2014 04:22 PM, Ali Çehreli wrote:
On 06/29/2014 04:55 AM, Element 126 wrote:
I've certainly missed something
formatValue passes your tests:
import std.stdio;
import std.format: formattedWrite, FormatSpec, formatValue;
import std.string: format;
struct wrapper(T) {
private T
On 2014-06-29 17:06, Jeremy Sorensen wrote:
The only question I
have is what happens when you use SUBSYSTEM:WINDOWS:4.0 (Which I
understand means XP or higher) and the program runs on something older?
Will you get an error message or just silent failure?
Actually, I don't know. You could try
Hello, I have a compile error when trying to use GtkD 2.3.3. When
I try to create a FileChooseDialog, I call
new FileChooserDialog(Save File,
editor.drawingArea.getParent().getParentWindow(),
FileChooserAction.SAVE,
[OK,
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
Hi,
I have a linux network and i would like to know if they are a D
library to communicate between computer efficiently.
I do not know if that is better to use websocket and if they
exists into dlang:
-
On Sun, Jun 29, 2014 at 06:08:24PM +0200, Element 126 via Digitalmars-d-learn
wrote:
[...]
I have used formattedWrite for months without noticing formatValue,
even though it was on the wiki.
Maybe I should add an example to the documentation of std.format.
formatValue is present but without
Suppose I have a C library which implements a function for
several types. C doesn't have overloading, so their names will be
distinct.
extern(C):
double foo_double(double);
float foo_float(float);
Now I want to build a D wrapper, and merge them into a single
function with overloading:
T
On Sun, 29 Jun 2014 22:24:09 -0400, David Bregman d...@sfu.ca wrote:
Suppose I have a C library which implements a function for several
types. C doesn't have overloading, so their names will be distinct.
extern(C):
double foo_double(double);
float foo_float(float);
Now I want to build a D
On Sunday, 29 June 2014 at 07:28:12 UTC, Kapps wrote:
A bit late, but you should also be able to do:
import scriptlike;
alias Config = std.process.Config;
Thanks, so an alias or an additional single symbol import will
shadow the earlier imported symbol. That's fine for me :-)
On Monday, 30 June 2014 at 02:24:10 UTC, David Bregman wrote:
Suppose I have a C library which implements a function for
several types. C doesn't have overloading, so their names will
be distinct.
extern(C):
double foo_double(double);
float foo_float(float);
Now I want to build a D wrapper,
On Monday, 30 June 2014 at 04:50:05 UTC, Kenji Hara wrote:
In D, you can merge arbitrary overloads by using alias
declaration.
Oh wow, you are right. That's a nice feature!
I guess I simplified too much for the sake of making the post,
the functions I would actually like to merge are
On Sunday, 29 June 2014 at 18:16:05 UTC, Jacob Carlborg wrote:
On 2014-06-29 17:06, Jeremy Sorensen wrote:
The only question I
have is what happens when you use SUBSYSTEM:WINDOWS:4.0 (Which
I
understand means XP or higher) and the program runs on
something older?
Will you get an error
On Sunday, 29 June 2014 at 07:51:50 UTC, Jacob Carlborg wrote:
You don't need to use WinMain. You can use a plain D main
function and add the -L/SUBSYSTEM:WINDOWS:4.0 link flag to
suppress the console. There are API's to get access to the
arguments passed to WinMain, if necessary.
Thanks
24 matches
Mail list logo