http://dlang.org/phobos/std_stdio.html:
void write(S...)(S args);
Writes its arguments in text format to the file.
1)
Feeding arguments in text format into the search-function for the whole
site does not give a hint to `toString'.
What am I missing?
2)
to the file ... which file?
On Monday, 29 July 2013 at 06:17:10 UTC, Manfred Nowak wrote:
http://dlang.org/phobos/std_stdio.html:
void write(S...)(S args);
Writes its arguments in text format to the file.
1)
Feeding arguments in text format into the search-function for
the whole
site does not give a hint to
Here is a optimal generic string joiner that maximizes compiler
optimization, allows for a variable number of arguments that can
be strings or arrays of strings.
http://dpaste.dzfl.pl/0a021e1f
Drawbacks:
1. Static if explosion
2. Not elegant
3. Only works with RT strings or RT
On Monday, 29 July 2013 at 09:01:36 UTC, JS wrote:
Here is a optimal generic string joiner that maximizes compiler
optimization, allows for a variable number of arguments that
can be strings or arrays of strings.
http://dpaste.dzfl.pl/0a021e1f
Drawbacks:
1. Static if explosion
2. Not
Hello!
This is partially a general question as I don't know what this is
called or if it exists. Say for example I want to do something
like the following -
import std.concurrency;
void main()
{
void foo() {
try
{
while(true)
{
On Monday, 29 July 2013 at 15:28:45 UTC, lindenk wrote:
Hello!
This is partially a general question as I don't know what this
is called or if it exists. Say for example I want to do
something like the following -
import std.concurrency;
void main()
{
void foo() {
try
{
void foo(Tid parent) {
bool run = true;
while(run)
{
//do_some_blocking_function();
receiveTimeout(dur!msecs(0),
(string s){if(s == STAHP!) run = false;}
);
}
// clean up
send(parent, done);
}
void main()
{
auto tid =
if I have something like
template t(args...)
{
pragma(msg, args);
}
it prints out args in a tuple... e.g.,
tuple!(...)
I do not want it to print out the tuple!().
I can write my own pragma and pass each arg to it (e.g.,
pragma(msg, arg[0], arg[1], ...)) but this is not very general
and
After a bit more research it looks like everyone else uses -
while(checkIfRunning())
{
// block with timeout
}
which leads me to believe this might not be possible or standard.
Although, should something along the lines of this be possible?
Process p = new Process();
p.doTask(p.func());
On Jul 29, 2013, at 8:28 AM, lindenk ztaticn...@gmail.com wrote:
Ah, no I mean, what if do_some_blocking_function blocks for some
indeterminate amount of time. I would like it to exit even when it is
currently blocking (as it could be unpredictable when it will stop blocking).
Execute the
On Monday, 29 July 2013 at 16:57:49 UTC, JS wrote:
if I have something like
template t(args...)
{
pragma(msg, args);
}
it prints out args in a tuple... e.g.,
tuple!(...)
I do not want it to print out the tuple!().
I can write my own pragma and pass each arg to it (e.g.,
pragma(msg,
On Jul 29, 2013, at 10:07 AM, lindenk ztaticn...@gmail.com wrote:
After a bit more research it looks like everyone else uses -
while(checkIfRunning())
{
// block with timeout
}
which leads me to believe this might not be possible or standard. Although,
should something along the
On Monday, 29 July 2013 at 17:26:55 UTC, Sean Kelly wrote:
On Jul 29, 2013, at 10:07 AM, lindenk ztaticn...@gmail.com
wrote:
After a bit more research it looks like everyone else uses -
while(checkIfRunning())
{
// block with timeout
}
which leads me to believe this might not be possible
On Monday, 29 July 2013 at 16:19:03 UTC, lindenk wrote:
void foo(Tid parent) {
bool run = true;
while(run)
{
//do_some_blocking_function();
receiveTimeout(dur!msecs(0),
(string s){if(s == STAHP!) run = false;}
);
}
// clean up
send(parent,
I have a long named variable in a struct.
For example let's name that longnamedstruct.longnamedmember
I need to use that variable in many places of the code and i
cannot create the copy of it.
In c++ i can
auto v = longnamedstruct.longnamedmember;
Now i can use v anywhere.
Why i cannot
On Monday, 29 July 2013 at 21:13:54 UTC, Temtaime wrote:
I have a long named variable in a struct.
For example let's name that longnamedstruct.longnamedmember
I need to use that variable in many places of the code and i
cannot create the copy of it.
In c++ i can
auto v =
No, i cannot.
struct S {
uint longnamed;
}
void main() {
S somestruct;
alias v = somestruct.longnamed;
writeln(v);
}
Error: need 'this' for 'longnamed' of type 'uint'
Is it a bug ?
Temtaime:
I have a long named variable in a struct.
For example let's name that longnamedstruct.longnamedmember
I need to use that variable in many places of the code and i
cannot create the copy of it.
You can shorten the outer name with an alias or remove it with
a with() statement.
__FUNCTION__ does not return anything when used in templates.
For debugging purposes I sometimes use pragma(msg,
template_name); (with template_name being the name of the
template assigned an enum)
I would like to make this more general such as
pragma(msg, mixin(__FUNCTION_NAME__));
e.g.,
I have created a template Pragma that emulates pragma but better,
the problem is that I have to assign it to something which is
very redundant in my code:
enum temp = Pragma!(msg)
e.g.,
template Pragma(alias amsg)
{
string Pragma(string file = __FILE__)
{
pragma(msg, amsg);
On Monday, 29 July 2013 at 23:09:20 UTC, JS wrote:
I have created a template Pragma that emulates pragma but
better, the problem is that I have to assign it to something
which is very redundant in my code:
enum temp = Pragma!(msg)
e.g.,
template Pragma(alias amsg)
{
string Pragma(string
On Tuesday, 30 July 2013 at 01:06:39 UTC, Meta wrote:
Does this code do what you want, or are there other
requirements as well?
void Pragma(alias amsg)(string file = __FILE__)
{
pragma(msg, amsg);
}
Actually, sorry, that's the exact same code, just with some
syntactic sugar. To
On Monday, 29 July 2013 at 21:37:30 UTC, bearophile wrote:
Temtaime:
Why i cannot declare reference in D ?
I don't know the reasons. But maybe you can create a little
struct with just a pointer inside and an alias this to a member
function that returns a ref.
Bye,
bearophile
It doesn't
On Monday, 29 July 2013 at 23:02:57 UTC, JS wrote:
__FUNCTION__ does not return anything when used in templates.
For debugging purposes I sometimes use pragma(msg,
template_name); (with template_name being the name of the
template assigned an enum)
I would like to make this more general
On Monday, 29 July 2013 at 21:25:21 UTC, Temtaime wrote:
No, i cannot.
struct S {
uint longnamed;
}
void main() {
S somestruct;
alias v = somestruct.longnamed;
writeln(v);
}
Error: need 'this' for 'longnamed' of type 'uint'
Is it a bug ?
Oh, that is
25 matches
Mail list logo