Re: Things I found great about TypeScript that D could benefit from

2018-04-27 Thread rikki cattermole via Digitalmars-d
On 28/04/2018 7:17 AM, w0rp wrote: Hello everyone! I haven't written a post in a long time. I love D, and I've been a D hobbyist for years now. Though I haven't written any D in a long time, I keep an eye on the changelogs and such. More recently I've been using TypeScript (TS) at work for

Re: readonly member (but assignable at constructor time)

2018-04-27 Thread lempiji via Digitalmars-d-learn
On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: In C# you can have a readonly member assignable either at declaration or constructor time, like this: class C { readonly myClass mc; this() { mc = new myClass(); } void doSomething() { mc = new myClass(); // wrong!

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-27 Thread Meta via Digitalmars-d
On Thursday, 26 April 2018 at 23:26:30 UTC, Walter Bright wrote: Besides, redundancy can make a program easier to read (English has a lot of it, and is hence easy to read). I completely agree. I always make an effort to make my sentences as redundant as possible such that they can be easily

[Issue 18806] New: minIndex should be able to take an input range but does not

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18806 Issue ID: 18806 Summary: minIndex should be able to take an input range but does not Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Things I found great about TypeScript that D could benefit from

2018-04-27 Thread Mark via Digitalmars-d
On Friday, 27 April 2018 at 19:17:14 UTC, w0rp wrote: * Writing `(InputRange r)` instead of `(T)(T r) if (isInputRange!T)` would be a nice improvement, and writing something like this hypothetical `InputRange` concept could be a lot easier, somehow. (C++20 might finally include concepts.)

Re: Favorite GUI library?

2018-04-27 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/27/2018 06:29 AM, Chris wrote: On Thursday, 26 April 2018 at 02:31:07 UTC, Nick Sabalausky (Abscissa) wrote: On 04/25/2018 05:49 AM, Chris wrote: Well yea, all the hipster nerds say Google is God and Chrome is what you should be using, so it must be so. ;) At the very least, I just

[Issue 18805] New: crash in iteration.d

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18805 Issue ID: 18805 Summary: crash in iteration.d Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: major Priority: P1

Things I found great about TypeScript that D could benefit from

2018-04-27 Thread w0rp via Digitalmars-d
Hello everyone! I haven't written a post in a long time. I love D, and I've been a D hobbyist for years now. Though I haven't written any D in a long time, I keep an eye on the changelogs and such. More recently I've been using TypeScript (TS) at work for front end code. TypeScript is a very

Re: E-mail attachment with unwanted characters

2018-04-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 27 April 2018 at 17:57:26 UTC, Vino.B wrote: headers.insert(to!string(Base64.encode(Content)) ~ ".\r\n"); headers.insert("--" ~ boundary ~ "."); what are those random dots for?

E-mail attachment with unwanted characters

2018-04-27 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help, the below code is working as expected, but when I receive the attachment, the attachment contains the orginal text plus some unwanted characters like below, can someone help me how to remove these unwanted characters. Unwanted characters This is a test

2.080.0-rc.1 [was: Beta 2.080.0]

2018-04-27 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Release candidate available now. http://dlang.org/changelog/2.080.0.html http://dlang.org/download.html#dmd_beta - -Martin -BEGIN PGP SIGNATURE- iQIzBAEBCgAdFiEEpzRNrTw0HqEtE8TmsnOBFhK7GTkFAlrjYAYACgkQsnOBFhK7

Re: Beta 2.080.0

2018-04-27 Thread Martin Nowak via Digitalmars-d-announce
On 04/23/2018 02:53 PM, Chris M. wrote: > Under https://dlang.org/changelog/2.080.0.html#rwm-shared-error > > It should be core.atomic.atomicOp instead of atomic.atomicOp.core Thanks, code that needs fixing is here

Re: Get files from directory sorted by name

2018-04-27 Thread Dr.No via Digitalmars-d-learn
On Friday, 27 April 2018 at 14:48:00 UTC, Jesse Phillips wrote: On Thursday, 26 April 2018 at 16:59:45 UTC, Dr.No wrote: On Wednesday, 25 April 2018 at 19:25:11 UTC, Jesse Phillips wrote: On Wednesday, 25 April 2018 at 17:34:41 UTC, Dr.No wrote: Is there something implemented already to get

Re: Making an .exe that executes source file inside itself.

2018-04-27 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 27 April 2018 at 14:57:34 UTC, BoQsc wrote: On Friday, 27 April 2018 at 04:30:32 UTC, IntegratedDimensions wrote: On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc

Re: The dlang-community releases DCD 0.9.3 and D-Scanner 0.5.2

2018-04-27 Thread Seb via Digitalmars-d-announce
On Friday, 27 April 2018 at 15:20:15 UTC, Jacob Carlborg wrote: On 2018-04-27 09:43, baz@dlang-community wrote: DCD 0.9.4 is available now. Same link. How come there are no binaries for macOS? Seems to be a release script and Travis CI configuration for macOS. Because the DCD release

Fail to build ldc with a llvm SPIR-V enabled

2018-04-27 Thread bioinfornatics via Digitalmars-d
Dear, After to build the llvm lib from https://github.com/thewilsonator/llvm . I tried to build ldc2 with v1.9-beta1 /ldc2-1.9/tools/ldc-profdata/llvm-profdata-5.0.cpp:175:6: error: no matching function for call to

Re: What stops DMD from cross-compiling?

2018-04-27 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-27 12:56, Rel wrote: So, okey, bare with me here. As I once told here before the only one thing I love about Golang is the ability to easily cross-compile code from any supported OS targeting any supported OS. So I was thinking what actually stops DMD from doing the same thing? DMD

[Issue 18804] New: Side effects incorrectly optimized out when results are discarded

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18804 Issue ID: 18804 Summary: Side effects incorrectly optimized out when results are discarded Product: D Version: D2 Hardware: x86 OS: Windows Status:

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-27 Thread Chris via Digitalmars-d
On Friday, 27 April 2018 at 00:18:05 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 04:26:30PM -0700, Walter Bright via Digitalmars-d wrote: [...] [...] People often complain about how redundant natural languages are... not realizing that it actually provides, in addition to being easier to

Re: The dlang-community releases DCD 0.9.3 and D-Scanner 0.5.2

2018-04-27 Thread Jacob Carlborg via Digitalmars-d-announce
On 2018-04-27 09:43, baz@dlang-community wrote: DCD 0.9.4 is available now. Same link. How come there are no binaries for macOS? Seems to be a release script and Travis CI configuration for macOS. -- /Jacob Carlborg

Re: Pre-DConf Meetup on May 1

2018-04-27 Thread Jacob Carlborg via Digitalmars-d-announce
On 2018-04-25 16:13, Seb wrote: Hi all, I hope you are all looking forward to DConf. We (Stefan, Dragos and I) have very good news for you. Our next D Munich Meetup will coincide with DConf to give our local community who can't join DConf an opportunity to meetup all the rockstars from the D

[Issue 18803] New: just "static if" in nested import crashes dmd

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18803 Issue ID: 18803 Summary: just "static if" in nested import crashes dmd Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: minor

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-27 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 27, 2018 at 06:22:55AM +, sarn via Digitalmars-d wrote: [...] > The first Haskell tutorial I read was written by someone who thought > it would be cute to do mathsy typesetting of all the syntax. E.g., -> > became some right arrow symbol, meaning that nothing the book taught >

Re: Making an .exe that executes source file inside itself.

2018-04-27 Thread BoQsc via Digitalmars-d-learn
On Friday, 27 April 2018 at 04:30:32 UTC, IntegratedDimensions wrote: On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 19:43:31 UTC,

Re: Get files from directory sorted by name

2018-04-27 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 26 April 2018 at 16:59:45 UTC, Dr.No wrote: On Wednesday, 25 April 2018 at 19:25:11 UTC, Jesse Phillips wrote: On Wednesday, 25 April 2018 at 17:34:41 UTC, Dr.No wrote: Is there something implemented already to get the files from directory by name using D or I'm on my own and I

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-27 Thread Alex via Digitalmars-d-learn
On Friday, 27 April 2018 at 13:43:47 UTC, Timoses wrote: `instantiateWith` gets called in three variations (menum.A, menum.B and menum.C). This causes instantiateWith to return TempStruct for each case of Temp... However, I was under the impression that a templated function will exist

Re: Auto expiring cache library

2018-04-27 Thread Jack Stouffer via Digitalmars-d-learn
On Friday, 27 April 2018 at 09:07:31 UTC, Pasqui23 wrote: I want a library that offers an in-memory data structure,such that I can write,for example: cache.insert(key,value,expiry) and I can retrieve the value with something like cache[key],unless it has passed expiry seconds. Can be

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-27 Thread Timoses via Digitalmars-d-learn
On Friday, 27 April 2018 at 13:39:22 UTC, Simen Kjærås wrote: That's an unfortunate error message. The problem is TempStruct is defined inside the Temp template. In the same way that struct Foo(T) {} is different for Foo!int and Foo!string, TempStruct is a different type for Temp!(menum.A) and

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-27 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 27 April 2018 at 13:27:45 UTC, Timoses wrote: Bumped across another problem : / ``` import std.stdio; enum menum { A, B, C } void main() { foo(menum.A); } void foo(menum e) { writeln(instantiateWith!Temp(e)); } auto instantiateWith(alias Fn, T)(T x) if (is(T == enum))

[Issue 18267] array comparison broken in 2.078.3

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18267 Mike Franklin changed: What|Removed |Added CC||slavo5...@yahoo.com

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-27 Thread Timoses via Digitalmars-d-learn
Bumped across another problem : / ``` import std.stdio; enum menum { A, B, C } void main() { foo(menum.A); } void foo(menum e) { writeln(instantiateWith!Temp(e)); } auto instantiateWith(alias Fn, T)(T x) if (is(T == enum)) { switch (x) { import std.traits :

[Issue 18802] New: [REG2.080] Safe block causing lifetime problem

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18802 Issue ID: 18802 Summary: [REG2.080] Safe block causing lifetime problem Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: regression

Re: Idiomatic way to add examples to dub package

2018-04-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 April 2018 at 18:16:01 UTC, FreeSlave wrote: Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add examples? IMO the most simple way (and the best too) is to put single file packages in the example folder, so that an

Re: SecureD 1.0.0 Released!

2018-04-27 Thread Martin Tschierschke via Digitalmars-d-announce
On Friday, 27 April 2018 at 10:18:10 UTC, Dechcaudron wrote: On Friday, 27 April 2018 at 09:57:03 UTC, Adam Wilson wrote: As always, PR's are welcome. Link to repo? You can find it at DUB (code.dlang.org): https://code.dlang.org/packages/secured

Re: Idiomatic way to add examples to dub package

2018-04-27 Thread drug via Digitalmars-d-learn
27.04.2018 13:58, Laurent Tréguier пишет: This is the way Rust packages handle their Cargo.lock file, if I'm not mistaken, and it seems reasonable to me Exactly

What stops DMD from cross-compiling?

2018-04-27 Thread Rel via Digitalmars-d
So, okey, bare with me here. As I once told here before the only one thing I love about Golang is the ability to easily cross-compile code from any supported OS targeting any supported OS. So I was thinking what actually stops DMD from doing the same thing? DMD has own backends targeting X86

Re: Idiomatic way to add examples to dub package

2018-04-27 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 27 April 2018 at 10:18:53 UTC, drug wrote: dub.selections.json shouldn't be included in case of library because it should be configured at import site. in case of application it has been configured and so dub.selections.json should be included. IMHO. This is the way Rust packages

Re: Favorite GUI library?

2018-04-27 Thread Chris via Digitalmars-d
On Thursday, 26 April 2018 at 02:31:07 UTC, Nick Sabalausky (Abscissa) wrote: On 04/25/2018 05:49 AM, Chris wrote: Well yea, all the hipster nerds say Google is God and Chrome is what you should be using, so it must be so. ;) At the very least, I just wish there was a good choice. Mozilla

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-27 Thread Timoses via Digitalmars-d-learn
On Thursday, 26 April 2018 at 16:46:11 UTC, Simen Kjærås wrote: The only step you're missing is the template needs to be instantiated inside the static foreach, like this: auto instantiateWith(alias Fn, T)(T x) if (is(T == enum)) { import std.traits : EnumMembers; switch (x) {

Re: Idiomatic way to add examples to dub package

2018-04-27 Thread drug via Digitalmars-d-learn
26.04.2018 21:16, FreeSlave пишет: Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add examples? I used sub-packages with dependency on the library and "*" as version and running them as dub run :examplename Now I've noticed vibed uses

Re: SecureD 1.0.0 Released!

2018-04-27 Thread Dechcaudron via Digitalmars-d-announce
On Friday, 27 April 2018 at 09:57:03 UTC, Adam Wilson wrote: As always, PR's are welcome. Link to repo?

SecureD 1.0.0 Released!

2018-04-27 Thread Adam Wilson via Digitalmars-d-announce
Hello! I am pleased to announce that after a year of development and stabilization SecureD has been released in stable form. The most recent release consists of an upgrade to OpenSSL 1.1 in order to be compliant with more recent and supported versions of OpenSSL. If you need to use OpenSSL

Auto expiring cache library

2018-04-27 Thread Pasqui23 via Digitalmars-d-learn
I want a library that offers an in-memory data structure,such that I can write,for example: cache.insert(key,value,expiry) and I can retrieve the value with something like cache[key],unless it has passed expiry seconds. Can be done?What library should I use?

Re: Making an .exe that executes source file inside itself.

2018-04-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 26 April 2018 at 10:06:57 UTC, JN wrote: On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: Alternatively, I don't know about specifics how to implement it in D, but the key phrase you are looking for is "code hotswap" or "hot loading". It's being popularized right now in

[Issue 14536] Calling destroy() on a on an extern(C++) class causes a segfault

2018-04-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14536 Simen Kjaeraas changed: What|Removed |Added CC|

Re: The dlang-community releases DCD 0.9.3 and D-Scanner 0.5.2

2018-04-27 Thread baz@dlang-community via Digitalmars-d-announce
On Monday, 23 April 2018 at 17:04:09 UTC, Baz @dlang-community wrote: Time to update your favorite D completion daemon and D linter since previous patch were not announced. Changelogs: - https://github.com/dlang-community/DCD/releases - https://github.com/dlang-community/D-Scanner/releases

Re: which LLVM source should I use in order to use SPIRV through DCompute ?

2018-04-27 Thread bioinfornatics via Digitalmars-d
On Thursday, 26 April 2018 at 23:06:54 UTC, Nicholas Wilson wrote: On Thursday, 26 April 2018 at 22:51:59 UTC, bioinfornatics wrote: Dear, Dcompute: https://github.com/libmir/dcompute need a SPIRV capable LLVM. For this Dcompute project show https://github.com/thewilsonator/llvm as a SPIRV

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-27 Thread sarn via Digitalmars-d
On Friday, 27 April 2018 at 04:06:52 UTC, Nick Sabalausky (Abscissa) wrote: One of the items on my bucket list is to write a "CS Theory for Programmers" book that actually fills in all this stuff, along with going easy on the math-theory syntax that you can't realistically expect programmers