Re: Anonymous nogc class

2017-09-07 Thread Biotronic via Digitalmars-d-learn
On Thursday, 7 September 2017 at 23:40:11 UTC, Jiyan wrote: Hey, wanted to know whether it is possible to make anonymous nogc classes: interface I { public void ap(); } void exec(I i) { i.ap; } // now execute, but with something like `scope` exec( new class I { int t

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 20:47:43 UTC, Ali Çehreli wrote: On 09/07/2017 10:39 AM, Vino.B wrote: > Array!(Tuple!(string, ulong)) coSizeDirList () { You stated the return type explicitly above. > return tuple (dFiles[], Subdata[]); According to the error message, what is bei

Re: D is Multiplatform[DUVIDA]

2017-09-07 Thread dark777 via Digitalmars-d-learn
On Friday, 8 September 2017 at 03:56:25 UTC, rikki cattermole wrote: On 08/09/2017 3:08 AM, dark777 wrote: On Friday, 8 September 2017 at 00:09:08 UTC, solidstate1991 wrote: On Thursday, 7 September 2017 at 23:58:05 UTC, dark777 wrote: Good night, did you want to know this? Is the DE language

Re: D is Multiplatform[DUVIDA]

2017-09-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/09/2017 3:08 AM, dark777 wrote: On Friday, 8 September 2017 at 00:09:08 UTC, solidstate1991 wrote: On Thursday, 7 September 2017 at 23:58:05 UTC, dark777 wrote: Good night, did you want to know this? Is the DE language cross-platform or cross-compile like C ++? GDC and LDC has multi-pla

Re: D is Multiplatform[DUVIDA]

2017-09-07 Thread dark777 via Digitalmars-d-learn
On Friday, 8 September 2017 at 00:09:08 UTC, solidstate1991 wrote: On Thursday, 7 September 2017 at 23:58:05 UTC, dark777 wrote: Good night, did you want to know this? Is the DE language cross-platform or cross-compile like C ++? GDC and LDC has multi-platform support, I'm currently working o

Re: D is Multiplatform[DUVIDA]

2017-09-07 Thread solidstate1991 via Digitalmars-d-learn
On Thursday, 7 September 2017 at 23:58:05 UTC, dark777 wrote: Good night, did you want to know this? Is the DE language cross-platform or cross-compile like C ++? GDC and LDC has multi-platform support, I'm currently working on an ARM backend for DMD.

D is Multiplatform[DUVIDA]

2017-09-07 Thread dark777 via Digitalmars-d-learn
Good night, did you want to know this? Is the DE language cross-platform or cross-compile like C ++?

Re: Is compiling for Android/iOS possible?

2017-09-07 Thread bitwise via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 18:34:28 UTC, Timothy Foster wrote: I'm just wondering if I made an application for Windows/Mac/Linux if I could get it to also work on mobile devices, or would I have to rewrite the application in another language to get it to work? If it's possible, what shou

Anonymous nogc class

2017-09-07 Thread Jiyan via Digitalmars-d-learn
Hey, wanted to know whether it is possible to make anonymous nogc classes: interface I { public void ap(); } void exec(I i) { i.ap; } // now execute, but with something like `scope` exec( new class I { int tr = 43; override void ap(){tr.writeln;} }); Thanks :

Re: New programming paradigm

2017-09-07 Thread Biotronic via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:55:02 UTC, EntangledQuanta wrote: Sorry, I think you missed the point completely... or I didn't explain things very well. I don't think I did - your new explanation didn't change my understanding at least. This indicates I'm the one who's bad at explaining.

Re: performance cost of sample conversion

2017-09-07 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 7 September 2017 at 05:45:58 UTC, Ali Çehreli wrote: You have to measure. Indeed. Here's a start: The program has way too many things pre-defined, and the semantics are such that workWithDoubles can be completely eliminated... So you are not measuring what you want to be me

Re: One path skips constructor - is this a bug?

2017-09-07 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:08:53 UTC, Piotr Mitana wrote: main.d(17): Error: one path skips constructor main.d(15): Error: return without calling constructor http://www.digitalmars.com/d/archives/digitalmars/D/learn/Throwing_exception_in_constructor_28995.html

Re: New programming paradigm

2017-09-07 Thread EntangledQuanta via Digitalmars-d-learn
On Thursday, 7 September 2017 at 19:33:01 UTC, apz28 wrote: On Thursday, 7 September 2017 at 17:13:43 UTC, EntangledQuanta wrote: On Thursday, 7 September 2017 at 15:36:47 UTC, Jesse Phillips wrote: [...] All types have a type ;) You specified in the above case that m is an int by setting it

Re: Container Array

2017-09-07 Thread Ali Çehreli via Digitalmars-d-learn
On 09/07/2017 10:39 AM, Vino.B wrote: > Array!(Tuple!(string, ulong)) coSizeDirList () { You stated the return type explicitly above. > return tuple (dFiles[], Subdata[]); According to the error message, what is being returned does not have the same type: > Test1.d(27): Error: c

Re: High-level wrapper for readline package

2017-09-07 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 7 September 2017 at 19:45:06 UTC, Adam D. Ruppe wrote: On Thursday, 7 September 2017 at 19:38:38 UTC, Nordlöw wrote: But I believe it's ok to relax it from `string` to `const(char)[]`, right? Yeah, it should be const(char)[] or even `in char[]` Ahh, correct.

Re: High-level wrapper for readline package

2017-09-07 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 7 September 2017 at 15:31:13 UTC, Nemanja Boric wrote: Minor point: you should add_history only if `lineStringz && lineStringz[0] != '\0'` Wonderful. That prevented a crashs when writing history. Thanks!

Re: High-level wrapper for readline package

2017-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 7 September 2017 at 19:38:38 UTC, Nordlöw wrote: But I believe it's ok to relax it from `string` to `const(char)[]`, right? Yeah, it should be const(char)[] or even `in char[]`

Re: High-level wrapper for readline package

2017-09-07 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:23:46 UTC, Adam D. Ruppe wrote: On Thursday, 7 September 2017 at 16:18:09 UTC, bauss wrote: Isn't it pointless to make "prompt" in? No, it promises the function isn't doing anything weird to it (modify, which immutable covers, but also scope.. .unless dmd

Re: New programming paradigm

2017-09-07 Thread apz28 via Digitalmars-d-learn
On Thursday, 7 September 2017 at 17:13:43 UTC, EntangledQuanta wrote: On Thursday, 7 September 2017 at 15:36:47 UTC, Jesse Phillips wrote: [...] All types have a type ;) You specified in the above case that m is an int by setting it to 4(I assume that is what var(4) means). But the downside,

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 17:12:14 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 15:07:56 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of t

Re: One path skips constructor - is this a bug?

2017-09-07 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:08:53 UTC, Piotr Mitana wrote: Code: === import std.conv; import std.regex; struct A This throws a compilation error: main.d(17): Error: one path skips constructor main.d(15): Error: return without calling constructor Why

Re: New programming paradigm

2017-09-07 Thread EntangledQuanta via Digitalmars-d-learn
On Thursday, 7 September 2017 at 15:36:47 UTC, Jesse Phillips wrote: On Monday, 4 September 2017 at 03:26:23 UTC, EntangledQuanta wrote: To get a feel for what this new way of dealing with dynamic types might look like: void foo(var y) { writeln(y); } var x = "3"; // or possibly var!(string,

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 15:07:56 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of the container: writeln(coCleanFiles[]); Ali Hi Ali, T

Re: New programming paradigm

2017-09-07 Thread EntangledQuanta via Digitalmars-d-learn
On Thursday, 7 September 2017 at 14:28:14 UTC, Biotronic wrote: On Wednesday, 6 September 2017 at 23:20:41 UTC, EntangledQuanta wrote: So, no body thinks this is a useful idea or is it that no one understands what I'm talking about? Frankly, you'd written a lot of fairly dense code, so unders

Re: SIMD under LDC

2017-09-07 Thread Igor via Digitalmars-d-learn
On Thursday, 7 September 2017 at 15:24:13 UTC, Johan Engelen wrote: On Wednesday, 6 September 2017 at 20:43:01 UTC, Igor wrote: I opened a feature request on github. I also tried using the gccbuiltins but I got this error: LLVM ERROR: Cannot select: 0x2199c96fd70: v16i8 = X86ISD::PSHUFB 0x2

Re: High-level wrapper for readline package

2017-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 7 September 2017 at 16:18:09 UTC, bauss wrote: Isn't it pointless to make "prompt" in? No, it promises the function isn't doing anything weird to it (modify, which immutable covers, but also scope.. .unless dmd changed that), which means a copy of the pointer won't be stored eit

Re: High-level wrapper for readline package

2017-09-07 Thread bauss via Digitalmars-d-learn
On Thursday, 7 September 2017 at 14:00:36 UTC, Nordlöw wrote: On Thursday, 7 September 2017 at 13:44:52 UTC, Adam D. Ruppe wrote: [...] There's always room for usability improvements when wrapping C APIs... [...] Isn't it pointless to make "prompt" in?

One path skips constructor - is this a bug?

2017-09-07 Thread Piotr Mitana via Digitalmars-d-learn
Code: === import std.conv; import std.regex; struct A { int field1; int field2; this(int field1, int field2) { if(field1 > field2) throw new Exception("This is illegal!"); }

Re: New programming paradigm

2017-09-07 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 4 September 2017 at 03:26:23 UTC, EntangledQuanta wrote: To get a feel for what this new way of dealing with dynamic types might look like: void foo(var y) { writeln(y); } var x = "3"; // or possibly var!(string, int) for the explicit types used foo(x); x = 3; foo(x); (just pseud

Re: High-level wrapper for readline package

2017-09-07 Thread Nemanja Boric via Digitalmars-d-learn
On Thursday, 7 September 2017 at 14:00:36 UTC, Nordlöw wrote: On Thursday, 7 September 2017 at 13:44:52 UTC, Adam D. Ruppe wrote: [...] There's always room for usability improvements when wrapping C APIs... [...] Minor point: you should add_history only if `lineStringz && lineStringz[0]

Re: SIMD under LDC

2017-09-07 Thread Johan Engelen via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 20:43:01 UTC, Igor wrote: I opened a feature request on github. I also tried using the gccbuiltins but I got this error: LLVM ERROR: Cannot select: 0x2199c96fd70: v16i8 = X86ISD::PSHUFB 0x2199c74e9a8, 0x2199c74d6c0 That's because SSSE3 instructions are not

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of the container: writeln(coCleanFiles[]); Ali Hi Ali, Thank you very much, was ablee to resolve this issue and now f

Re: Container Array

2017-09-07 Thread Ali Çehreli via Digitalmars-d-learn
On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of the container: writeln(coCleanFiles[]); Ali

Re: New programming paradigm

2017-09-07 Thread Biotronic via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 23:20:41 UTC, EntangledQuanta wrote: So, no body thinks this is a useful idea or is it that no one understands what I'm talking about? Frankly, you'd written a lot of fairly dense code, so understanding exactly what it was doing took a while. So I sat down an

Re: High-level wrapper for readline package

2017-09-07 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 7 September 2017 at 13:44:52 UTC, Adam D. Ruppe wrote: On Thursday, 7 September 2017 at 13:37:16 UTC, Nordlöw wrote: Have anybody cooked together high-level bindings on top of the C-bindings for libreadline here Have you ever used readline? The basic C api is already very high le

Re: High-level wrapper for readline package

2017-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 7 September 2017 at 13:37:16 UTC, Nordlöw wrote: Have anybody cooked together high-level bindings on top of the C-bindings for libreadline here Have you ever used readline? The basic C api is already very high level: char* from_user = readline("Prompt> "); I don't think there'

High-level wrapper for readline package

2017-09-07 Thread Nordlöw via Digitalmars-d-learn
Have anybody cooked together high-level bindings on top of the C-bindings for libreadline here http://code.dlang.org/packages/readline ?

Re: DLang IDE [RU]

2017-09-07 Thread TM via Digitalmars-d-learn
On Thursday, 7 September 2017 at 07:03:41 UTC, Vadim Lopatin wrote: On Wednesday, 6 September 2017 at 17:36:53 UTC, TM wrote: On Wednesday, 6 September 2017 at 14:33:18 UTC, Vadim Lopatin wrote: On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 16:41:06 UTC, Vino.B wrote: HI All, Can some one provide me a example of how to use the std.container.array for the below code. import std.algorithm: filter, map; import std.file: SpanMode, dirEntries, isDir; import std.stdio: writeln; import std.typecons: t

Re: New programming paradigm

2017-09-07 Thread XavierAP via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 23:20:41 UTC, EntangledQuanta wrote: So, no body thinks this is a useful idea or is it that no one understands what I'm talking about? I think it may be a good use, although I haven't invested so much time looking into your particular application. It looks l

Re: DLang IDE [RU]

2017-09-07 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 13:05:29 UTC, Vadim Lopatin wrote: On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 1. Добавить возможность выбора размера шрифта для области редактирования. Я крайне редко меняю подобные настройки в IDE, но в данном случае дефолтный шрифт оказался откро

Re: DLang IDE [RU]

2017-09-07 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 13:20:08 UTC, Vadim Lopatin wrote: On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 2. В области Workspace Explorer на одном уровне иерархии модули и пакеты сортируются по алфавиту, но "вперемешку" с друг другом, в отличие от того же Notepad++, где снача

Re: DLang IDE [RU]

2017-09-07 Thread Vadim Lopatin via Digitalmars-d-learn
On Thursday, 7 September 2017 at 07:04:11 UTC, Suliman wrote: А можно сделать как-то так, чтобы автокомплит работал сразу? Как в студии. То есть бы не приходилось ctrl+пробел нажимать. Issue submitted: https://github.com/buggins/dlangide/issues/253

Re: DLang IDE [RU]

2017-09-07 Thread Suliman via Digitalmars-d-learn
А можно сделать как-то так, чтобы автокомплит работал сразу? Как в студии. То есть бы не приходилось ctrl+пробел нажимать.

Re: DLang IDE [RU]

2017-09-07 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 17:36:53 UTC, TM wrote: On Wednesday, 6 September 2017 at 14:33:18 UTC, Vadim Lopatin wrote: On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04 UTC, Vadim Lopatin wrote: File / new для добавления пакетов/модуле