Posix access function

2016-10-18 Thread tcak via Digitalmars-d-learn
Checked std.stdio, std.file, std.path, couldn't have found anyway to check permissions on a file for read, write, execute. Without getting into core module, does it exist anywhere in std module?

Re: TIL: auto struct members

2016-10-18 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 22:12:47 UTC, Ali Çehreli wrote: It may be embarrassing to discover this fact so late but you can define struct members as 'auto': import std.range; import std.algorithm; struct S { auto r = only("a", "b").cycle;// <-- WOW! } pragma(msg, typeof(S.r));

Re: TIL: auto struct members

2016-10-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, October 19, 2016 03:30:06 Basile B. via Digitalmars-d-learn wrote: > On Tuesday, 18 October 2016 at 22:12:47 UTC, Ali Çehreli wrote: > > It may be embarrassing to discover this fact so late but you > > can define struct members as 'auto': > > > > import std.range; > > import

Re: Posix access function

2016-10-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, October 19, 2016 04:29:30 tcak via Digitalmars-d-learn wrote: > Checked std.stdio, std.file, std.path, couldn't have found anyway > to check permissions on a file for read, write, execute. > > Without getting into core module, does it exist anywhere in std > module? On POSIX,

Re: Render SVG To Display And Update Periodically

2016-10-18 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 21:00:12 UTC, Karabuta wrote: On Monday, 17 October 2016 at 07:18:40 UTC, ketmar wrote: On Monday, 17 October 2016 at 07:05:24 UTC, ketmar wrote: [...] oops, forgot to give some links. ;-) nanovg and nanosvg ports: http://repo.or.cz/iv.d.git/tree/HEAD:/nanovg

Re: Visual Studio Linker Problem

2016-10-18 Thread Johan Engelen via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 05:23:15 UTC, Jason C. Wells wrote: I am working my way up to building NanoVG per my previous post. I am able to compile hello world using dmd2. I am running in cygwin because I understand bash way better than cmd.exe. Does `ldc2 hello.d` also fail in cmd.exe?

Re: Speed of synchronized

2016-10-18 Thread Christian Köstlin via Digitalmars-d-learn
On 18/10/16 07:04, Daniel Kozak via Digitalmars-d-learn wrote: > dub run --build=release --compiler=ldc on my machine i get the following output (using ldc2) ldc2 --version 09:32 LDC - the LLVM D compiler (1.0.0): based on DMD v2.070.2 and LLVM 3.8.1 built with LDC - the LLVM D compiler

Re: Visual Studio Linker Problem

2016-10-18 Thread kink via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 05:23:15 UTC, Jason C. Wells wrote: I am able to compile hello world using dmd2. I am running in cygwin because I understand bash way better than cmd.exe. I bet it works if you invoke LDC outside bash. bash may tamper with environment variables, I've had a

Re: inferred size for static array initialization

2016-10-18 Thread Nordlöw via Digitalmars-d-learn
On Monday, 2 May 2016 at 17:43:56 UTC, Namespace wrote: immutable auto a = [1,2,3].s; Will that have zero run-time overhead compared to: immutable int[3] a = [1,2,3]; ?

Re: From Python to Dlang

2016-10-18 Thread rikki cattermole via Digitalmars-d-learn
On 19/10/2016 1:03 AM, Alfred Newman wrote: Hello and greetings, I'm a brand new D developer coming from Python. I decided to move to D, mainly because it's a compiled language and has a great runtime speed (and I don't feel confortable at Cython environment at all). And of course, D has a

Re: From Python to Dlang

2016-10-18 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 12:03:54 UTC, Alfred Newman wrote: Hello and greetings, I'm a brand new D developer coming from Python. I decided to move to D, mainly because it's a compiled language and has a great runtime speed (and I don't feel confortable at Cython environment at all).

Re: From Python to Dlang

2016-10-18 Thread Alfred Newman via Digitalmars-d-learn
@All, thanks a lot !

Re: From Python to Dlang

2016-10-18 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 12:03:54 UTC, Alfred Newman wrote: Hello and greetings, I'm a brand new D developer coming from Python. So, can you pls guys suggest me any resource like "D for a Python Developer" or so ? BTW, I just ordered the "D Programming Language" book from AA. Cheers

From Python to Dlang

2016-10-18 Thread Alfred Newman via Digitalmars-d-learn
Hello and greetings, I'm a brand new D developer coming from Python. I decided to move to D, mainly because it's a compiled language and has a great runtime speed (and I don't feel confortable at Cython environment at all). And of course, D has a nice community and the language has nice

Re: inferred size for static array initialization

2016-10-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/18/16 6:35 AM, Nordlöw wrote: On Monday, 2 May 2016 at 17:43:56 UTC, Namespace wrote: immutable auto a = [1,2,3].s; Will that have zero run-time overhead compared to: immutable int[3] a = [1,2,3]; Neither will have zero runtime overhead, but use the disassembler to see if there

Re: inferred size for static array initialization

2016-10-18 Thread Namespace via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 10:35:44 UTC, Nordlöw wrote: On Monday, 2 May 2016 at 17:43:56 UTC, Namespace wrote: immutable auto a = [1,2,3].s; Will that have zero run-time overhead compared to: immutable int[3] a = [1,2,3]; ? I'm not quite sure if pragma(inline, true) would result

Re: weighted round robin

2016-10-18 Thread vino via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 13:44:59 UTC, Erikvv wrote: On Tuesday, 11 October 2016 at 06:28:10 UTC, vino wrote: On Monday, 10 October 2016 at 09:18:16 UTC, Marc Schütz wrote: [...] Hi Marc, Thank you, I have made a small update as the Server Array is fixed length and the Socket

Re: Visual Studio Linker Problem

2016-10-18 Thread Jason C. Wells via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 18:09:11 UTC, Johan Engelen wrote: So this was a VS installation issue? (Visual Studio set the LIB path wrong?) I'm not sure where LIB was set.

Re: Visual Studio Linker Problem

2016-10-18 Thread Jason C. Wells via Digitalmars-d-learn
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat did in fact exist. My search for the file must have been errant. ldc2.exe hello.d also failed in cmd.exe. I took Mike's advice to run cmd.exe from one of the environments provided in the VS start menu. I tried to compile

Re: Visual Studio Linker Problem

2016-10-18 Thread Johan Engelen via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 17:29:34 UTC, Jason C. Wells wrote: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat did in fact exist. My search for the file must have been errant. ldc2.exe hello.d also failed in cmd.exe. I took Mike's advice to run cmd.exe from one of

Re: Render SVG To Display And Update Periodically

2016-10-18 Thread Karabuta via Digitalmars-d-learn
On Monday, 17 October 2016 at 07:18:40 UTC, ketmar wrote: On Monday, 17 October 2016 at 07:05:24 UTC, ketmar wrote: On Monday, 17 October 2016 at 02:07:47 UTC, rikki cattermole wrote: [...] 'cmon, you know that i have a working port of NanoSVG! and it works on top of NanoVG, so no toolkit

Re: Programming in D by Ali Çehreli

2016-10-18 Thread vino via Digitalmars-d-learn
On Monday, 17 October 2016 at 18:20:00 UTC, cym13 wrote: On Monday, 17 October 2016 at 18:10:01 UTC, vino wrote: Hi All, As per the book named in the subject it states as below,so can some one guide me what is wrong in the below code nor correct if my understanding is wrong. Page 154

Re: Programming in D by Ali Çehreli

2016-10-18 Thread vino via Digitalmars-d-learn
On Monday, 17 October 2016 at 18:17:24 UTC, Ali Çehreli wrote: On 10/17/2016 11:10 AM, vino wrote: [...] What version is your compiler? My version is DMD64 D Compiler v2.072.0-b2. Trying the code with a recent compiler produces three compilation errors for the following three lines

Re: Programming in D by Ali Çehreli

2016-10-18 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2016 11:48 PM, vino wrote: On Monday, 17 October 2016 at 18:20:00 UTC, cym13 wrote: On Monday, 17 October 2016 at 18:10:01 UTC, vino wrote: Hi All, As per the book named in the subject it states as below,so can some one guide me what is wrong in the below code nor correct if my

Re: Visual Studio Linker Problem

2016-10-18 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 05:23:15 UTC, Jason C. Wells wrote: $ ldc2 hello.d Using Visual C++: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC I see mention of a "vcvarsall.bat" file that might set my paths correctly, but this file is not found on my system. Are you sure? The

Re: Visual Studio Linker Problem

2016-10-18 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 05:23:15 UTC, Jason C. Wells wrote: The file "libucrt.lib" is found in several VS folders. I am sure that this is some path issue, but I'm not savvy on VisualStudio. I read some scary messages about this error in other parts of the forum from about a year ago.

TIL: auto struct members

2016-10-18 Thread Ali Çehreli via Digitalmars-d-learn
It may be embarrassing to discover this fact so late but you can define struct members as 'auto': import std.range; import std.algorithm; struct S { auto r = only("a", "b").cycle;// <-- WOW! } pragma(msg, typeof(S.r)); /* Prints: * Cycle!(OnlyResult!(string, 2LU)) */ // It's