On Thursday, 12 March 2015 at 05:01:50 UTC, amber wrote:
On Thursday, 12 March 2015 at 04:51:42 UTC, amber wrote:
On Thursday, 12 March 2015 at 04:04:28 UTC, weaselcat wrote:
On Thursday, 12 March 2015 at 03:12:15 UTC, amber wrote:
...
http://dlang.org/function.html#function-attribute-inferenc
On Thursday, 12 March 2015 at 04:51:42 UTC, amber wrote:
On Thursday, 12 March 2015 at 04:04:28 UTC, weaselcat wrote:
On Thursday, 12 March 2015 at 03:12:15 UTC, amber wrote:
...
http://dlang.org/function.html#function-attribute-inference
might be a good read if you haven't read it already.
On Thursday, 12 March 2015 at 04:04:28 UTC, weaselcat wrote:
On Thursday, 12 March 2015 at 03:12:15 UTC, amber wrote:
...
http://dlang.org/function.html#function-attribute-inference
might be a good read if you haven't read it already.
I did read it but didn't really understand it, so I've com
On Thursday, 12 March 2015 at 03:12:15 UTC, amber wrote:
...
http://dlang.org/function.html#function-attribute-inference might
be a good read if you haven't read it already.
Hi,
Is there a way in D to specify function attributes for a template
struct/class by type?
E.g. given a template struct/class as follows:
---
struct S(T) {
T[] values;
void someFunc(int i) pure nothrow @safe {}
}
---
For some types the pure, nothrow, @safe attributes are valid and
On Wednesday, 11 March 2015 at 21:45:20 UTC, Matt wrote:
On Wednesday, 11 March 2015 at 19:32:05 UTC, Matt wrote:
I'm trying to build a simple platformer using SDL2 and python
to script entities, but I'm struggling to include Pyd. I'm
using DMD v2.066.1, with dub as the package manager, and
de
> On Wed, 11 Mar 2015 06:22:32 +, sclytrack wrote:
>> - You can include C library headers directly in your .ec code, without
>> any special keyword (like extern "C" in C++)
On Wed, Mar 11, 2015 at 1:59 AM, ketmar via Digitalmars-d-learn
wrote:
> either i missed something, misunderstood what h
On Wednesday, 11 March 2015 at 10:13:12 UTC, Théo Bueno wrote:
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote:
Now , my question is:
How to get the position it crashes?
Or get the method call stack?
If you are developing under Linux, you can use GDB to debug
your D apps, just like an
On Wednesday, 11 March 2015 at 22:44:12 UTC, Paul D Anderson
wrote:
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context con
On 03/11/2015 03:44 PM, Paul D Anderson wrote:
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context context = T.context)
On Wednesday, 11 March 2015 at 22:44:12 UTC, Paul D Anderson
wrote:
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context con
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context context = T.context)
if (isDecimal!T && isIntegral!U)
// two dif
On Wednesday, 11 March 2015 at 19:32:05 UTC, Matt wrote:
I'm trying to build a simple platformer using SDL2 and python
to script entities, but I'm struggling to include Pyd. I'm
using DMD v2.066.1, with dub as the package manager, and
derelict for the SDL2 bindings.
Now, when I add Pyd to my
I'm trying to build a simple platformer using SDL2 and python to
script entities, but I'm struggling to include Pyd. I'm using DMD
v2.066.1, with dub as the package manager, and derelict for the
SDL2 bindings.
Now, when I add Pyd to my dub.json everything works fine, but as
soon as I add py_i
On Wednesday, 11 March 2015 at 18:10:55 UTC, FG wrote:
And your point was...? I take it, "poor c++" is a hint.
Don't compare apples to oranges.
No, I forgot to remove from the foreign code.
Thank you very much, Ali Çehreli and FG.
On 2015-03-11 at 18:27, Dennis Ritchie wrote:
The same without classes in Lisp:
[...]
And your point was...? I take it, "poor c++" is a hint.
Don't compare apples to oranges.
On 2015-03-11 at 17:42, Dennis Ritchie wrote:
On Wednesday, 11 March 2015 at 16:08:22 UTC, Kagamin wrote:
A hash table? See http://dlang.org/hash-map.html
That is, the input is a string and, depending on what word it contains, is
called one of the three methods of the class that this line han
On 03/11/2015 07:33 AM, Dennis Ritchie wrote:
How to rewrite this in D to the handler method for the input parameter
was determined on average in O(1)?
D's associative arrays are hash tables.
The following program is as similar to the C++ one as possible:
import std.stdio;
import std.range;
On Wednesday, 11 March 2015 at 17:19:20 UTC, ketmar wrote:
On Wed, 11 Mar 2015 18:17:38 +0100, Artur Skawina via
Digitalmars-d-learn
wrote:
On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote:
On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
On Wednesday, 11 March 2015 at 14:34:32 UTC
The same without classes in Lisp:
(define (foo)
(let ((foo1 (lambda (s) s))
(foo2 (lambda (s) (list->string (reverse (string->list
s)
(foo3 (lambda (s) (string-append s ", " s " "
(lambda (in)
(match in
("first" foo1)
("second" foo2)
(
On Wed, 11 Mar 2015 18:17:38 +0100, Artur Skawina via Digitalmars-d-learn
wrote:
> On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote:
>> On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
>>
>>> On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +00
On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote:
> On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
>
>> On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
>>> On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
>>>
This code does not work:
enum Test {
>
On Wednesday, 11 March 2015 at 16:08:22 UTC, Kagamin wrote:
A hash table? See http://dlang.org/hash-map.html
That is, the input is a string and, depending on what word it
contains, is called one of the three methods of the class that
this line handles. And this happens in average cons
A hash table? See http://dlang.org/hash-map.html
On Wed, 2015-03-11 at 07:10 -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 03/11/2015 01:07 AM, Russel Winder via Digitalmars-d-learn wrote:
> > On Tue, 2015-03-10 at 15:34 -0700, Ali Çehreli via Digitalmars-d-learn
> > wrote:
> > […]
> >> We can hope to make it simpler by taking advantage
On 03/11/2015 04:40 AM, Namespace wrote:
> I can call draw on Drawable, because it is declared public and I cannot
> call draw on Sprite because it is declared protected (this is already a
> bit weird, why can I redeclare the interface method draw as protected?)
It is the same in C++.
> but I c
On Wednesday, March 11, 2015 14:55:01 Namespace via Digitalmars-d-learn wrote:
> Thanks, I've hoped that 'static if' is a full replacement for #if
Walter Bright has a rather dim view of #if and friends in C/C++ given how
often he's seen them abused, which is why version and static if are more
rest
Could it be that this is intentional and has always worked?
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ >= 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement,
On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
> On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
>> On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
>>
>>> This code does not work:
>>>
>>>
>>> enum Test {
>>> Foo,
>>> static if (__VERSION__ >= 2067)
>>> Bar,
>>>
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ >= 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement,
Hi.
How to rewrite this in D to the handler method for the input
parameter was determined on average in O(1)?
#include
#include
#include
#include
class A
{
public:
void foo(const std::string &s);
protected:
void foo1(const std::string &s);
void foo2(const std::string &s);
On 03/11/2015 01:07 AM, Russel Winder via Digitalmars-d-learn wrote:
On Tue, 2015-03-10 at 15:34 -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[…]
We can hope to make it simpler by taking advantage of parallel map but
it requires a static local function or a global function (a lambda
cannot
This code does not work:
enum Test {
Foo,
static if (__VERSION__ >= 2067)
Bar,
}
Quatz
}
Any chance that this could work?
On Wednesday, 11 March 2015 at 08:45:15 UTC, Kagamin wrote:
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
Can you point out where it says anything about wpf or .NET? I'm
having trouble finding it. I even searched for .net and wpf but
still no luck ;/ Maybe you posted the wrong
Thank you all.
Or even shorter:
import std.stdio;
T foo(T, Args...)(auto ref const T val, auto ref const Args u)
{
static if (Args.length > 0) {
static if (is(T == string))
return val ~ foo(u);
else
return val + foo(u);
} else {
return val;
}
}
void
On 12/03/2015 1:02 a.m., Dennis Ritchie wrote:
Hi.
How to rewrite this code on D?
#include
#include
template
T foo(const T &val)
{
return val;
}
template
T foo(const T &val, const U &...u)
{
return val + foo(u...);
}
int main()
{
std::cout << foo(std::string("some "), std::
import std.stdio;
T foo(T)(auto ref const T val)
{
return val;
}
T foo(T, Args...)(auto ref const T val, auto ref const Args u)
{
static if (is(T == string))
return val ~ foo(u);
else
return val + foo(u);
}
void main()
{
writeln(foo("some ", "test")); // prin
Hi.
How to rewrite this code on D?
#include
#include
template
T foo(const T &val)
{
return val;
}
template
T foo(const T &val, const U &...u)
{
return val + foo(u...);
}
int main()
{
std::cout << foo(std::string("some "), std::string("test"))
<< std::endl; // prints some test
Let's say we have these files:
module Foo.Graphic.Drawable;
interface Drawable {
void draw(bool);
}
module Foo.Graphic.Sprite;
import Foo.Graphic.Drawable;
class Sprite : Drawable {
protected:
void draw(bool enable) {
import core.stdc.stdio : pri
On Wednesday, 11 March 2015 at 10:13:12 UTC, Théo Bueno wrote:
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote:
Now , my question is:
How to get the position it crashes?
Or get the method call stack?
If you are developing under Linux, you can use GDB to debug
your D apps, just like an
On Wednesday, 11 March 2015 at 00:00:39 UTC, dnoob wrote:
Hello,
I am parsing some text and I have the following;
string text = "some very long text";
foreach(line; splitter(text, [13, 10]))
{
foreach(record; splitter(line, '*'))
{
foreach(field; splitter(record
On Wednesday, 11 March 2015 at 11:09:42 UTC, Daniel Kozák wrote:
On Wed, 11 Mar 2015 10:05:39 +
zhmt via Digitalmars-d-learn
wrote:
I want to know how to locate the position of crashing in dlang?
for example: there is stack dump in c, exception stack in
java, they could help to locat
On Wed, 11 Mar 2015 10:05:39 +
zhmt via Digitalmars-d-learn wrote:
> I want to know how to locate the position of crashing in dlang?
>
> for example: there is stack dump in c, exception stack in java,
> they could help to locate the root of problems.
>
D has these too, you just need to
On Wed, 11 Mar 2015 10:05:39 +
zhmt via Digitalmars-d-learn wrote:
> I want to know how to locate the position of crashing in dlang?
>
> for example: there is stack dump in c, exception stack in java,
> they could help to locate the root of problems.
>
D has these too, you just need to
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote:
Now , my question is:
How to get the position it crashes?
Or get the method call stack?
If you are developing under Linux, you can use GDB to debug your
D apps, just like any C/C++ program. Make sure you are compiling
in debug mode in o
On Wednesday, 11 March 2015 at 00:00:39 UTC, dnoob wrote:
Hello,
I am parsing some text and I have the following;
string text = "some very long text";
foreach(line; splitter(text, [13, 10]))
{
foreach(record; splitter(line, '*'))
{
foreach(field; splitter(record
On Wed, 11 Mar 2015 00:00:38 +, dnoob wrote:
> Hello,
>
> I am parsing some text and I have the following;
>
> string text = "some very long text";
>
> foreach(line; splitter(text, [13, 10]))
> {
> foreach(record; splitter(line, '*'))
> {
> foreach(field; splitter(
On Wed, 11 Mar 2015 06:22:32 +, sclytrack wrote:
> - You can include C library headers directly in your .ec code, without
> any special keyword (like extern "C" in C++)
either i missed something, misunderstood what he means or he is simply
wrong. i remember that there is no CPP macro process
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
I developed a socks5 proxy server with vibe.d.
but it crashed after running a few minutes, with the output below:
Task terminated with uncaught exception: Operating on closed
TCPConnection.
Task terminated with uncaught exception: Operating on closed
TCPConnection.
Task terminated with unhandl
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote:
I developed a socks5 proxy server with vibe.d.
but it crashed after running a few minutes, with the output
below:
Task terminated with uncaught exception: Operating on closed
TCPConnection.
Task terminated with uncaught exception: Opera
On Tuesday, March 10, 2015 13:26:00 Ali Çehreli via Digitalmars-d-learn wrote:
> On 03/10/2015 11:05 AM, Ali Çehreli wrote:
>
> > In other words, the result of the implicit conversion is an rvalue
>
> Steven Schveighoffer says there is no rvalue in this case; "an enum is a
> derivative":
>
>htt
On Tue, 2015-03-10 at 15:34 -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[…]
> We can hope to make it simpler by taking advantage of parallel map but
> it requires a static local function or a global function (a lambda
> cannot be used):
[…]
Is there a reason for excluding lambdas, it a pri
If I write a business model in D, how hard is it to hook up a
presentation using something like wpf, win32, or even whatever
mac does?
57 matches
Mail list logo