On Saturday, 14 March 2015 at 23:57:33 UTC, weaselcat wrote:
On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer
wrote:
And C# has LINQ, which when combined with the last point is
fricken awesome.
what does LINQ offer that UFCS-style functional programming
does not?
LINQ basically
Why can't we allow mixin templates to contain statements, as is the case
for regular mixins?
Is there a workaround?
here's a dummy example:
template mixin Foo{
//some statement, eg: 'return;'
}
void fun(){
mixin Foo;
}
Note that I can do this with a regular mixin, but template mixins are
On Saturday, March 14, 2015 17:49:10 Robert M. Münch via Digitalmars-d-learn
wrote:
Now, just need to check why I don't see any debug output but that's not
a DMD issue ;-).
In case you didn't know, if you're not running the program in visual studio,
you should see the output in in DebugView:
On Saturday, 14 March 2015 at 18:26:34 UTC, Robert M. Münch wrote:
Hi, I have a question about how the GC handles this case:
export extern(C) char* foo(){
char[] x = This is a dynamic D string..dup;
return(cast(char*)x);
}
Since x is pointer to array data length if it goes out of
scope,
On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer wrote:
And C# has LINQ, which when combined with the last point is
fricken awesome.
what does LINQ offer that UFCS-style functional programming does
not?
On Sunday, 15 March 2015 at 00:56:24 UTC, Ellery Newcomer wrote:
On Saturday, 14 March 2015 at 23:57:33 UTC, weaselcat wrote:
On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer
wrote:
And C# has LINQ, which when combined with the last point is
fricken awesome.
what does LINQ offer
On Sunday, 15 March 2015 at 01:20:55 UTC, Timothee Cour wrote:
Why can't we allow mixin templates to contain statements, as is
the case
for regular mixins?
Is there a workaround?
here's a dummy example:
template mixin Foo{
//some statement, eg: 'return;'
}
void fun(){
mixin Foo;
}
Note
On Saturday, 14 March 2015 at 13:52:13 UTC, Craig Dillabaugh
wrote:
I don't have any C# experience so I can't compare those
languages much, but I've heard people say their are D / C#
similarities.
Anyway, this isn't a criticism of your comment, I was just
curious what (other than the
On Saturday, 14 March 2015 at 00:28:59 UTC, Ellery Newcomer wrote:
On Friday, 13 March 2015 at 19:05:59 UTC, Matt wrote:
example code, see if I can figure it out, but if you can
advise, that would be fantastic. Thank you for all the help
so far, it's really been appreciated
My penitence for
On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
yes,java is good lang,but i dont think it's better than c#,if
no oracle or google support java will less and less.
C# is a good and easy lang.
i like C# .
but,C# cant compiled to native code.
So far, I have been searching for a
dnewer:
but,C# cant compiled to native code.
Soon you will be able to compile C# natively.
Bye,
bearophile
yes,java is good lang,but i dont think it's better than c#,if no
oracle or google support java will less and less.
C# is a good and easy lang.
i like C# .
but,C# cant compiled to native code.
So far, I have been searching for a language, like c # write
efficiency, but more secure than that of
On Saturday, 14 March 2015 at 10:04:15 UTC, bearophile wrote:
dnewer:
but,C# cant compiled to native code.
Soon you will be able to compile C# natively.
Bye,
bearophile
i know some thing about .net native.
but its too late.i dont think microsoft will rranslate all
libiary to native.
and
On Saturday, 14 March 2015 at 09:59:05 UTC, dnewer wrote:
yes,java is good lang,but i dont think it's better than c#,if
no oracle or google support java will less and less.
C# is a good and easy lang.
i like C# .
but,C# cant compiled to native code.
So far, I have been searching for a
On Sat, 14 Mar 2015 10:08:23 +, dnewer wrote:
and even c# can be compile natively.
i dont think C# will support to can be used to write a driver!
and you just don't need to write drivers.
signature.asc
Description: PGP signature
Wow, this is f***ing cool.
http://dlang.org/traits.html#allMembers
Thank you!
On Saturday, 14 March 2015 at 14:54:27 UTC, Adam D. Ruppe wrote:
__traits(allMembers, Struct) can do it.
Get the free sample chapter from my book:
https://www.packtpub.com/application-development/d-cookbook and
it
I was wondering what the idiomatic D way of implementing strong
types. Boost has something along these lines using classes:
http://www.boost.org/doc/libs/1_37_0/boost/strong_typedef.hpp
When programming in C++ I find that the compiler does not
necessarily generate good code with these types,
Hi all,
I am new to D and so far it is really great.
I am wondering how to get the names of member variables in a
struct or class. I haven't worked it out yet but this would
enable metaprogramming like iterating over the members of the
struct.
I see in std.traits that you can get get
You can do it this way:
struct dollars_t {
uint _dollar;
this(uint d) {
_dollar = d;
}
alias _dollar this;
}
struct cents_t {
uint _cent;
this(uint c) {
_cent = c;
}
alias _cent this;
}
void do_something_with_dollars(dollars_t d) {
On 2015-03-13 21:19:07 +, Adam D. Ruppe said:
In the file you want to use it, you can just write
extern(Windows) void OutputDebugStringA(in char*);
and it should work... or whatever the signature is, check msdn, and
remember the ones that take strings tend to need A or W for the ascii
Interesting. I think in the second example there are pathological
cases where one has similar declarations in two modules at the
same line.
moduleA.d:100
alias dollars_t TypeDef!int;
moduleB.d:100
alias cents_t TypeDef!int;
main.d:
import moduleA;
import moduleB;
void
__traits(allMembers, Struct) can do it.
Get the free sample chapter from my book:
https://www.packtpub.com/application-development/d-cookbook and
it goes into more detail (I'm in a bit of a rush right now!)
the sample link is under the picture
On Saturday, 14 March 2015 at 07:28:04 UTC, Matt wrote:
Yeah, dub is what I'm using. Actually, I made a mistake
regarding the py_eval. I'm including the pyd modules in a
module other than the one that has my main() function, so they
weren't visible. I feel like a proper idiot for that one..
I think I may have answered my own question. It seems std.typecon
provides a facility for this.
http://dlang.org/phobos/std_typecons.html#.Proxy
http://dlang.org/phobos/std_typecons.html#.Typedef
Is this the 'right' way to do things? It seems that Proxy is used
as a mixin whereas Typedef is
On Saturday, 14 March 2015 at 16:55:09 UTC, Charles Cooper wrote:
Interesting. I think in the second example there are
pathological cases where one has similar declarations in two
modules at the same line.
Yes, that right, I've kept it simple, but of course it is not
complete safe. :)
On Saturday, 14 March 2015 at 15:45:30 UTC, Charles Cooper wrote:
I think I may have answered my own question. It seems
std.typecon provides a facility for this.
http://dlang.org/phobos/std_typecons.html#.Proxy
http://dlang.org/phobos/std_typecons.html#.Typedef
Is this the 'right' way to do
Hi, I have a question about how the GC handles this case:
export extern(C) char* foo(){
char[] x = This is a dynamic D string..dup;
return(cast(char*)x);
}
Since x is pointer to array data length if it goes out of scope,
it's destroyed and the last reference to the array data is gone.
On Saturday, 14 March 2015 at 18:26:34 UTC, Robert M. Münch wrote:
Hi, I have a question about how the GC handles this case:
export extern(C) char* foo(){
char[] x = This is a dynamic D string..dup;
return(cast(char*)x);
}
Returning `x.ptr` would look a little nicer.
Since x is pointer
28 matches
Mail list logo