Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 03:10:46 UTC, Nicholas Wilson wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the pa

Re: [Request] A way to extract all instance of X from a range

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 04:05:11 UTC, Meta wrote: I believe this should work with the latest DMD: alias castRange(T) = t => t.map!(x => cast(T) x).filter!(x => x !is null); No it does not. However this works : auto typeFilter(T, Range)(Range range) { import std.

Re: D vs Rust

2016-03-15 Thread Saša Janiška via Digitalmars-d
bearophile writes: Hello bearophile, and thank you very much for your insightful reply! > But for an average multi-platform desktop application Ada is not a > good idea. The main problem is not the language itself (that is very > verbose, but that's not a show-stopper), but the tooling (very s

Re: the most D-ish GUI library

2016-03-15 Thread Saša Janiška via Digitalmars-d
Jordi Sayol via Digitalmars-d writes: > TkD works on Linux. Have you used it and/or what would be some prp/cons vs GtkD? Sincerely, Gour -- One who is able to withdraw his senses from sense objects, as the tortoise draws its limbs within the shell, is firmly fixed in perfect consciousness.

Re: Walter, I need a __trait please.

2016-03-15 Thread Jaocb Carlborg via Digitalmars-d
On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lam

Re: Walter, I need a __trait please.

2016-03-15 Thread Jaocb Carlborg via Digitalmars-d
On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the parmeters of a lambda as AliasSequence. e.g foreach (p;__traits(lam

Re: the most D-ish GUI library

2016-03-15 Thread Jaocb Carlborg via Digitalmars-d
On Monday, 14 March 2016 at 20:26:51 UTC, Saša Janiška wrote: Well, OS X and Windows are 'nice to have'. DWT already works on Windows where it uses native drawing operations. So, DWT works on Mac OS, but it's not native as GtkD and you do not have intention to work on OS X port, right? N

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Nordlöw via Digitalmars-d
On Monday, 14 March 2016 at 18:51:45 UTC, Chris Wright wrote: Ohm my, that's awesome. Watt needs to happen to get this into Phobos? I'm cleaning up David's work right and will put up a PR today.

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Nordlöw via Digitalmars-d
On Monday, 14 March 2016 at 19:08:18 UTC, Robert burner Schadek wrote: have a look at this! https://github.com/biozic/quantities Could you briefly outline why you prefer this over David's work?

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Nordlöw via Digitalmars-d
On Monday, 14 March 2016 at 09:04:28 UTC, Nordlöw wrote: http://klickverbot.at/code/units/std_units.html http://klickverbot.at/code/units/std_units.html#PrefixSystem No module name in Phobos is currently in plural form. I suggest we stick to that standard a name these std.experimental.unit s

Re: the most D-ish GUI library

2016-03-15 Thread Luis via Digitalmars-d
On Tuesday, 15 March 2016 at 07:50:48 UTC, Saša Janiška wrote: Jordi Sayol via Digitalmars-d writes: TkD works on Linux. Have you used it and/or what would be some prp/cons vs GtkD? Sincerely, Gour I only tested the examples when I was searching an alternative to GtkD when I got troubl

Re: the most D-ish GUI library

2016-03-15 Thread Luis via Digitalmars-d
On Tuesday, 15 March 2016 at 08:37:13 UTC, Jaocb Carlborg wrote: On Monday, 14 March 2016 at 20:26:51 UTC, Saša Janiška wrote: Well, OS X and Windows are 'nice to have'. DWT already works on Windows where it uses native drawing operations. So, DWT works on Mac OS, but it's not native as Gt

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
On Tuesday, 15 March 2016 at 08:02:34 UTC, Jaocb Carlborg wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: [...] To get the parameters as as strings, I think this [1] will allow you to that. To get the body as a string, that sounds almost as AST macros :) [1] https://gi

Re: Walter, I need a __trait please.

2016-03-15 Thread Stefan Koch via Digitalmars-d
foreach (p;__traits(lambda, (x,y) => x < y)) { writeln(p); } would output x y x < y If something like that would be merged I can implement this now I guess. thanks for the PR link Jacob

Re: the most D-ish GUI library

2016-03-15 Thread Saša Janiška via Digitalmars-d
Jaocb Carlborg writes: > No, DWT does _not_ work on OS X, neither native nor non-native. I'm > working on the OS X port indirectly. The automated process should work > for all ports. OK, the main thing for now it would be that it works on Linux...but I have some problems - see DWT group. > Anot

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Marc Schütz via Digitalmars-d
On Tuesday, 15 March 2016 at 09:13:10 UTC, Nordlöw wrote: On Monday, 14 March 2016 at 09:04:28 UTC, Nordlöw wrote: http://klickverbot.at/code/units/std_units.html http://klickverbot.at/code/units/std_units.html#PrefixSystem No module name in Phobos is currently in plural form. std.traits st

Re: the most D-ish GUI library

2016-03-15 Thread Saša Janiška via Digitalmars-d
thedeemon writes: > It is quite "D-ish", using the power of D metaprogramming and D syntax > quite effectively in some places. That's nice. > One big 'pro' of dlangui for me is that you can get a self-contained > 1-2 MB binary without dependencies on any DLLs. Small to download, > easy to run,

write to file array by lines

2016-03-15 Thread Suliman via Digitalmars-d
I have got: string [] total_content; I am appending to it data on every iteration. total_content ~= somedata File file = File(`D:\code\2vlad\result.txt`, "a+"); file.write(total_content); I need to write it's to file by lines. Like: somedataline1 somedataline2 somedataline3 I tried to do like

dlang.org makefile pains

2016-03-15 Thread Jakob Ovrum via Digitalmars-d
I used to contribute to dlang.org now and then before the makefile revamp. Now every time I try, I end up fighting with the makefile. make -f posix.mak apidocs-serve LATEST=2.070.2 <-- place in the command line to skip network traffic *starts downloading crap from downloads.dlang.org that I

Re: [Request] A way to extract all instance of X from a range

2016-03-15 Thread Meta via Digitalmars-d
On Tuesday, 15 March 2016 at 07:42:58 UTC, Stefan Koch wrote: On Tuesday, 15 March 2016 at 04:05:11 UTC, Meta wrote: I believe this should work with the latest DMD: alias castRange(T) = t => t.map!(x => cast(T) x).filter!(x => x !is null); No it does not. However this works : auto

Re: write to file array by lines

2016-03-15 Thread Anonymouse via Digitalmars-d
On Tuesday, 15 March 2016 at 10:58:16 UTC, Suliman wrote: I have got: string [] total_content; I am appending to it data on every iteration. total_content ~= somedata File file = File(`D:\code\2vlad\result.txt`, "a+"); file.write(total_content); I need to write it's to file by lines. Like: so

Re: Walter, I need a __trait please.

2016-03-15 Thread ZombineDev via Digitalmars-d
On Tuesday, 15 March 2016 at 08:02:34 UTC, Jaocb Carlborg wrote: On Tuesday, 15 March 2016 at 00:29:17 UTC, Stefan Koch wrote: Hi, I found myself in need of __trait that might be useful to include. something that would give me the parameters of a the body of the lambda as string and the par

Dpaste modifies applocation output ?

2016-03-15 Thread Temtaime via Digitalmars-d
Hi! http://dpaste.dzfl.pl/93d518c713b5 On dpaste it's ["a\n\nb"] But should be ["a\r\n\rb"] I've tested with dmd on win, linux and mac : all is ok, and only dpaste returns incorrect result. Why so? I'd wrote them using contact form but seems no reply.

Re: write to file array by lines

2016-03-15 Thread wobbles via Digitalmars-d
On Tuesday, 15 March 2016 at 10:58:16 UTC, Suliman wrote: I have got: string [] total_content; I am appending to it data on every iteration. total_content ~= somedata File file = File(`D:\code\2vlad\result.txt`, "a+"); file.write(total_content); I need to write it's to file by lines. Like: so

Re: D could catch this wave: web assembly

2016-03-15 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 14 March 2016 at 16:14:55 UTC, CraigDillabaugh wrote: On Monday, 14 March 2016 at 15:53:39 UTC, Joakim wrote: I can chip in general input on porting, based on my Android experience. Thanks. Dan or Ola ... are either of you interested in mentoring something like this? I haven't s

Re: the most D-ish GUI library

2016-03-15 Thread thedeemon via Digitalmars-d
On Tuesday, 15 March 2016 at 10:31:40 UTC, Saša Janiška wrote: Another one is DML, an analog of QML: http://stuff.thedeemon.com/lj/dml.png is there some GUI build for DML? In the examples coming with DLangUI there is an app where on the left you enter some DML text and on the right you see

Re: Dpaste modifies applocation output ?

2016-03-15 Thread ag0aep6g via Digitalmars-d
On 15.03.2016 12:48, Temtaime wrote: Hi! http://dpaste.dzfl.pl/93d518c713b5 On dpaste it's ["a\n\nb"] But should be ["a\r\n\rb"] I've tested with dmd on win, linux and mac : all is ok, and only dpaste returns incorrect result. Why so? I'd wrote them using contact form but seems no reply. Lo

Re: write to file array by lines

2016-03-15 Thread Suliman via Digitalmars-d
I created better example to show. string [] myarr = ["foo", "bar", "baz"]; myarr ~= "new"; File file = File(`result.txt`, "w"); file.write(myarr); is any way to write myarr to file in byLine mode

Re: D could catch this wave: web assembly

2016-03-15 Thread CraigDillabaugh via Digitalmars-d
On Tuesday, 15 March 2016 at 11:56:40 UTC, Ola Fosheim Grøstad wrote: On Monday, 14 March 2016 at 16:14:55 UTC, CraigDillabaugh wrote: On Monday, 14 March 2016 at 15:53:39 UTC, Joakim wrote: I can chip in general input on porting, based on my Android experience. Thanks. Dan or Ola ... are ei

Re: write to file array by lines

2016-03-15 Thread wobbles via Digitalmars-d
On Tuesday, 15 March 2016 at 12:55:17 UTC, Suliman wrote: I created better example to show. string [] myarr = ["foo", "bar", "baz"]; myarr ~= "new"; File file = File(`result.txt`, "w"); file.write(myarr); is any way to write myarr to file in byLine mode myarr .each!(line => file.writeln(li

Re: write to file array by lines

2016-03-15 Thread wobbles via Digitalmars-d
On Tuesday, 15 March 2016 at 12:55:17 UTC, Suliman wrote: I created better example to show. string [] myarr = ["foo", "bar", "baz"]; myarr ~= "new"; File file = File(`result.txt`, "w"); file.write(myarr); is any way to write myarr to file in byLine mode void main(){ import std.stdio;

Re: write to file array by lines

2016-03-15 Thread John Colvin via Digitalmars-d
On Tuesday, 15 March 2016 at 10:58:16 UTC, Suliman wrote: I have got: string [] total_content; I am appending to it data on every iteration. total_content ~= somedata File file = File(`D:\code\2vlad\result.txt`, "a+"); file.write(total_content); I need to write it's to file by lines. Like: so

Re: Dpaste modifies applocation output ?

2016-03-15 Thread John Colvin via Digitalmars-d
On Tuesday, 15 March 2016 at 11:48:48 UTC, Temtaime wrote: Hi! http://dpaste.dzfl.pl/93d518c713b5 On dpaste it's ["a\n\nb"] But should be ["a\r\n\rb"] I've tested with dmd on win, linux and mac : all is ok, and only dpaste returns incorrect result. Why so? I'd wrote them using contact form

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread D.Enguiyen via Digitalmars-d
On Tuesday, 15 March 2016 at 09:13:10 UTC, Nordlöw wrote: On Monday, 14 March 2016 at 09:04:28 UTC, Nordlöw wrote: http://klickverbot.at/code/units/std_units.html http://klickverbot.at/code/units/std_units.html#PrefixSystem No module name in Phobos is currently in plural form. I suggest we st

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread D.Enguiyen via Digitalmars-d
On Tuesday, 15 March 2016 at 14:50:42 UTC, D.Enguiyen wrote: On Tuesday, 15 March 2016 at 14:46:30 UTC, D.Enguiyen wrote: Is it able to manage quantities with a non-linear transformations, for example when dealing with octet and byte ? (1024)!"byte" == 1!"kbyte"; 1!"byte" * 1024 == 1!"kbyte"

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread D.Enguiyen via Digitalmars-d
On Tuesday, 15 March 2016 at 14:46:30 UTC, D.Enguiyen wrote: Is it able to manage quantities with a non-linear transformations, for example when dealing with octet and byte ? (1024)!"byte" == 1!"kbyte"; 1!"byte" * 1024 == 1!"kbyte";

Re: D could catch this wave: web assembly

2016-03-15 Thread Dan Olson via Digitalmars-d
CraigDillabaugh writes: > On Monday, 14 March 2016 at 15:53:39 UTC, Joakim wrote: >> On Monday, 14 March 2016 at 15:14:17 UTC, CraigDillabaugh wrote: >> >> I'm not qualified to mentor a WebAssembly port, as I'm not versed on >> compilers or IR. Dan would probably be best, as he got a lot of the

Re: D could catch this wave: web assembly

2016-03-15 Thread Joakim via Digitalmars-d
On Tuesday, 15 March 2016 at 13:01:31 UTC, CraigDillabaugh wrote: On Tuesday, 15 March 2016 at 11:56:40 UTC, Ola Fosheim Grøstad wrote: On Monday, 14 March 2016 at 16:14:55 UTC, CraigDillabaugh wrote: On Monday, 14 March 2016 at 15:53:39 UTC, Joakim wrote: I can chip in general input on porting

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Andrei Alexandrescu via Digitalmars-d
On 3/15/16 3:31 AM, Marc Schütz wrote: For some other modules, Andrei has insisted that package.d must publicly import all subpackages Not too strongly, I think std.allocator doesn't do that. But the judgment must be thoroughly sound and explained. For the putative package, importing packagen

Re: dlang.org makefile pains

2016-03-15 Thread Seb via Digitalmars-d
On Tuesday, 15 March 2016 at 11:15:12 UTC, Jakob Ovrum wrote: I used to contribute to dlang.org now and then before the makefile revamp. Now every time I try, I end up fighting with the makefile. make -f posix.mak apidocs-serve LATEST=2.070.2 <-- place in the command line to skip network tra

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread Robert burner Schadek via Digitalmars-d
On Tuesday, 15 March 2016 at 09:08:11 UTC, Nordlöw wrote: On Monday, 14 March 2016 at 19:08:18 UTC, Robert burner Schadek wrote: have a look at this! https://github.com/biozic/quantities Could you briefly outline why you prefer this over David's work? - has been in code.dlang.org since 2014

Re: Walter, I need a __trait please.

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any potential macro system, for a fraction of the complexity.

Re: Walter, I need a __trait please.

2016-03-15 Thread Jacob Carlborg via Digitalmars-d
On 15/03/16 12:47, ZombineDev wrote: Hi Jacob, I've been thinking quite a bit about the next step in the evolution of D's metaprogramming, and I thought that AST macros are the best way forward, however since then I become convinced that macros are a distraction from a much more powerful langua

Re: the most D-ish GUI library

2016-03-15 Thread Jacob Carlborg via Digitalmars-d
On 15/03/16 10:35, Luis wrote: Suddenly I have interest on DWT. I thought that was a simple copy of SWT, not being native... DWT is the Java code from SWT ported to D. It's native both as in native machine code and using native drawing operations. -- /Jacob Carlborg

Re: the most D-ish GUI library

2016-03-15 Thread Jacob Carlborg via Digitalmars-d
On 15/03/16 11:23, Saša Janiška wrote: That sounds very nice - something like wxWidgets, although I admit my experience with Java/SWT is zero. :-( There's a lot of documentation online for SWT. Most of the examples can be applied to DWT as well with none to minimal code changes. Some of the

Re: D could catch this wave: web assembly

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 16:12:46 UTC, Joakim wrote: Maybe deadalnix would be interested in mentoring, I think he showed some interest earlier. Or worst case, 3-4 of us could tag team, if that's allowed. I can. I know LLVM fairly well (I'm not a committer), but I do not have that much ex

Re: D could catch this wave: web assembly

2016-03-15 Thread Joakim via Digitalmars-d
On Tuesday, 15 March 2016 at 20:18:40 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 16:12:46 UTC, Joakim wrote: Maybe deadalnix would be interested in mentoring, I think he showed some interest earlier. Or worst case, 3-4 of us could tag team, if that's allowed. I can. I know LLVM fairl

Re: D could catch this wave: web assembly

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 20:18:40 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 16:12:46 UTC, Joakim wrote: Maybe deadalnix would be interested in mentoring, I think he showed some interest earlier. Or worst case, 3-4 of us could tag team, if that's allowed. I can. I know LLVM fairl

Re: the most D-ish GUI library

2016-03-15 Thread Karabuta via Digitalmars-d
On Sunday, 13 March 2016 at 22:26:48 UTC, Saša Janiška wrote: Hello, After long pause and trying some other languages, I've decided to try (again) with D for writing open-source multi-platform desktop (GUI) application. I've selected three different libraries: a) dlangui (https://github.com

Re: Walter, I need a __trait please.

2016-03-15 Thread deadalnix via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any

Re: D could catch this wave: web assembly

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 20:18:40 UTC, deadalnix wrote: I can. I know LLVM fairly well (I'm not a committer), but I do not have that much experience with WebAssembly. Yes, please! I'd volunteer myself, but this summer will be too busy for me academically. — David

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Monday, 14 March 2016 at 19:08:18 UTC, Robert burner Schadek wrote: have a look at this! https://github.com/biozic/quantities This has been brought up (and subsequently discussed) on the first page of this thread, more than two years ago. — David

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 14:46:30 UTC, D.Enguiyen wrote: Is it able to manage quantities with a non-linear transformations, for example when dealing with octet and byte ? (1024)!"byte" == 1!"kbyte"; There are no non-linear transformations going on here, following usual math terminology.

Re: Walter, I need a __trait please.

2016-03-15 Thread ZombineDev via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: On Tuesday, 15 March 2016 at 11:47:20 UTC, ZombineDev wrote: Instead I think that if we improve D's existing introspection capabilities and expose the compiler as a library at compile-time, we will have a much powerful system than any

Re: RFC: Units of measurement for D (Phobos?)

2016-03-15 Thread David Nadlinger via Digitalmars-d
On Tuesday, 15 March 2016 at 09:07:05 UTC, Nordlöw wrote: On Monday, 14 March 2016 at 18:51:45 UTC, Chris Wright wrote: Ohm my, that's awesome. Watt needs to happen to get this into Phobos? I'm cleaning up David's work right and will put up a PR today. Please make a really, really thorough p

Re: Walter, I need a __trait please.

2016-03-15 Thread cy via Digitalmars-d
On Tuesday, 15 March 2016 at 19:59:01 UTC, deadalnix wrote: It is like one of these simili good idea that everybody tries and everybody regrets it. You DON'T want to expose your compiler implementation to the language. I'm sorry, but I know a lot of people who don't expose their compiler impl