On 10.02.2010 14:41, daoryn wrote:
The buffer you are passing to receive is 0 bytes long. The
std.socket.Socket.receive function is a wrapper over the normal socket
function, and includes a test for an empty buffer.
Daniel
Ohh, I see. Thank you!
I thought that the function would
Alex wrote:
Is it possible, using templates, tuples, or some other mechanism, to
implement named variadic arguments in D?
For example, I'd like to be able to do something like...
foo( 2, bar, age : 10, status : down);
and so forth.
Yes, with a small hack.
typedef int age_type;
funog wrote:
The following code :
--
import std.stdio;
class A {
void foo(A a) {
writefln(A);
}
}
class B : A {
void foo(B b) {
writefln(B);
}
}
void main() {
B b = new B;
A a = b;
assert(a is b);
b.foo(b);
Nick Sabalausky wrote:
BCS n...@anon.com wrote in message
news:a6268ffc3898cc29d1f554d...@news.digitalmars.com...
Hello Nick,
So...is there any trickery I
could do so that SubFoo!(sam) and SubFoo!(sam, human) would
resolve to the same subclass of Foo?
Make a SubFoo!(char[] s) that does
an if-specific syntax.
Thank you for taking the time downs,
-- Justin
Anytime.
Justin Johansson wrote:
Daniel Keep Wrote:
Justin Johansson wrote:
There was mention** on the general discussion group that the D
foreach_reverse
language construct could be replaced (emulated?) with a (D) meta-program.
** Even a novice programmer can write a meta-program to replace
notna wrote:
Stewart Gordon schrieb:
The .ptr is necessary, but the cast(uint) isn't. Even if a change of
type were necessary, just 1U would do. (U is a suffix meaning
unsigned. There's also L meaning long.)
Stewart.
Thank Stewart.
As the std.md5-example is not working with unicode
Stewart Gordon wrote:
downs wrote:
snip
while (auto len = file.readBlock(buffer.ptr, buffer.sizeof))
snip
md5_example_2.d(7): expression expected, not 'auto'
md5_example_2.d(7): found 'len' when expecting ')'
md5_example_2.d(7): found '=' instead of statement
(this is line 7 after I
bearophile wrote:
I don't know much C++. Can CRTP be used in D1 too, to improve the performance
of some D1 code?
http://en.wikipedia.org/wiki/Curiously_Recurring_Template_Pattern
Bye,
bearophile
We have this, except we call it template mixin :)
downs wrote:
Jarrett Billingsley wrote:
On Sun, Jul 5, 2009 at 5:44 AM, downsdefault_357-l...@yahoo.de wrote:
Doctor J wrote:
I want to write an interface that expresses the following idea: classes
implementing this interface must have a void function named update, with a
fixed
Doctor J wrote:
I want to write an interface that expresses the following idea: classes
implementing this interface must have a void function named update, with a
fixed but indeterminate number of parameters of the same (template parameter)
type.
Use a typesafe variadic function, i.e.
novice2 wrote:
does anyone know: is D2 std.bitmanip compatible with C bitfields?
can i use it, if i need translate .h file with something like this:
typedef struct {
unsigned int can_compress : 1;
unsigned int can_uncompress : 1;
unsigned int can_get_info : 1;
unsigned int
Saaa wrote:
I can't figure out how to create the IndexArray function,
it should work on arrays of any depth
int[][][] array; //any depth
array.length=10;
array[1].length=3;
array[1][2].length=4;
array[1][2][1]=99;
writefln(array);
//[[],[[],[],[0,99,0,0]],[],[],[],[],[],[],[],[]]
Saaa wrote:
Thanks!
I thought about the idea of just creating the code and mix it in, but now I
can see why I failed at that: Your code is kind of read-only to me, for now,
because I need to change it a bit to accept an array instead of seperat
indices.
Wouldn't it be nice if it worked
Saaa wrote:
Is there a function to check whether some string is a legal identifier?
Sure.
static if(is(typeof({ /* code to be checked for validity goes here */ }))) ...
reimi gibbons wrote:
downs Wrote:
reimi gibbons wrote:
im failry new to D, is there any D library project with support for SQLite,
if not is there any guide so i can integrate sqlite amalgamated c source
(sqlite3.c, sqlite3.h) into my D code.
tools.sqlite3 might work for you. Ask me
reimi gibbons wrote:
im failry new to D, is there any D library project with support for SQLite,
if not is there any guide so i can integrate sqlite amalgamated c source
(sqlite3.c, sqlite3.h) into my D code.
tools.sqlite3 might work for you. Ask me if you have any questions about it.
to mention the 'T' word for fear of Downs accusing me
of proselytizing.
:snort:
I do agree in this case. I just don't like it when Tango is proposed as an
alternative and the existence of a perfectly valid Phobos solution is ignored.
Jimi_Hendrix wrote:
Hi, I am new to D but not to programming. I have had some socket experience
before. How would i connect to a server using sockets in D? A link to a D
socket tutorial (if one exists) would also be appreciated.
by the way, first post to a newsgroup for me
As certain
BCS wrote:
Hello BCS,
I have a program that runs an easily parallelizable loop. When I run
it as a single thread it only takes about 10% longer than 2 threads
(on a dual-core). I'm trying to track down the lossed time and am
wondering if turning on -profile is even worth looking at. The
The Anh Tran wrote:
Hi,
When porting from c++ to D, i encounter this strange discrimination:
1. Built-in AA:
int[int] arr;
arr[123] += 12345;
arr[321]++;
2. Tango HashMap:
auto hm = new HashMap!(int, int)();
hm[123] += 12345; // error not lvalue
hm[123]++;
BCS wrote:
Reply to Jarrett,
On Fri, Feb 27, 2009 at 9:01 AM, Qian Xu quian...@stud.tu-ilmenau.de
wrote:
Hi All,
Is there any way to keep program alive, when an AV takes place?
It's possible on Windows in D, but that's because Windows reports
segfaults with the same mechanism that D
downs wrote:
jicman wrote:
Greetings.
Sorry guys, please be patient with me. I am having a hard time
understanding this Unicode, ANSI, UTF* ideas. I know how to get an UTF8
File and turn it into ANSI. and I know how to take a ANSI file and turn it
into an UTF file. But, now I have
Jarrett Billingsley wrote:
On Sat, Jan 10, 2009 at 12:30 AM, Jarrett Billingsley
jarrett.billings...@gmail.com wrote:
On Sat, Jan 10, 2009 at 12:18 AM, yes y...@no.com wrote:
Does Phobos also do threadpools?
From what I understand, not without modification. At least, not
efficiently. Downs
24 matches
Mail list logo