Re: D for scripting?

2017-01-19 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-20 08:10, Andrei Alexandrescu wrote: It would be worth it. I think a fix takes some thinking because if I remember correctly the compiler does not accept files without an extension as input. It does. It's been fixed, for exactly this reason. -- /Jacob Carlborg

Re: Catching Errors

2017-01-19 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-20 03:11, Adam D. Ruppe wrote: It is just that Errors are not necessarily *thrown*. The implementation is allowed to immediately abort on them too - your catch has no guarantee to actually run, whereas with Exceptions, they are. That doesn't work well with a unit test framework

Re: DConf 2017 now open for registration

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-01-19 21:53, Walter Bright wrote: $250 for Early Bird tickets! http://dconf.org/2017/registration.html Awesome :). BTW, there's a page missing [1]. [1] http://dconf.org/2017/thankyou.html -- /Jacob Carlborg

Re: Catching Errors

2017-01-19 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-19 17:22, Atila Neves wrote: Just slap @trusted on the part of the framework that catches them. Sure, but that doesn't help with the plan [1] making Errors unable to be caught even in system code. [1] Note sure if it's really the plan but it's been talked about -- /Jacob

Re: Catching Errors

2017-01-19 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-19 16:46, Jack Stouffer wrote: Or, you can mark that unit test block as @system and have @safe tests in another block. No, this is for when the framework is catching the exception. It needs to wrap _all_ unit test blocks in a try-catch. If an assert fails I want the rest of the

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-01-19 14:57, Jacob Carlborg wrote: The changelog is missing an entry to the new default Ddoc theme. I'll see if I can add that. Do we want an image, HTML page or something to show? https://github.com/dlang/dlang.org/pull/1558 -- /Jacob Carlborg

Re: What do you use to generate documentation?

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-01-19 19:45, Suliman wrote: It's seems that there is no any big changes in this deal. The upcoming 2.073.0 (now in release candidate) has a completely new default Ddoc theme. -- /Jacob Carlborg

Re: What do you use to generate documentation?

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2013-03-13 10:35, Andrea Fontana wrote: I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? Yes :). The upcoming 2.073.0 (now in release candidate) has a completely new default Ddoc theme.

Re: D for scripting?

2017-01-19 Thread Andrei Alexandrescu via Digitalmars-d
On 1/20/17 3:59 AM, 岩倉 澪 wrote: I feel like the shebang is totally worth it if I could name my file without .d and symlink to it. Would it be reasonable to change rdmd to allow these features? I'd be happy to look into writing a patch for it if it wouldn't be a waste of time. It would be worth

D for scripting?

2017-01-19 Thread 岩倉 澪 via Digitalmars-d
Last weekend I tried porting some old shell scripts to D, as I think D is actually extremely well suited as a shell script replacement. My scripts are so much more robust now and do things like rolling back on errors and having debug mode, all with roughly the same amount of lines as the

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread rikki cattermole via Digitalmars-d-learn
On 20/01/2017 9:29 AM, Rene Zwanenburg wrote: On Thursday, 19 January 2017 at 14:04:36 UTC, aberba wrote: Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual

Re: Catching Errors

2017-01-19 Thread Jon Degenhardt via Digitalmars-d
On Friday, 20 January 2017 at 02:11:41 UTC, Adam D. Ruppe wrote: On Friday, 20 January 2017 at 01:24:18 UTC, Jon Degenhardt wrote: Is there a place in the docs that describe the difference between errors and exceptions? As to the particular example, why is it unsafe to recover from attempting

[Issue 16697] Extend IsExpression to accept __vector as a TypeSpecialization

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16697 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16697] Extend IsExpression to accept __vector as a TypeSpecialization

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16697 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f298a8ca60fab15ac5a552f2818daf9724f2e0df Fix issue 16697 - Accept __vector as type specialization in

Re: Making .exe

2017-01-19 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 19 January 2017 at 21:47:53 UTC, Dlearner wrote: Yo! Okay I did this and I run the .exe and it works, but if I try to copy/paste it on my desktop and run it, it (obviously) doesn't work. Is there a way to somehow compile the source, .dll's and image file that I'm using together

Re: Catching Errors

2017-01-19 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 20 January 2017 at 01:24:18 UTC, Jon Degenhardt wrote: Is there a place in the docs that describe the difference between errors and exceptions? As to the particular example, why is it unsafe to recover from attempting to access memory past the end of the array, as long as the access

Re: Catching Errors

2017-01-19 Thread Chris Wright via Digitalmars-d
On Fri, 20 Jan 2017 01:24:18 +, Jon Degenhardt wrote: > As > to the particular example, why is it unsafe to recover from attempting > to access memory past the end of the array, as long as the access was > prevented? Because array bounds checking seems to be intended as an aid to find bugs,

Re: Catching Errors

2017-01-19 Thread Chris Wright via Digitalmars-d
On Thu, 19 Jan 2017 14:29:46 +, Jack Stouffer wrote: > From what I understand, the difference between an Exception and and > Error is that Errors signal your program has entered into an invalid > state. That's the intent, but I don't think that matches reality. > For example, going past the

with not working wtih BitFlags

2017-01-19 Thread Jot via Digitalmars-d-learn
struct EnumToFlags(alias E) { template opDispatch(string Name) { enum opDispatch = 1 << __traits(getMember, E, Name); }; }; enum X { a,b,c } auto q = EnumtoFlags!X; auto m = q.a; with(q) { auto m = a; } a undefined. Any way to get it to work? Maybe a

Re: cannot alias array ;/

2017-01-19 Thread Jot via Digitalmars-d-learn
On Thursday, 19 January 2017 at 12:50:06 UTC, John Colvin wrote: On Thursday, 19 January 2017 at 07:48:03 UTC, Jot wrote: alias a = myarray[k]; fails myarray is a multidimensial array that I want to reduce writing it every time but D complains that it can't alias it. I simply want it to do

Re: Catching Errors

2017-01-19 Thread Kapps via Digitalmars-d
On Friday, 20 January 2017 at 01:24:18 UTC, Jon Degenhardt wrote: On Thursday, 19 January 2017 at 14:29:46 UTC, Jack Stouffer wrote: [...] I think this is an area of D I haven't explored yet. Is there a place in the docs that describe the difference between errors and exceptions? As to the

Re: Catching Errors

2017-01-19 Thread Jon Degenhardt via Digitalmars-d
On Thursday, 19 January 2017 at 14:29:46 UTC, Jack Stouffer wrote: From what I understand, the difference between an Exception and and Error is that Errors signal your program has entered into an invalid state. For example, going past the end of an array and attempting to access that memory.

Re: iterating through members of bitfields

2017-01-19 Thread Nestor via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 12:52:56 UTC, drug wrote: I've "solved" the same problem by using AliasSeq to generate bitfields so that for iterating over bitfields I can iterate over alias sequence and mixin code. Not very good but it works. Interesting, could you provide a working

[Issue 17102] std.write.file generates a segmentation fault when the file name is a string with a default value

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17102 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

[Issue 16323] std.utf.decodeBack

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16323 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/944e7da50b80d916a2e0edd5b4f8d886de8b45b5 Fix issue #16323 - implement utf.encodeBack function

[Issue 16210] std.utf.byUTF can be made into a bidirectional range

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16210 Issue 16210 depends on issue 16323, which changed state. Issue 16323 Summary: std.utf.decodeBack https://issues.dlang.org/show_bug.cgi?id=16323 What|Removed |Added

Re: Making .exe

2017-01-19 Thread Dlearner via Digitalmars-d-learn
On Thursday, 19 January 2017 at 20:56:41 UTC, Nemanja Boric wrote: On Thursday, 19 January 2017 at 18:58:31 UTC, Dlearner wrote: [...] Hello! The binary should be in the working directory: ``` ➜ dub init Package recipe format (sdl/json) [json]: Name [test-dub]: Description [A minimal D

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Suliman via Digitalmars-d-announce
On Thursday, 19 January 2017 at 19:22:07 UTC, Rainer Schuetze wrote: On 19.01.2017 08:32, Suliman wrote: http://dlang.org/changelog/2.073.0.html#mscrtlib-option How can I set this flag in dub.json? I tried: "dflags": [ "-mscrt=msvcrt" ] but got error: Error: unrecognized switch

Re: Making .exe

2017-01-19 Thread Nemanja Boric via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:58:31 UTC, Dlearner wrote: Hey! I wrote a little program that has an image bounce around and change colours, like the old DVD player screensavers. How can I build this as a little .exe file that I can send to someone? In the dub documentation there is

DConf 2017 now open for registration

2017-01-19 Thread Walter Bright via Digitalmars-d-announce
$250 for Early Bird tickets! http://dconf.org/2017/registration.html

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 19 January 2017 at 14:04:36 UTC, aberba wrote: Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual calculations but from Phobos functions. You can

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Rainer Schuetze via Digitalmars-d-announce
On 19.01.2017 20:22, Rainer Schuetze wrote: On 19.01.2017 08:32, Suliman wrote: http://dlang.org/changelog/2.073.0.html#mscrtlib-option How can I set this flag in dub.json? I tried: "dflags": [ "-mscrt=msvcrt" ] but got error: Error: unrecognized switch '-mscrt=msvcrt' Ouch, the switch is

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Rainer Schuetze via Digitalmars-d-announce
On 19.01.2017 08:32, Suliman wrote: http://dlang.org/changelog/2.073.0.html#mscrtlib-option How can I set this flag in dub.json? I tried: "dflags": [ "-mscrt=msvcrt" ] but got error: Error: unrecognized switch '-mscrt=msvcrt' Ouch, the switch is actually called -mscrtlib. We need to fix the

Making .exe

2017-01-19 Thread Dlearner via Digitalmars-d-learn
Hey! I wrote a little program that has an image bounce around and change colours, like the old DVD player screensavers. How can I build this as a little .exe file that I can send to someone? In the dub documentation there is something like `dub --build=`, but I'm not entirely sure what this

Re: What do you use to generate documentation?

2017-01-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:45:05 UTC, Suliman wrote: It's seems that there is no any big changes in this deal. I made my doc gen since then and ddox has grown since then as well. Only other major change is ddoc just got new styling in the newest dmd beta. Still the same ddoc, just

Re: What do you use to generate documentation?

2017-01-19 Thread Suliman via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:09:20 UTC, Basile B. wrote: On Thursday, 19 January 2017 at 15:20:37 UTC, Suliman wrote: What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Thursday, 19 January 2017 at 15:20:37 UTC, Suliman wrote: What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of app what is the reason to use this flag? Oh no 2013 !! I

[Issue 17109] std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 --- Comment #5 from Sophie --- (In reply to Jack Stouffer from comment #4) > (In reply to Sophie from comment #3) > The problem is, if I just get strings, then std.csv is useless because I can > just do this > > auto

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Thursday, 19 January 2017 at 17:06:39 UTC, Nemanja Boric wrote: On Thursday, 19 January 2017 at 16:47:07 UTC, Basile B. wrote: [...] I've submitted few PRs but they never got merged. We're maintaining, unofficially, fork that does compile and it's available at:

[Issue 17109] std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 --- Comment #4 from Jack Stouffer --- (In reply to Sophie from comment #3) > It's a missing value, but in the case of numeric types a missing value is > simply one example of a malformed value. I think the better approach in

Re: Android LDC in a Container

2017-01-19 Thread Andre Pany via Digitalmars-d-announce
On Sunday, 15 January 2017 at 17:40:01 UTC, Andre Pany wrote: Hi, on Dockerhub I published a repository which makes it really easy to develop Android applications using LDC and Joakims work. The repository contains Android 1.1.0 beta from https://github.com/joakim-noah/android/releases and

Re: std.traits vcs __traits

2017-01-19 Thread Nick Treleaven via Digitalmars-d
On Tuesday, 17 January 2017 at 18:22:06 UTC, Nordlöw wrote: https://github.com/dlang/phobos/pull/5038 This makes (at least) UnsignedTypeOf unused in Phobos, and it's undocumented but public. There are LREFs in the std.traits docs under the SomethingTypeOf section - none of these links go

[Issue 17109] std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 --- Comment #3 from Sophie --- It's a missing value, but in the case of numeric types a missing value is simply one example of a malformed value. I think the better approach in the code you used as an example would be to not

Re: What do you use to generate documentation?

2017-01-19 Thread Nemanja Boric via Digitalmars-d-learn
On Thursday, 19 January 2017 at 16:47:07 UTC, Basile B. wrote: On Wednesday, 13 March 2013 at 09:35:18 UTC, Andrea Fontana wrote: [...] I use harbored-mod (https://github.com/kiith-sa/hmod-dub). What I like about it: 1/ I'm not good with web things. The default styling is Okay for me so I

[Issue 17109] std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 --- Comment #2 from Jack Stouffer --- (In reply to Sophie from comment #1) > I think this is the correct behavior. The empty string is not valid as a > floating point value, nan or otherwise. This is going to sound dramatic,

Re: Catching Errors

2017-01-19 Thread Jack Stouffer via Digitalmars-d
On Thursday, 19 January 2017 at 14:29:46 UTC, Jack Stouffer wrote: From what I understand, the difference between an Exception and and Error is that Errors signal your program has entered into an invalid state. For example, going past the end of an array and attempting to access that memory.

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 13 March 2013 at 09:35:18 UTC, Andrea Fontana wrote: I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? I expected a phobos-like documentation. So, what do you use to generate

[Issue 12679] std.typecons.Maybe

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12679 Nick Treleaven changed: What|Removed |Added CC||n...@geany.org --- Comment

Re: Catching Errors

2017-01-19 Thread Atila Neves via Digitalmars-d
On Thursday, 19 January 2017 at 15:43:26 UTC, Jacob Carlborg wrote: On 2017-01-19 15:29, Jack Stouffer wrote: If this is the case, would it not make sense to make it illegal to catch Errors in @safe code? There's the issue with AssertError, which is useful for a unit test framework to

[Issue 17109] std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 Jack Stouffer changed: What|Removed |Added Hardware|x86 |All

[Issue 17109] New: std.csv chokes on empty columns when parsing to struct

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17109 Issue ID: 17109 Summary: std.csv chokes on empty columns when parsing to struct Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity:

Re: Catching Errors

2017-01-19 Thread Jack Stouffer via Digitalmars-d
On Thursday, 19 January 2017 at 15:43:26 UTC, Jacob Carlborg wrote: On 2017-01-19 15:29, Jack Stouffer wrote: If this is the case, would it not make sense to make it illegal to catch Errors in @safe code? There's the issue with AssertError, which is useful for a unit test framework to

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-01-19 16:21, Martin Nowak wrote: It seems sufficiently different to not worry about a Win only switch, it's used for selecting different flavours of MS libcrt (threaded, debug...). IMO we should try to depart with hard-coding linker flags into the compiler. Fair enough. -- /Jacob

Re: Catching Errors

2017-01-19 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-19 15:29, Jack Stouffer wrote: If this is the case, would it not make sense to make it illegal to catch Errors in @safe code? There's the issue with AssertError, which is useful for a unit test framework to catch. Perhaps it could throw an AssertException instead when the

Re: What do you use to generate documentation?

2017-01-19 Thread Suliman via Digitalmars-d-learn
What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of app what is the reason to use this flag?

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Martin Nowak via Digitalmars-d-announce
On Thursday, 19 January 2017 at 07:43:29 UTC, Jacob Carlborg wrote: About the new -mscrt=libname flag. Could we have a more generic name of the flag that would fit for other platforms to specify the C library, i.e. Musl instead of GNU? Or is this something different? It seems sufficiently

[Issue 15256] Data races with arrays allowed in @safe code

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15256 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

Re: Catching Errors

2017-01-19 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Thursday, 19 January 2017 at 14:29:46 UTC, Jack Stouffer wrote: From what I understand, the difference between an Exception and and Error is that Errors signal your program has entered into an invalid state. For example, going past the end of an array and attempting to access that memory.

Catching Errors

2017-01-19 Thread Jack Stouffer via Digitalmars-d
From what I understand, the difference between an Exception and and Error is that Errors signal your program has entered into an invalid state. For example, going past the end of an array and attempting to access that memory. On the flip side, Exceptions signal that something out of the

Re: Language server protocol implementation for D

2017-01-19 Thread aberba via Digitalmars-d
On Wednesday, 18 January 2017 at 09:31:49 UTC, xtreak wrote: Rust is making good progress on the IDE aspect with the announcement : http://www.jonathanturner.org/2017/01/rls-alpha-release.html. HN discussion : https://news.ycombinator.com/item?id=1348 It will be good to see the protocol

[Issue 17108] Associative array byKeyValue is unsafe

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17108 Jack Stouffer changed: What|Removed |Added Keywords||safe --

[Issue 17108] New: Associative array byKeyValue is unsafe

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17108 Issue ID: 17108 Summary: Associative array byKeyValue is unsafe Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority:

Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread aberba via Digitalmars-d-learn
Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual calculations but from Phobos functions.

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-01-18 14:48, Martin Nowak wrote: First release candidate for 2.073.0. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.073.0.html The changelog is missing an entry to the new default Ddoc theme. I'll see if I can add that. Do we want an image, HTML page or

[Issue 16564] KRRegion.empty sometimes returns Ternary.no

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16564 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8a69b104513d5f95e31be65b04a6502f559a95c0 fix issue 16564

[Issue 7016] local import does not create -deps dependency

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7016 --- Comment #28 from Vladimir Panteleev --- (In reply to RazvanN from comment #27) > -> add another compiler flag: "-rdeps" (or maybe a more inspired name) which >will recurs through all the dependencies, excluding

[Issue 7016] local import does not create -deps dependency

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7016 --- Comment #27 from RazvanN --- Running semantic3 recursively on dependencies will end up in an infinite loop when there are circular imports. So, I propose the following solution: -> the current -deps implementation

Re: Vision document for H1 2017

2017-01-19 Thread qznc via Digitalmars-d-announce
On Wednesday, 4 January 2017 at 19:22:33 UTC, Andrei Alexandrescu wrote: We release a brief Vision document summarizing the main goals we plan to pursue in the coming six months. This half we are focusing on three things: safety, lifetime management, and static introspection.

Re: Getters/setters generator

2017-01-19 Thread Mark via Digitalmars-d-announce
On Wednesday, 18 January 2017 at 21:57:42 UTC, Andrei Alexandrescu wrote: On 1/18/17 5:29 PM, Mark wrote: I see. Is there a way to call invariant() of a class/struct directly? That would obviate the need for a particular predicate (copy the class state, run the setter, check if invariants are

Re: Plugin for 1C:Enterprise in dmd

2017-01-19 Thread MGW via Digitalmars-d-announce
On Wednesday, 18 January 2017 at 23:33:15 UTC, Dmitry Olshansky wrote: On 1/18/17 1:00 PM, MGW wrote: Sourse files https://github.com/MGWL/QtE5/tree/master/examples/1C_vk

[Issue 8471] std.stdio.readf should be @trusted

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8471 --- Comment #8 from Jakub Łabaj --- Sorry, I'm not sure what you mean by that - what are the next steps to do here? --

Re: version identifier hygiene

2017-01-19 Thread Ali Çehreli via Digitalmars-d
Moving from digitalmars.D.Learn... tl;dr It seems to be a good guideline to always name-mangle your version identifiers with the package (and module) name. Otherwise, you will risk confusions and conflicts on the build line. Ali On 01/16/2017 11:23 PM, Jacob Carlborg wrote: On 2017-01-16

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 01:06 AM, Ali Çehreli wrote: > In other words, D's string > mixins are the same as C's macros. I was testing you! :p I meant "NOT the same as". :p Ali

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 12:41 AM, Chris Katko wrote: > 1 - Is there any way TO get the output 64,64? You can mixin the entire statement. I used the ~ operator but you can use format() or the return value of a function as well: mixin("array_t!(" ~ sizer2D!() ~ ") case2;"); // ...

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Daniel N via Digitalmars-d-learn
On Thursday, 19 January 2017 at 08:41:53 UTC, Chris Katko wrote: Thank you! So: 1 - Is there any way TO get the output 64,64? Would this work for you? import std.meta; alias sizer1D = AliasSeq!(64); alias sizer2D = AliasSeq!(64,64); array_t!sizer2D caseX; array2_t!sizer1D caseY;

Re: switch statement with variable branches

2017-01-19 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 19 January 2017 at 01:22:56 UTC, Yuxuan Shui wrote: Somehow I can't use ubyte variables behind 'case', but ulong works fine. Why is that? void main() { alias TestType = ulong; // won't compile if = ubyte import std.stdio; TestType a,b,c; readf("%s

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
Thank you! So: 1 - Is there any way TO get the output 64,64? It seems like being able to get a comma out of a mixin is a useful feature. 2 - Is this very non-standard / unrecommended practice and there's a much better way to do this? For example, in my actual code, I have an enumerator:

Re: Release Candidate 2.073.0-rc1

2017-01-19 Thread xtreak via Digitalmars-d-announce
On Wednesday, 18 January 2017 at 13:48:06 UTC, Martin Nowak wrote: First release candidate for 2.073.0. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.073.0.html Comes with a couple of more fixes: https://github.com/dlang/dmd/compare/v2.073.0-b2...v2.073.0-rc1

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 12:03 AM, Chris Katko wrote: > template sizer2D() // no params here for simplicity > { > const char [] sizer2D = "64,64"; > } > array_t!(mixin(sizer2D!())) case2; // FAILS (error below) > Error: template instance array_t!64 does not match template declaration >

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
Addendum: Writing the following: writeln(mixin(sizer2D!())); simply dumps 64 to stdout. What's going on here? Have I run into a compiler bug?

Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
I've tried to narrow this down to the minimum code that exhibits the problem. When I use a mixin, to supply the parameters for a template, it works with ONE argument, but NOT TWO. template sizer2D() // no params here for simplicity { const char [] sizer2D = "64,64";

[Issue 8471] std.stdio.readf should be @trusted

2017-01-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8471 --- Comment #7 from Andrei Alexandrescu --- Cool, thanks, then the bug is legit. The fix would be a @safe function with a small @trusted core. --