Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Sönke Ludwig via Digitalmars-d-announce
Am 26.07.2016 um 05:22 schrieb Puming: On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily

Re: Trouble using 'sort'

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/26/2016 10:11 AM, Bahman Movaqar wrote: > Alright...further experiments. The following works: > > sort!((pp1, pp2) => cmp(pp1.price, pp2.price) > 0)(theRange) > > So it may be something about what kind of range I'm passing to `sort`. > Am I right? > I meant sort!((pp1, pp2) =>

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Rory McGuire via Digitalmars-d-announce
On Tue, Jul 26, 2016 at 5:22 AM, Puming via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: > >> The Diet template language is aimed at providing a way to define >> procedurally generated HTML/XML pages (or other

Re: Trouble using 'sort'

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/26/2016 09:35 AM, Bahman Movaqar wrote: > I have a range which is the result of a couple of chained range > operations, and each element is: > > Tuple!(string, "product", double, "price") > > Now I'd like to sort the range by "price" using: > > sort!((pp1, pp2) => cmp(pp1.price,

Template argument deduction for class templates adopted in cpp17

2016-07-25 Thread mogu via Digitalmars-d
Link: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0091r1.html And we have DIP40: http://wiki.dlang.org/DIP40 Is someone there to renew it in new DIPs repo? T.T

Trouble using 'sort'

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
I have a range which is the result of a couple of chained range operations, and each element is: Tuple!(string, "product", double, "price") Now I'd like to sort the range by "price" using: sort!((pp1, pp2) => cmp(pp1.price, pp2.price) > 0)(theRange) But I get a compile time error:

Re: randomIO, std.file, core.stdc.stdio

2016-07-25 Thread ketmar via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 04:05:22 UTC, Charles Hixson wrote: Yes, but I really despise the syntax they came up with. It's probably good if most of your I/O is ranges, but mine hasn't yet ever been. (Combining ranges with random I/O?) that's why i wrote iv.stream, and then iv.vfs, with

Re: Getting most derived type of object that implements interface

2016-07-25 Thread cc via Digitalmars-d-learn
Ahh I see, thanks guys.

Re: randomIO, std.file, core.stdc.stdio

2016-07-25 Thread Charles Hixson via Digitalmars-d-learn
On 07/25/2016 07:11 PM, ketmar via Digitalmars-d-learn wrote: On Tuesday, 26 July 2016 at 01:19:49 UTC, Charles Hixson wrote: then I will prefer the core.stdc.stdio approach. I find it's appearance extremely much cleaner... only if you are really used to write C code. when you see pointer,

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Puming via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade ,

Re: Trouble checking for null-ness

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/25/2016 05:47 PM, Adam D. Ruppe wrote: > On Monday, 25 July 2016 at 13:09:22 UTC, Bahman Movaqar wrote: >> From what I could gather, it's not possible to check for `null` at >> runtime for reference based types. Am I right? > > No, it is only possible to check for null for reference based

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread ketmar via Digitalmars-d
p.s. probably even with -vgc to list line numbers and dscanner to find function names/signatures. "-vgc" has the advantage of reporting closuses, while with "handmade" linter you'll have to track that by yourself.

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread ketmar via Digitalmars-d
On Tuesday, 26 July 2016 at 02:42:52 UTC, bitwise wrote: Something like @warngc could work nicely. It could function exactly as @nogc with the exception that it issued warnings instead of errors. i don't think that it will be added, though. but you can emulate it with external utility:

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread bitwise via Digitalmars-d
On Tuesday, 26 July 2016 at 01:07:27 UTC, Chris Wright wrote: On Mon, 25 Jul 2016 15:46:54 +, bitwise wrote: On Monday, 25 July 2016 at 07:43:34 UTC, rikki cattermole wrote: I've been saying for a very long time we need @assumenogc attribute like we have @trusted for @safe. So I'm not

Re: randomIO, std.file, core.stdc.stdio

2016-07-25 Thread ketmar via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 01:19:49 UTC, Charles Hixson wrote: then I will prefer the core.stdc.stdio approach. I find it's appearance extremely much cleaner... only if you are really used to write C code. when you see pointer, or explicit type size argument in D, it is a sign of C

Re: randomIO, std.file, core.stdc.stdio

2016-07-25 Thread Charles Hixson via Digitalmars-d-learn
On 07/25/2016 05:18 PM, ketmar via Digitalmars-d-learn wrote: On Monday, 25 July 2016 at 18:54:27 UTC, Charles Hixson wrote: Are there reasons why one would use rawRead and rawWrite rather than fread and fwrite when doiing binary random io? What are the advantages? In particular, if one is

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread Chris Wright via Digitalmars-d
On Mon, 25 Jul 2016 15:46:54 +, bitwise wrote: > On Monday, 25 July 2016 at 07:43:34 UTC, rikki cattermole wrote: >> I've been saying for a very long time we need @assumenogc attribute >> like we have @trusted for @safe. > > So I'm not crazy then ;) > > I'm wondering if Andrei and Walter

Re: Static ternary if

2016-07-25 Thread Michael Coulombe via Digitalmars-d-learn
On Monday, 25 July 2016 at 22:57:05 UTC, Gorge Jingale wrote: On Monday, 25 July 2016 at 22:27:11 UTC, Cauterite wrote: On Monday, 25 July 2016 at 02:15:12 UTC, Gorge Jingale wrote: Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if. You can pretty

Re: randomIO, std.file, core.stdc.stdio

2016-07-25 Thread ketmar via Digitalmars-d-learn
On Monday, 25 July 2016 at 18:54:27 UTC, Charles Hixson wrote: Are there reasons why one would use rawRead and rawWrite rather than fread and fwrite when doiing binary random io? What are the advantages? In particular, if one is reading and writing structs rather than arrays or ranges, are

Re: Static ternary if

2016-07-25 Thread Gorge Jingale via Digitalmars-d-learn
On Monday, 25 July 2016 at 22:27:11 UTC, Cauterite wrote: On Monday, 25 July 2016 at 02:15:12 UTC, Gorge Jingale wrote: Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if. You can pretty easily make your own; template staticIf(bool cond, alias a,

Re: Static ternary if

2016-07-25 Thread Cauterite via Digitalmars-d-learn
On Monday, 25 July 2016 at 02:15:12 UTC, Gorge Jingale wrote: Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if. You can pretty easily make your own; template staticIf(bool cond, alias a, alias b) { static if (cond) { alias staticIf = a;

Overflows in Phobos

2016-07-25 Thread Walter Bright via Digitalmars-d
In poking around in Phobos, I found a number of cases like: https://github.com/dlang/phobos/pull/4655 where overflow is possible in calculating storage sizes. Since allocation normally happens in @trusted code, these are a safety/security hole. When reviewing Phobos submissions, please

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Sebastiaan Koppe via Digitalmars-d-announce
On Monday, 25 July 2016 at 20:42:51 UTC, Karabuta wrote: On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to ... - Supports AngularJS special attribute names Is there a way to get react JS to work with vibe.d in

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Karabuta via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to ... - Supports AngularJS special attribute names Is there a way to get react JS to work with vibe.d in anyway(server-side)?

Re: Please help to move forward with ndslice

2016-07-25 Thread Ilya Yaroshenko via Digitalmars-d
On Monday, 25 July 2016 at 17:12:08 UTC, jmh530 wrote: On Sunday, 24 July 2016 at 17:30:24 UTC, Ilya Yaroshenko wrote: Hello, I found a way how to correctly implement multidimensional functional map for ndslices and for packed ndslices (tensors composed of tensors). It allows 1. a compiler

Re: D APT repository fails

2016-07-25 Thread Michael via Digitalmars-d
On Monday, 25 July 2016 at 15:51:50 UTC, Zardoz wrote: I keep seeing along this last month many problems with the D APT repository. There is any one cheeking the health of these repository ? Now I get an error with

randomIO, std.file, core.stdc.stdio

2016-07-25 Thread Charles Hixson via Digitalmars-d-learn
Are there reasons why one would use rawRead and rawWrite rather than fread and fwrite when doiing binary random io? What are the advantages? In particular, if one is reading and writing structs rather than arrays or ranges, are there any advantages?

Re: Default implementations in inherited interfaces

2016-07-25 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 24 July 2016 at 07:54:11 UTC, Jonathan Marler wrote: On Thursday, 21 July 2016 at 13:37:30 UTC, Saurabh Das wrote: On Thursday, 21 July 2016 at 12:42:14 UTC, Adam D. Ruppe wrote: On Thursday, 21 July 2016 at 09:41:27 UTC, Saurabh Das wrote: Java 8 has a 'default' keyword that allows

Re: D APT repository fails

2016-07-25 Thread lqjglkqjsg via Digitalmars-d
On Monday, 25 July 2016 at 15:51:50 UTC, Zardoz wrote: I keep seeing along this last month many problems with the D APT repository. There is any one cheeking the health of these repository ? Now I get an error with

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Cauterite changed: What|Removed |Added Status|NEW |RESOLVED

Re: Please help to move forward with ndslice

2016-07-25 Thread jmh530 via Digitalmars-d
On Sunday, 24 July 2016 at 17:30:24 UTC, Ilya Yaroshenko wrote: Hello, I found a way how to correctly implement multidimensional functional map for ndslices and for packed ndslices (tensors composed of tensors). It allows 1. a compiler to use vectorisation with SIMD instructions like `fabs`

D APT repository fails

2016-07-25 Thread Zardoz via Digitalmars-d
I keep seeing along this last month many problems with the D APT repository. There is any one cheeking the health of these repository ? Now I get an error with "http://master.dl.sourceforge.net/project/d-apt/dists/d-apt/main/binary-amd64/Packages; Wrong header line. Using a phrase where I

typeid() on class instances discards immutable

2016-07-25 Thread Cauterite via Digitalmars-d
I noticed that for some class `T`, `typeid(new immutable(T)) != typeid(immutable(T))`. The immutability is lost in the object's typeinfo, but retained in the class's typeinfo. See: https://dpaste.dzfl.pl/f04d41ff2986 Is this intended behaviour or a bug? I couldn't find any mention of it in

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread bitwise via Digitalmars-d
On Monday, 25 July 2016 at 07:43:34 UTC, rikki cattermole wrote: I've been saying for a very long time we need @assumenogc attribute like we have @trusted for @safe. So I'm not crazy then ;) I'm wondering if Andrei and Walter consider @trusted a win though. They seem to have such firm

[Issue 16321] ICE with delegate in UDA

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16321 --- Comment #1 from Ketmar Dark --- and this gives segfault too, but different: enum nameAttr = __traits(getAttributes, (__traits(getMember, T, m)))[0]; writeln(nameAttr.foo()); Internal error: backend/cod4.c 3206 --

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #3 from

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 --- Comment #4 from Ketmar Dark --- yes, error is expected, as you can't do pointer math in CTFE. thank you. --

[Issue 16321] ICE with delegate in UDA

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16321 Ketmar Dark changed: What|Removed |Added CC|

[Issue 16321] New: ICE with delegate in UDA

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16321 Issue ID: 16321 Summary: ICE with delegate in UDA Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

From the Blog: Ethan Watson Talks About his GDC Europe Talk

2016-07-25 Thread Mike Parker via Digitalmars-d-announce
It was announced here recently that Ethan Watson will be speaking at GDC Europe next month about Remedy's use of D in Quantum Break. He was kind enough to take a the time to provide a few words about the talk for the D Blog [1]. The reddit link is at [2]. [1]

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Ketmar Dark changed: What|Removed |Added CC|

Re: Trouble checking for null-ness

2016-07-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 25 July 2016 at 13:09:22 UTC, Bahman Movaqar wrote: From what I could gather, it's not possible to check for `null` at runtime for reference based types. Am I right? No, it is only possible to check for null for reference based types. But map's result is not a reference based

Re: An IO Streams Library

2016-07-25 Thread ikod via Digitalmars-d
On Sunday, 7 February 2016 at 00:48:54 UTC, Jason White wrote: I see the subject of IO streams brought up here occasionally. The general consensus seems to be that we need something better than what Phobos provides. I wrote a library "io" that can work as a replacement for std.stdio,

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 --- Comment #1 from Cauterite --- actually this is a much better example: https://dpaste.dzfl.pl/01e323e77dac class T {}; enum x = T.classinfo.hashOf; --

[Issue 16320] DMD segfault T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Cauterite changed: What|Removed |Added Summary|DMD segfault with switch|DMD segfault

Re: Trouble checking for null-ness

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
On 07/25/2016 05:07 PM, Bahman Movaqar wrote: > Suppose I have the following function: > > public auto max(alias comp, Range)(Range r) > in { > assert(r !is null && !r.empty); > } > body { > // ... > } > > When the function after a series of chained `map`

[Issue 16320] DMD segfault with switch {case T.classinfo.hashOf :

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Cauterite changed: What|Removed |Added Summary|DMD segfault with |DMD segfault with switch

Re: Static ternary if

2016-07-25 Thread lqjglkqjsg via Digitalmars-d-learn
On Monday, 25 July 2016 at 05:00:23 UTC, Ali Çehreli wrote: On 07/24/2016 07:15 PM, Gorge Jingale wrote: Is there a static ternary if? (A == B) ? C : D; for compile type that works like static if. The way to force an expression at compile time is to use it for something that's needed at

[Issue 16320] DMD segfault with T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Cauterite changed: What|Removed |Added Keywords||ice --

[Issue 16320] New: DMD segfault with T.classinfo.hashOf

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16320 Issue ID: 16320 Summary: DMD segfault with T.classinfo.hashOf Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

Re: Trouble checking for null-ness

2016-07-25 Thread Mike Parker via Digitalmars-d-learn
On Monday, 25 July 2016 at 12:37:18 UTC, Bahman Movaqar wrote: Suppose I have the following function: public auto max(alias comp, Range)(Range r) in { assert(r !is null && !r.empty); } body { // ... } When the function after a series of chained `map` operations,

Re: Trouble checking for null-ness

2016-07-25 Thread Cauterite via Digitalmars-d-learn
On Monday, 25 July 2016 at 12:47:25 UTC, Cauterite wrote: (!__traits(compiles, r is null) || r !is null) && !r.empty Ah, whoops that's wrong, looks like ketmar had the right idea.

Re: Trouble checking for null-ness

2016-07-25 Thread Cauterite via Digitalmars-d-learn
On Monday, 25 July 2016 at 12:37:18 UTC, Bahman Movaqar wrote: But I'm curious; how can I check for a `null` in this case? Well, if you're happy with assertion failure by access violation, you may not even need to check for null, because generally if you try to call .empty on a null pointer

Re: Trouble checking for null-ness

2016-07-25 Thread ag0aep6g via Digitalmars-d-learn
On Monday, 25 July 2016 at 12:37:18 UTC, Bahman Movaqar wrote: Error: incompatible types for ((r) !is (null)): 'MapResult!(__lambda2, SInvoiceLine[])' and 'typeof(null)' Of course if I remove `r !is null` from the `in` block, everything will work. But I'm curious; how can I check for a

Re: Trouble checking for null-ness

2016-07-25 Thread ketmar via Digitalmars-d-learn
static if (is(typeof(r is null))) { ...you can do your assert here... }

Trouble checking for null-ness

2016-07-25 Thread Bahman Movaqar via Digitalmars-d-learn
Suppose I have the following function: public auto max(alias comp, Range)(Range r) in { assert(r !is null && !r.empty); } body { // ... } When the function after a series of chained `map` operations, I get the following error: Error: incompatible types for

Re: Getting most derived type of object that implements interface

2016-07-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/25/16 5:54 AM, Kagamin wrote: Cast it to Object: FooInterface a = new BarImplementsInterface(); FooBaseClass b = new BarDerivedClass(); Object o = cast(Object)a; writefln("a class: %s", a.classinfo.name); writefln("b class: %s", b.classinfo.name); writefln("o class:

dub set default compiler for project

2016-07-25 Thread Nicholas Wilson via Digitalmars-d-learn
dub build has the --compiler= option. Is there any way to set it to default a custom version (own branch, resides in ../../ldcbuild/bin/ldc2 ) of ldc2 in the dub.json (or .sdl)? The project will only compile with that compiler.

Re: Cannot compare object.opEquals is not nogc

2016-07-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/23/16 5:44 PM, Rufus Smith wrote: On Saturday, 23 July 2016 at 17:27:24 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 17:04:42 UTC, Jonathan Marler wrote: On Saturday, 23 July 2016 at 16:46:20 UTC, Jonathan Marler wrote: [...] Actually Im going to disagree with myself.

Re: How to pause terminal in D on Linux?

2016-07-25 Thread lqjglkqjsg via Digitalmars-d-learn
On Sunday, 24 July 2016 at 00:54:21 UTC, Zekereth wrote: On Saturday, 23 July 2016 at 19:08:00 UTC, WhatMeWorry wrote: What I thought would be trivial is becoming a nightmare. Can anybody set me straight. Thanks in advance. [...] Use the getchar() function. void pause(const string msg =

Re: Long term @nogc / allocators usage

2016-07-25 Thread Dicebot via Digitalmars-d
Also in general usage of custom allocator for temporaries is a very bad @nogc approach and is only marginally better than GC using code. Good @nogc must make no decisions about allocations at all (and ideally minimize stack allocations too, especially if fibers are to be used).

Re: add attributes to debug

2016-07-25 Thread ag0aep6g via Digitalmars-d
On 07/25/2016 04:16 AM, Gorge Jingale wrote: On Monday, 25 July 2016 at 02:13:34 UTC, Adam D. Ruppe wrote: [...] debug(whatever) thingy_here(); [...] You can't combine attributes: @mem @see debug() { prints debug info } debug(mem) debug(see) { /* ... */ } Though I'm not sure if the

Re: Long term @nogc / allocators usage

2016-07-25 Thread Dicebot via Digitalmars-d
@nogc code is quite different from idiomatic "casual" D code and one is expected to make sacrifices to go for it. Here are some approaches I decided for myself: On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: Now, there are some cases in which you cannot avoid the managed

Re: Long term @nogc / allocators usage

2016-07-25 Thread ZombineDev via Digitalmars-d
On Sunday, 24 July 2016 at 17:04:43 UTC, Seb wrote: On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: DISCLAIMER: although I've been occasionally using D for a lot of time, I only recently started to follow the forums and use it intensively, so I may miss part of the history /

Re: Singletons importing each other?

2016-07-25 Thread Jack via Digitalmars-d-learn
On Sunday, 24 July 2016 at 15:38:13 UTC, lqjglkqjsg wrote: On Sunday, 24 July 2016 at 15:07:20 UTC, Jack wrote: [...] - You can use a 3rd module that imports the two that "cycle". - You can use another singleton implementation that doesn't rely on a static this. e.g a kind of "lazy factory"

Re: asd

2016-07-25 Thread Mengu via Digitalmars-d
On Monday, 25 July 2016 at 09:10:05 UTC, ahahah wrote: haro herro

Re: Getting most derived type of object that implements interface

2016-07-25 Thread ketmar via Digitalmars-d-learn
yep, cast it. without the cast, compiler assuming that it knows the type in runtime, and is using well-known classinfo address instead of really looking into instance for that.

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread lqjglkqjsg via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade ,

Re: asd

2016-07-25 Thread lqjglkqjsg via Digitalmars-d
On Monday, 25 July 2016 at 09:10:05 UTC, ahahah wrote: haro go to hell, big bloody idiot.

Re: Getting most derived type of object that implements interface

2016-07-25 Thread Kagamin via Digitalmars-d-learn
Cast it to Object: FooInterface a = new BarImplementsInterface(); FooBaseClass b = new BarDerivedClass(); Object o = cast(Object)a; writefln("a class: %s", a.classinfo.name); writefln("b class: %s", b.classinfo.name); writefln("o class: %s",

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread rikki cattermole via Digitalmars-d-announce
Hmm, I wonder if it could be extended to also do json as well as xml like.

Re: New Diet template engine almost complete, ready for comments

2016-07-25 Thread Stefan Koch via Digitalmars-d-announce
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote: The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade ,

New Diet template engine almost complete, ready for comments

2016-07-25 Thread Sönke Ludwig via Digitalmars-d-announce
The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade , but instead of JavaScript, all expressions and statements

Re: D-Man culture

2016-07-25 Thread vladdeSV via Digitalmars-d-announce
On Sunday, 24 July 2016 at 07:28:22 UTC, simd wrote: I made D-man ASCII Art last year. https://gist.github.com/simdnyan/20e8fa2a2736c315e2c1 _ _ (_) (_) /__ \ \\(O(O \/ | | | | | |_| | /__/ < > (_) (_) You may also like dl-command (like sl joke command) by ueshita.

Re: asd

2016-07-25 Thread Shachar Shemesh via Digitalmars-d
On 25/07/16 12:10, ahahah wrote: haro And people say chivalry has disappeared from the world

asd

2016-07-25 Thread ahahah via Digitalmars-d
haro

Re: debug public release private

2016-07-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, July 25, 2016 04:58:55 Gorge Jingale via Digitalmars-d-learn wrote: > debug mixin("public"); else mixin("private"); > > Doesn't work. > > It's nice to have public members when debugging because they show > up in the debugger and one can access internals for checking. One > can enable

Getting most derived type of object that implements interface

2016-07-25 Thread cc via Digitalmars-d-learn
I'm having trouble getting the full name of an object of a class that implements an interface, using typeid() or .classinfo, the behavior seems to be different from that of a class that simply derives other classes. interface FooInterface {} class BarImplementsInterface : FooInterface {}

Re: JSON Serialization with runtime filtering.

2016-07-25 Thread Alexander Milushev via Digitalmars-d-learn
On Saturday, 23 July 2016 at 21:30:52 UTC, yawniek wrote: On Friday, 22 July 2016 at 12:36:31 UTC, Alexander Milushev wrote: I there any json serialization library which allow to make decision about ignoring fields in runtime? I trying to write rest client but server accept either 'cmd' or

Re: Transform/Compile to C/CPP as a target

2016-07-25 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:27:24 UTC, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? The short answer is no, not for any recent version of D.

Re: @gc attribute for bypassign @nogc

2016-07-25 Thread rikki cattermole via Digitalmars-d
On 25/07/2016 5:16 PM, Jonathan Marler wrote: On Monday, 25 July 2016 at 03:18:17 UTC, rikki cattermole wrote: On 25/07/2016 10:13 AM, bitwise wrote: [...] I've been saying for a very long time we need @assumenogc attribute like we have @trusted for @safe. I havent seen this assumegc

Re: How do I use the ScopedAllocator?

2016-07-25 Thread Yuxuan Shui via Digitalmars-d
On Sunday, 24 July 2016 at 20:48:55 UTC, Nick Treleaven wrote: On Friday, 22 July 2016 at 01:54:28 UTC, Yuxuan Shui wrote: auto b = alloc.makeArray!A(10, A(1)); auto c = alloc.makeArray!A(2, A(2)); I noticed (using dpaste) if you edit the 'b' line to only

[Issue 14477] Nullable does not work with structs with default constructor disabled

2016-07-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14477 --- Comment #3 from MichaelZ --- This is currently an issue for us, and it has been proposed we use Algebraic!Foo instead, which appears to work sufficiently, see below. What aspects are against doing it this way? The

Re: proposal: private module-level import for faster compilation

2016-07-25 Thread Sebastien Alaiwan via Digitalmars-d
On Sunday, 24 July 2016 at 15:33:04 UTC, Chris Wright wrote: Look at std.algorithm. Tons of methods, and I imported it just for `canFind` and `sort`. Look at std.datetime. It imports eight or ten different modules, and it needs every one of those for something or other. Should we split it

Re: proposal: private module-level import for faster compilation

2016-07-25 Thread Jacob Carlborg via Digitalmars-d
On 2016-07-25 01:12, Dicebot wrote: Benjamin proposed to stop considering `export` a protection attribute and mark all functions called from templates as `export` (allowing `export private` if necessary). Ah, forgot that detail. -- /Jacob Carlborg