thanks for your reply. its a shame that the language does not
supply ready to use headers. i can live with missing libraries,
but not with incomplete or non working bare minimal prerequisites
to use it with an os.
that is a sad and sorry state!
On Thursday, 12 December 2013 at 05:30:29 UTC, ev
Thanks, I think the std.concurrency code demonstrates exactly
what I need :)
On Thursday, 12 December 2013 at 05:07:11 UTC, Ali Çehreli wrote:
On 12/11/2013 06:43 PM, Maxime Chevalier-Boisvert wrote:
> Is it possible to template based on a function pointer
argument? If so,
> is it possible to
On Wednesday, 11 December 2013 at 09:04:32 UTC, frustrated2 wrote:
Are there complete windows headers and if yes where can i find
them and will they work for 64bit?
there is mostly complete headers[1], however it is not and never
be ready for x64.
also there is Andrej Mitrovic's fork[2] of t
On 12/11/2013 06:43 PM, Maxime Chevalier-Boisvert wrote:
> Is it possible to template based on a function pointer argument? If so,
> is it possible to use static ifs to know the return type or the argument
> types of the function pointer's signature, as well as how many arguments
> it takes?
Tha
On Tuesday, 10 December 2013 at 03:42:10 UTC, Malkierian wrote:
On Tuesday, 10 December 2013 at 02:05:12 UTC, Jeremy DeHaan
wrote:
On Monday, 9 December 2013 at 16:49:04 UTC, Malkierian wrote:
On Monday, 9 December 2013 at 08:57:16 UTC, Jeremy DeHaan
wrote:
On Monday, 9 December 2013 at 06:32:
Timothee Cour:
void fun(int[3]) {}
void main() {
int[3] x = [1, 2, 3];
fun(x); // OK
fun([1, 2, 3]); // error
fun([1, 2, 3]s); // OK
}
Sorry, there's no error there.
yes, that was the prime motivation for DIP34,
It seems Hara has received your message:
https://d.puremagic.
I'd like to know if it's possible to create a templated function
that takes a function pointer as an argument, and uses static ifs
to generate different behaviors based on the type signature of
the function pointer.
More specifically, I want to create code generation functions for
my JIT comp
On Wed, Dec 11, 2013 at 5:17 PM, bearophile wrote:
> Namespace:
>
> Your gig: https://github.com/D-Programming-Language/dmd/pull/
>> 2952#discussion_r8288045
>>
>
> My enhancement request was for the array[$] syntax. The idea of []s was
> invented by someone else (Timothee Cour?).
>
> I like the
Namespace:
Your gig:
https://github.com/D-Programming-Language/dmd/pull/2952#discussion_r8288045
My enhancement request was for the array[$] syntax. The idea of
[]s was invented by someone else (Timothee Cour?).
I like the practical comments by Hara. If Kenji thinks the []s is
not useful f
Ali Çehreli:
> int[] arr2 = [7, 8, 9]s;
> assert(is(typeof(arr2) == int[3]));
That looks very confusing. The left-hand side looks like a
slice, which I can append elements to but its type is a static
array?
No, the type of the literal is of a fixed-side array, but it gets
assigne
On Wednesday, 11 December 2013 at 23:20:30 UTC, bearophile wrote:
Namespace:
I'm pretty nervous, but here is the first:
https://github.com/D-Programming-Language/dmd/pull/2952
Good. Keep in mind that at best it will take a month or more
for your patch to be accepted. Also patches that implem
On Wednesday, 11 December 2013 at 23:42:44 UTC, Gary Willoughby
wrote:
For example i have some C code like this:
typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData
clientData, Tcl_Interp *interp));
void Tcl_CallWhenDeleted(Tcl_Interp* interp,
Tcl_InterpDeleteProc* proc, ClientData c
On Thu, Dec 12, 2013 at 12:54:58AM +0100, Gary Willoughby wrote:
> On Wednesday, 11 December 2013 at 23:38:13 UTC, Adam D. Ruppe wrote:
> >On Wednesday, 11 December 2013 at 23:35:04 UTC, Gary Willoughby
> >wrote:
> >> static union internalRep
> >
> >
> >try
> >
> >static union InternalRep { /* no
On Wednesday, 11 December 2013 at 23:38:13 UTC, Adam D. Ruppe
wrote:
On Wednesday, 11 December 2013 at 23:35:04 UTC, Gary Willoughby
wrote:
static union internalRep
try
static union InternalRep { /* note the capital letter */
/* snip */
}
InternalRep internalRep;; // still need a decl
Adam D. Ruppe:
Well, you can if it is anonymous.
struct Foo {
union {
struct { ubyte a; ubyte b; }
ubyte[2] arr;
}
}
That works in D, and it makes foo.a == arr[0] and foo.b ==
arr[1];
Right :-) I like D structs.
Bye,
bearophile
For example i have some C code like this:
typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData
clientData, Tcl_Interp *interp));
void Tcl_CallWhenDeleted(Tcl_Interp* interp,
Tcl_InterpDeleteProc* proc, ClientData clientData);
I intend on converted this to D thus:
alias void functio
On Wednesday, 11 December 2013 at 23:36:11 UTC, bearophile wrote:
In D you can't define a struct/union and use it to define an
instance on the fly.
Well, you can if it is anonymous.
struct Foo {
union {
struct { ubyte a; ubyte b; }
ubyte[2] arr;
}
}
That works in D, an
Gary Willoughby:
Have you got an example because i always get:
tcl.d(713): Error: no identifier for declarator twoPtrValue
tcl.d(718): Error: no identifier for declarator ptrAndLongRep
tcl.d(719): Error: no identifier for declarator internalRep
In D you can't define a struct/union and use it
On Wednesday, 11 December 2013 at 23:35:04 UTC, Gary Willoughby
wrote:
static union internalRep
try
static union InternalRep { /* note the capital letter */
/* snip */
}
InternalRep internalRep;; // still need a decl
On Wednesday, 11 December 2013 at 23:27:57 UTC, Gary Willoughby
wrote:
On Wednesday, 11 December 2013 at 23:12:39 UTC, bearophile
wrote:
Adam D. Ruppe:
Nested structs and unions like in your example are supported
in D too, same syntax, same effect.
But don't forget to add to use "static stru
On Wednesday, 11 December 2013 at 23:12:39 UTC, bearophile wrote:
Adam D. Ruppe:
Nested structs and unions like in your example are supported
in D too, same syntax, same effect.
But don't forget to add to use "static struct" instad of
"struct".
Bye,
bearophile
Have you got an example bec
Namespace:
I'm pretty nervous, but here is the first:
https://github.com/D-Programming-Language/dmd/pull/2952
Good. Keep in mind that at best it will take a month or more for
your patch to be accepted. Also patches that implement basic
language features like this pass a stringent process of
Adam D. Ruppe:
Nested structs and unions like in your example are supported in
D too, same syntax, same effect.
But don't forget to add to use "static struct" instad of "struct".
Bye,
bearophile
On Wednesday, 11 December 2013 at 22:54:04 UTC, Adam D. Ruppe
wrote:
Nested structs and unions like in your example are supported in
D too, same syntax, same effect.
Actually, no, not quite the same syntax, I didn't notice the name
at the end of the C one (in D, the anonymous nested structs an
On Wednesday, 11 December 2013 at 22:45:35 UTC, Gary Willoughby
wrote:
How to handle nested structs when converting C headers?
Nested structs and unions like in your example are supported in D
too, same syntax, same effect.
How to handle nested structs when converting C headers?
In the following snippet i'm currently converting, how would you
convert the nested typed union and structures? Would you declare
them separately then use their types in the Tcl_Obj struct? or is
there a nice way in D to nest them like C?
On Wednesday, 11 December 2013 at 20:50:01 UTC, bearophile wrote:
Namespace:
I'm unsure. I'm not that familiar with dmd at all, so maybe
some more advanced guy like Kenji should review my code and
create an own, better pull.
In that code there is both the [$] and the []s syntaxes. So
it's b
On Wednesday, December 11, 2013 10:34:29 Timothee Cour wrote:
> yes, I agree sorting should be explicit as there's no natural order.
> However sorting after calling dirEntries is not great as typically one
> wants to sort within a given directory level and it's too late to sort once
> all the direc
Namespace:
I'm unsure. I'm not that familiar with dmd at all, so maybe
some more advanced guy like Kenji should review my code and
create an own, better pull.
In that code there is both the [$] and the []s syntaxes. So it's
better to submit them as two separated pull requests for the D
fron
On Wednesday, 11 December 2013 at 18:34:54 UTC, Timothee Cour
wrote:
yes, I agree sorting should be explicit as there's no natural
order.
However sorting after calling dirEntries is not great as
typically one
wants to sort within a given directory level and it's too late
to sort once
all the d
On Wednesday, 11 December 2013 at 19:51:24 UTC, bearophile wrote:
Namespace:
void main() {
int[] arr0 = [1, 2, 3];
assert(is(typeof(arr0) == int[]));
assert(arr0 == [1, 2, 3]);
int[3] arr1 = [4, 5, 6]s;
assert(is(typeof(arr1) == int[3]));
assert(
Namespace:
void main() {
int[] arr0 = [1, 2, 3];
assert(is(typeof(arr0) == int[]));
assert(arr0 == [1, 2, 3]);
int[3] arr1 = [4, 5, 6]s;
assert(is(typeof(arr1) == int[3]));
assert(arr1 == [4, 5, 6]);
int[] arr2 = [7, 8, 9]s;
asser
On Wednesday, 11 December 2013 at 18:31:20 UTC, Namespace wrote:
On Wednesday, 11 December 2013 at 16:28:39 UTC, Chris Cain
wrote:
On Wednesday, 11 December 2013 at 09:49:13 UTC, Namespace
wrote:
On Wednesday, 11 December 2013 at 04:01:11 UTC, Ali Çehreli
wrote:
On 12/10/2013 04:37 PM, Namespa
On Wednesday, 11 December 2013 at 15:34:25 UTC, Ary Borenszweig
wrote:
On 12/11/13 8:05 AM, bioinfornatics wrote:
On Wednesday, 11 December 2013 at 11:00:40 UTC, QAston wrote:
On Wednesday, 11 December 2013 at 10:49:43 UTC,
bioinfornatics wrote:
Hi,
Little question,
I'm looking a jdbc like in
In theory this should be caught by writefln constraint before
the linker. Probably I can turn this into a small enhancement
request.
On the other hand if you care about this it's better for you to
open the ER.
Bye,
bearophile
On Wednesday, 11 December 2013 at 10:10:11 UTC, qznc wrote:
On Tuesday, 10 December 2013 at 17:50:45 UTC, Torje Digernes
wrote:
http://pastie.org/8542555
Compositing an class via curry fails when I try to use
interfaces.
Guessing that this is due to when classes are validated for
interface i
FreeSlave:
By the way, why does writeln able to print this struct? It has
no toString() method and its data is private. How does writeln
have access to it?
writeln is able to print structs that don't have a toString, this
is very handy in most cases. When you don't want it, there's
@disable
On Wednesday, 11 December 2013 at 16:28:39 UTC, Chris Cain wrote:
On Wednesday, 11 December 2013 at 09:49:13 UTC, Namespace wrote:
On Wednesday, 11 December 2013 at 04:01:11 UTC, Ali Çehreli
wrote:
On 12/10/2013 04:37 PM, Namespace wrote:
>int[] arr2 = [7, 8, 9]s;
>assert(is(typeof(arr
yes, I agree sorting should be explicit as there's no natural order.
However sorting after calling dirEntries is not great as typically one
wants to sort within a given directory level and it's too late to sort once
all the directory levels are flattened.
so how about having an extra argument that
Code:
module vector;
import std.stdio;
import std.traits;
struct SVector(size_t dim, T = float)
{
private:
T[dim] _arr;
public:
alias dim dimension;
alias dim size;
this(this)
{
debug(SVector)
writeln("postblit constructor");
}
this(const T[dim]
On 11/12/13 11:10, John Colvin wrote:
A lot of the performance loss is down to missed optimisations, in particular
inlining.
Simple example:
foreach(i; iota(0, 10)) { ... }
should be as fast as
foreach(i; 0 .. 10) { ... }
but isn't. I remember Andrei noting that this ought to be ea
On Wednesday, 11 December 2013 at 09:49:13 UTC, Namespace wrote:
On Wednesday, 11 December 2013 at 04:01:11 UTC, Ali Çehreli
wrote:
On 12/10/2013 04:37 PM, Namespace wrote:
> int[] arr2 = [7, 8, 9]s;
> assert(is(typeof(arr2) == int[3]));
That looks very confusing. The left-hand side lo
On 12/11/13 8:05 AM, bioinfornatics wrote:
On Wednesday, 11 December 2013 at 11:00:40 UTC, QAston wrote:
On Wednesday, 11 December 2013 at 10:49:43 UTC, bioinfornatics wrote:
Hi,
Little question,
I'm looking a jdbc like in D ?
Does this exists ?
Thanks
https://github.com/buggins/ddbc - see
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote:
I'd like to use cython to wrap a D library. It's possible to do
this with a statically compiled C library, but it fails when I
try with a statically compiled D library. Any suggestions on
how to do this successfully?
1) have you decla
On Wednesday, 11 December 2013 at 11:41:11 UTC, Chris wrote:
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote:
I'd like to use cython to wrap a D library. It's possible to
do this with a statically compiled C library, but it fails
when I try with a statically compiled D library. Any
s
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote:
I'd like to use cython to wrap a D library. It's possible to do
this with a statically compiled C library, but it fails when I
try with a statically compiled D library. Any suggestions on
how to do this successfully?
Have you had a lo
Marco Leise:
return s.chunks(2).map!(
c => [cast(char)c.dropOne.front, cast(char)c.front]
).join;
So I would use the second version offered by bearophile:
auto result = new char[s.length];
foreach (immutable i, ref c; result)
c = s[i + (i & 1 ? -1 : 1)];
return result;
I can
On Wednesday, 11 December 2013 at 11:00:40 UTC, QAston wrote:
On Wednesday, 11 December 2013 at 10:49:43 UTC, bioinfornatics
wrote:
Hi,
Little question,
I'm looking a jdbc like in D ?
Does this exists ?
Thanks
https://github.com/buggins/ddbc - see readme for more info.
Cool thanks, i will
On Wednesday, 11 December 2013 at 10:49:43 UTC, bioinfornatics
wrote:
Hi,
Little question,
I'm looking a jdbc like in D ?
Does this exists ?
Thanks
https://github.com/buggins/ddbc - see readme for more info.
Hi,
Little question,
I'm looking a jdbc like in D ?
Does this exists ?
Thanks
On Wednesday, 11 December 2013 at 07:29:39 UTC, Frustrated wrote:
Has anyone done any work on comparing the performance of ranges
vs using direct straightforward code(optimized in the sense of
the way ranges work but by hand).
e.g., How does filter compare to a simple loop over the
elements
On Tuesday, 10 December 2013 at 17:50:45 UTC, Torje Digernes
wrote:
http://pastie.org/8542555
Compositing an class via curry fails when I try to use
interfaces.
Guessing that this is due to when classes are validated for
interface implementation and when templates are instantiated.
I thought
On Wednesday, 11 December 2013 at 08:54:18 UTC, Marco Leise wrote:
Am Wed, 11 Dec 2013 09:10:09 +0100
schrieb "Gianni Pisetta" :
No, i think fork or something similar is the way i prefer to
go.
I'm working on a simple top-down parser, so i save all the
data references in the context of the fun
On Wednesday, 11 December 2013 at 04:01:11 UTC, Ali Çehreli wrote:
On 12/10/2013 04:37 PM, Namespace wrote:
> int[] arr2 = [7, 8, 9]s;
> assert(is(typeof(arr2) == int[3]));
That looks very confusing. The left-hand side looks like a
slice, which I can append elements to but its type i
Am Wed, 11 Dec 2013 08:29:38 +0100
schrieb "Frustrated" :
>
> Has anyone done any work on comparing the performance of ranges
> vs using direct straightforward code(optimized in the sense of
> the way ranges work but by hand).
>
> e.g., How does filter compare to a simple loop over the element
Am Wed, 11 Dec 2013 08:00:27 +0100
schrieb "Jesse Phillips" :
> It should only be documented. In my experience processing files
> don't need a particular order and sorting may not be needed by
> name.
>
> Returning a sorted directory is difficult to define, should
> directories come first or b
Am Wed, 11 Dec 2013 07:19:41 +0100
schrieb "Volcz" :
> Are there any obvious difference between the three solutions I
> have received? They all to work the same to me.
I hope they all work the same! Depending on your background
you just might prefer one style over the other.
As an example take
Am Wed, 11 Dec 2013 08:20:19 +0100
schrieb "Frustrated" :
> On Wednesday, 11 December 2013 at 02:37:32 UTC, Jonathan M Davis
> wrote:
> > On Wednesday, December 11, 2013 03:09:52 Frustrated wrote:
> >> But surely memory gets allocated in some way?
> >>
> >> In Programming in D:
> >>
> >> "For e
Are there complete windows headers and if yes where can i find
them and will they work for 64bit?
Am Wed, 11 Dec 2013 09:10:09 +0100
schrieb "Gianni Pisetta" :
> No, i think fork or something similar is the way i prefer to go.
> I'm working on a simple top-down parser, so i save all the data
> references in the context of the function and at the end of it i
> create the syntax tree object wi
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote:
I'd like to use cython to wrap a D library. It's possible to do
this with a statically compiled C library, but it fails when I
try with a statically compiled D library. Any suggestions on
how to do this successfully?
I'm not Cython gu
D is cross-platform, so to have a wrapper for fork() would
mean to get it working on Windows, too.
std.process, can must use fork() of course, since it is the
way to spawn a child process on Posix systems. fork() doesn't
clone a thread, but a whole process. So there is no issue
with the GC, as it
62 matches
Mail list logo