Re: array to string functional?

2018-09-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, September 14, 2018 11:39:48 PM MDT berni via Digitalmars-d-learn wrote: > On Saturday, 15 September 2018 at 03:25:38 UTC, Paul Backus wrote: > > On Friday, 14 September 2018 at 20:43:45 UTC, SrMordred wrote: > >> What you want is std.range.chunks > >> > >> > >> auto a =

Re: array to string functional?

2018-09-14 Thread berni via Digitalmars-d-learn
On Saturday, 15 September 2018 at 03:25:38 UTC, Paul Backus wrote: On Friday, 14 September 2018 at 20:43:45 UTC, SrMordred wrote: What you want is std.range.chunks auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0]; a.map!(to!string) .join("") .chunks(4) .map!(to!string) //don´t know why

Re: array to string functional?

2018-09-14 Thread Paul Backus via Digitalmars-d-learn
On Friday, 14 September 2018 at 20:43:45 UTC, SrMordred wrote: What you want is std.range.chunks auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0]; a.map!(to!string) .join("") .chunks(4) .map!(to!string) //don´t know why the chunks are not already strings at this point ;/

Re: dealing with very long paths and names

2018-09-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, September 14, 2018 2:52:42 PM MDT H. S. Teoh via Digitalmars-d- learn wrote: > On Fri, Sep 14, 2018 at 07:05:35PM +, Basile B. via Digitalmars-d- learn wrote: > > On Friday, 14 September 2018 at 17:59:38 UTC, Josphe Brigmo wrote: > > > Seems to break dirEntries when trying to deal

Re: dealing with very long paths and names

2018-09-14 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Sep 14, 2018 at 07:05:35PM +, Basile B. via Digitalmars-d-learn wrote: > On Friday, 14 September 2018 at 17:59:38 UTC, Josphe Brigmo wrote: > > Seems to break dirEntries when trying to deal with long pathnames(> > > 512) on windows. > > > > It's a strange error because it just fails

Re: array to string functional?

2018-09-14 Thread SrMordred via Digitalmars-d-learn
On Friday, 14 September 2018 at 19:44:37 UTC, berni wrote: a) I've got an int[] which contains only 0 und 1. And I want to end with a string, containing 0 and 1. So [1,1,0,1,0,1] should become "110101". Of course I can do this with a loop and ~. But I think it should be doable with functional

array to string functional?

2018-09-14 Thread berni via Digitalmars-d-learn
a) I've got an int[] which contains only 0 und 1. And I want to end with a string, containing 0 and 1. So [1,1,0,1,0,1] should become "110101". Of course I can do this with a loop and ~. But I think it should be doable with functional style, which is something I would like to understand

Re: dealing with very long paths and names

2018-09-14 Thread Basile B. via Digitalmars-d-learn
On Friday, 14 September 2018 at 17:59:38 UTC, Josphe Brigmo wrote: Seems to break dirEntries when trying to deal with long pathnames(> 512) on windows. It's a strange error because it just fails with access denied or missing file. The bug is known, see

dealing with very long paths and names

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
Seems to break dirEntries when trying to deal with long pathnames(> 512) on windows. It's a strange error because it just fails with access denied or missing file.

Re: DMD32 compiling gtkd out of memory on 32bit Windows 7 machine

2018-09-14 Thread Mike Wey via Digitalmars-d-learn
On 9/14/18 4:02 AM, dangbinghoo wrote: thanks timoses , singleFile mode works for building, but when linking, I got this: -- OPTLINK (R) for Win32  Release 8.00.17 Copyright (C) Digital Mars 1989-2013  All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK :

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 15:21:21 UTC, H. S. Teoh wrote: On Fri, Sep 14, 2018 at 02:36:34PM +, Josphe Brigmo via Digitalmars-d-learn wrote: [...] It happens on a bunch. I do get errors or overlong file names but this doesn't seem to be the case. The fact is, that simply using

Re: remove file access denied(remove broke)

2018-09-14 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Sep 14, 2018 at 02:36:34PM +, Josphe Brigmo via Digitalmars-d-learn wrote: [...] > It happens on a bunch. I do get errors or overlong file names but this > doesn't seem to be the case. > > The fact is, that simply using execute shell using the same file name > works. So this is a D

Re: dub doesn't work with dmd 1:2.082.0-1.0?

2018-09-14 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 14 September 2018 at 05:41:41 UTC, rmc wrote: I do wonder if `dmd` by itself on the command line works. Could it be some sort of 32 bit bug in the latest release of dmd? Relating to argc/argv. "source/dub/compilers/compiler.d(127)" That doesn't look like DMD source code.

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 13:28:41 UTC, Adam D. Ruppe wrote: On Friday, 14 September 2018 at 08:32:48 UTC, Josphe Brigmo wrote: Seems remove is broke. The source code for remove is DeleteFile(name), so not much room for bugs there, except maybe string conversion. What is the filename

Re: remove file access denied(remove broke)

2018-09-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 14 September 2018 at 08:32:48 UTC, Josphe Brigmo wrote: Seems remove is broke. The source code for remove is DeleteFile(name), so not much room for bugs there, except maybe string conversion. What is the filename you are working on?

Re: remove file access denied(remove broke)

2018-09-14 Thread Alex via Digitalmars-d-learn
On Friday, 14 September 2018 at 08:32:48 UTC, Josphe Brigmo wrote: No, I use read, there is no file handles. Pointless to post code because it won't offer much. Also, I have security privileges. I simply read the file to compare it's contents then I try to remove the file if it had the same

Re: remove file access denied(remove broke)

2018-09-14 Thread bauss via Digitalmars-d-learn
On Friday, 14 September 2018 at 08:32:48 UTC, Josphe Brigmo wrote: On Friday, 14 September 2018 at 04:48:09 UTC, Norm wrote: On Thursday, 13 September 2018 at 23:25:24 UTC, Josphe Brigmo wrote: I am trying to remove a file remove(filename); and I get an access denied! I can remove it from

Re: Error: incompatible types for 'shared(SysTime)' and 'shared(SysTime)'

2018-09-14 Thread Arafel via Digitalmars-d-learn
On 09/13/2018 06:59 PM, ag0aep6g wrote: On 09/13/2018 03:25 PM, Arafel wrote: // How can we update the timestamp? Neither of those work timestamp = Clock.currTime; timestamp = cast(shared) Clock.currTime; cast() timestamp = Clock.currTime; Still not there... it

Re: Error: incompatible types for 'shared(SysTime)' and 'shared(SysTime)'

2018-09-14 Thread Arafel via Digitalmars-d-learn
(*(cast (SysTime*) ())).foo; Not exactly obvious or user-friendly...

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 04:48:09 UTC, Norm wrote: On Thursday, 13 September 2018 at 23:25:24 UTC, Josphe Brigmo wrote: I am trying to remove a file remove(filename); and I get an access denied! I can remove it from explorer just fine. I am able to remove other files but there should