Dne 11.1.2013 23:26, mist napsal(a):
Do not have time to test code right now but first guess it is related to
parsing differences for delegates and usual functions. Delegates can
have shared/const applied to both delegate type itself and context of
underlying function. Those are different beasts
On 01/13/2013 11:35 PM, 1100110 wrote:
Ok, I wish to create a standard timing system so that I can measure ~how
long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecution("funcName");
mixin template TimeExecution(T) if(isSomeStri
Ok, I wish to create a standard timing system so that I can measure
~how long each function takes to execute.
I wish to be able to place at the start of a function
version(Time) mixin TimeExecution("funcName");
mixin template TimeExecution(T) if(isSomeString!T) {
import std.stdio, std.date
On 14-01-2013 00:18, Charles Hixson wrote:
On 01/12/2013 09:24 PM, Alex Rønne Petersen wrote:
On 11-01-2013 19:15, Charles Hixson wrote:
I was looking for a way to create a weak reference to either a struct or
a class. I need to be able to use it to automatically generate an
active reference on
On 01/13/2013 08:01 AM, Tomas wrote:
Hey, guys.
I need to get all running processes list, and kill one. (example: Find
all processes and if skype.exe is running, kill it.)
---
import std.stdio;
import std.process;
//assuming we want to kill "htop"
void main() {
killProcess("htop");
}
voi
On Monday, 31 December 2012 at 11:01:17 UTC, Regan Heath wrote:
On Mon, 24 Dec 2012 07:18:51 -, Sam Hu
wrote:
On Friday, 21 December 2012 at 15:20:39 UTC, Regan Heath wrote:
On Wed, 19 Dec 2012 06:33:16 -, Sam Hu
wrote:
On Monday, 10 December 2012 at 14:43:08 UTC, Regan Heath
wro
Well some minor update. From the looks of how it is going to be
set up, it is almost entirely a template. Consider you have
BitArray!(Fixed!(1024)), vs BitArray!(Dynamic), in order for one
to copy to the other template functions are needed. Override one
of them, and now i have to define it to
On 01/12/2013 09:24 PM, Alex Rønne Petersen wrote:
On 11-01-2013 19:15, Charles Hixson wrote:
I was looking for a way to create a weak reference to either a struct or
a class. I need to be able to use it to automatically generate an
active reference on access. (I intend to do this by rolling in
I just want very much avoid renaming function,it's principle
for me.
So I would like to know is my sample right or no.
I think that the main overall principle here is that is it
impossible to have two functions which differ only by static
attribute. I even do not imagine the use case of this.
On Sunday, January 13, 2013 17:39:21 bearophile wrote:
> Maxim Fomin:
> > dmd allows to call static functions on instance.
>
> I think that's a D design mistake (and I think Jonathan Davis
> agrees with me), but Walter prefers the current behavour.
C++ and Java (and probably C# too) have this pro
On Sunday, January 13, 2013 20:41:48 Zhenya wrote:
> On Sunday, 13 January 2013 at 19:35:08 UTC, Maxim Fomin wrote:
> > According to spec http://dlang.org/class.html#AliasThis
> > undefined lookups are forwarded to AliasThis member. But in
> > your case Foo struct has bar member, so no further reso
On 2013-01-13 16:58, Zhenya wrote:
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln("static");
}
void bar()
{
writeln("non-static");
}
}
int main()
{
Foo gun;
gun.bar();//fails here
}
Is it all right,that compiler dosn't prefer non-static fu
On Sunday, 13 January 2013 at 19:35:08 UTC, Maxim Fomin wrote:
On Sunday, 13 January 2013 at 19:16:36 UTC, Zhenya wrote:
Hi!
Is it all right with it:
struct Foo
{
struct Bar
{
void opCall()
{
writeln("non-static");
On Sunday, 13 January 2013 at 19:16:36 UTC, Zhenya wrote:
Hi!
Is it all right with it:
struct Foo
{
struct Bar
{
void opCall()
{
writeln("non-static");
}
}
Bar bar;
static struct Anothe
Hi!
Is it all right with it:
struct Foo
{
struct Bar
{
void opCall()
{
writeln("non-static");
}
}
Bar bar;
static struct Anotherbar
{
static void bar()
On Sunday, 13 January 2013 at 18:16:40 UTC, Zhenya wrote:
On Sunday, 13 January 2013 at 17:59:28 UTC, Andrey wrote:
Don't know if this will be useful in any manner, but it came
this silly way:
class MyClass {
struct _static {
static void myfun() {
On Sunday, 13 January 2013 at 17:59:28 UTC, Andrey wrote:
Don't know if this will be useful in any manner, but it came
this silly way:
class MyClass {
struct _static {
static void myfun() {
writeln("static myfun");
}
}
Don't know if this will be useful in any manner, but it came this
silly way:
class MyClass {
struct _static {
static void myfun() {
writeln("static myfun");
}
}
void myfun() {
writeln("myfun");
On Sunday, 13 January 2013 at 17:17:54 UTC, Maxim Fomin wrote:
On Sunday, 13 January 2013 at 16:23:27 UTC, Zhenya wrote:
On Sunday, 13 January 2013 at 16:18:36 UTC, Maxim Fomin wrote:
Yes, it is a problem - dmd allows to call static functions on
instance. When both match, it issues ambiguity er
On Sunday, 13 January 2013 at 16:23:27 UTC, Zhenya wrote:
On Sunday, 13 January 2013 at 16:18:36 UTC, Maxim Fomin wrote:
Yes, it is a problem - dmd allows to call static functions on
instance. When both match, it issues ambiguity error.
Hmmm...So it will remain as it is?
It hurts me a little bi
Definitely this is a bad design. Even in PHP you can't call
static functions from class instance. :-)
Having two functions with the same name and argument list within
one class is a bad idea too.
On Sunday, 13 January 2013 at 17:04:21 UTC, Maxim Fomin wrote:
On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the cu
On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
Bye,
bearophile
Then I agree with both of yo
On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
Bye,
bearophile
Maybe you could suggest some
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
Bye,
bearophile
On Sunday, 13 January 2013 at 16:18:36 UTC, Maxim Fomin wrote:
On Sunday, 13 January 2013 at 15:58:56 UTC, Zhenya wrote:
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln("static");
}
void bar()
On Sunday, 13 January 2013 at 15:58:56 UTC, Zhenya wrote:
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln("static");
}
void bar()
{
writeln("non-static");
}
}
in
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln("static");
}
void bar()
{
writeln("non-static");
}
}
int main()
{
Foo gun;
gun.bar();//fails here
}
Is it
Hey, guys.
I need to get all running processes list, and kill one. (example:
Find all processes and if skype.exe is running, kill it.)
On Saturday, 12 January 2013 at 11:27:03 UTC, Era Scarecrow wrote:
On Saturday, 12 January 2013 at 10:58:23 UTC, thedeemon wrote:
So the runtime is aware of weak pointers and clears them to
"empty" state when pointed value dies. I don't see yet how it
can be implemented in D without patching it
monarch_dodra:
Is this proposal a pure optimization trick, or is there some
functionality gains here. The only one I can think of, is if
"Foo!B" would fail to compile. Is this what you are going
for...?
It's first of all a way to implement a Ternary in library code,
because in some situatio
On Sunday, 13 January 2013 at 11:26:57 UTC, monarch_dodra wrote:
Bearophile: Is this proposal a pure optimization trick, or is
there some functionality gains here. The only one I can think
of, is if "Foo!B" would fail to compile. Is this what you are
going for...?
Also:
//
template Ternar
comco:
Isn't the whole ct metaprogramming with types kind of
functional and immutable?
The answer is probably positive, but functional and lazy aren't
exactly the same thing, from a computational point of view.
I thought that the template instantiation is already
implemented as being lazy
On Sunday, 13 January 2013 at 11:15:03 UTC, comco wrote:
On Saturday, 5 January 2013 at 10:37:31 UTC, bearophile wrote:
In some case I'd like a hypothetical static ternary operator
usable on types:
alias T = (U.sizeof <= 16) ?? ushort : size_t;
That is equivalent to:
static if (U.sizeof <= 1
On Saturday, 5 January 2013 at 10:37:31 UTC, bearophile wrote:
In some case I'd like a hypothetical static ternary operator
usable on types:
alias T = (U.sizeof <= 16) ?? ushort : size_t;
That is equivalent to:
static if (U.sizeof <= 16) {
alias T = ushort;
} else {
alias T = size_t;
It turns out there already was a pull request that does this:
https://github.com/D-Programming-Language/dmd/pull/1019
The pull request is still unmerged. Isn't this important enough
or is the pull invalid?
36 matches
Mail list logo