Re: the best language I have ever met(?)

2017-10-13 Thread Igor via Digitalmars-d-learn
On Friday, 25 November 2016 at 19:16:43 UTC, ketmar wrote: On Friday, 25 November 2016 at 14:27:39 UTC, Igor Shirkalin wrote: On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote: We can define static array without counting the elements as following: enum array_ = [1u,2,3,4];

Re: the best language I have ever met(?)

2017-10-10 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 25 November 2016 at 19:16:43 UTC, ketmar wrote: yeah. but i'm not Andrei, i don't believe that the only compiler task is to resolve templated code. ;-) i.e. Andrei believes that everything (and more) should be moved out of compiler core and done with library templates. Andrei is

Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Monday, 5 December 2016 at 17:27:21 UTC, Igor Shirkalin wrote: On Monday, 5 December 2016 at 16:39:33 UTC, eugene wrote: On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin wrote: I didnt count, but its about ten thousend a year, i.e. nothing. if you earned nothing using D language

Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Monday, 5 December 2016 at 16:39:33 UTC, eugene wrote: On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin wrote: I didnt count, but its about ten thousend a year, i.e. nothing. if you earned nothing using D language why do you recommend it?))) People usually earn money using

Re: the best language I have ever met(?)

2016-12-05 Thread eugene via Digitalmars-d-learn
On Monday, 5 December 2016 at 16:07:41 UTC, Igor Shirkalin wrote: I didnt count, but its about ten thousend a year, i.e. nothing. if you earned nothing using D language why do you recommend it?))) People usually earn money using programming langs.

Re: the best language I have ever met(?)

2016-12-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Saturday, 3 December 2016 at 15:02:35 UTC, eugene wrote: On Friday, 18 November 2016 at 17:54:52 UTC, Igor Shirkalin wrote: That was preface. Now I have server written in D for C++ pretty ancient client. Most things are three times shorter in size and clear (@clear? suffix). All

Re: the best language I have ever met(?)

2016-12-03 Thread eugene via Digitalmars-d-learn
On Friday, 18 November 2016 at 17:54:52 UTC, Igor Shirkalin wrote: That was preface. Now I have server written in D for C++ pretty ancient client. Most things are three times shorter in size and clear (@clear? suffix). All programming paradigms were used. I have the same text in russian, but

Re: the best language I have ever met(?)

2016-12-02 Thread Igor Shirkalin via Digitalmars-d-learn
On Monday, 28 November 2016 at 16:15:23 UTC, Jonathan M Davis wrote: That's what pragma(inline, true) is for. And if someone wants a different solution that's completely compile-time and doesn't work with variables, then fine. I'm talking about adding something to the standard library, and for

Re: the best language I have ever met(?)

2016-11-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 26, 2016 00:43:04 Artur Skawina via Digitalmars-d- learn wrote: > IOW you want to improve IFTI, so that `n` is inferred from the > length of the passed argument. That would indeed work for array > literals and CTFE-able expressions. Any improvement to IFTI is a > good thing,

Re: the best language I have ever met(?)

2016-11-25 Thread Artur Skawina via Digitalmars-d-learn
On 11/25/16 18:33, Jonathan M Davis via Digitalmars-d-learn wrote: > On Friday, November 25, 2016 18:20:11 Artur Skawina via Digitalmars-d-learn > wrote: >> On 11/25/16 17:30, Jonathan M Davis via Digitalmars-d-learn wrote: >>> On Friday, November 25, 2016 17:03:32 Artur Skawina via enum

Re: the best language I have ever met(?)

2016-11-25 Thread ketmar via Digitalmars-d-learn
On Friday, 25 November 2016 at 14:27:39 UTC, Igor Shirkalin wrote: On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote: We can define static array without counting the elements as following: enum array_ = [1u,2,3,4]; uint[array_.length] static_array = array_; there are

Re: the best language I have ever met(?)

2016-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 25, 2016 18:20:11 Artur Skawina via Digitalmars-d-learn wrote: > On 11/25/16 17:30, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Friday, November 25, 2016 17:03:32 Artur Skawina via > >>enum T[N] staticArray(T, alias ELS, size_t N=ELS.length) = ELS; > >>auto

Re: the best language I have ever met(?)

2016-11-25 Thread Artur Skawina via Digitalmars-d-learn
On 11/25/16 17:30, Jonathan M Davis via Digitalmars-d-learn wrote: > On Friday, November 25, 2016 17:03:32 Artur Skawina via Digitalmars-d-learn > wrote: >> On 11/25/16 15:51, Jonathan M Davis via Digitalmars-d-learn wrote: >>> On Friday, November 25, 2016 14:27:39 Igor Shirkalin via >>>

Re: the best language I have ever met(?)

2016-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 25, 2016 08:26:11 Jonathan M Davis via Digitalmars-d- learn wrote: > and opening an enhancement request to make the compiler smart enough that > > auto arr = staticArray!ubyte([1, 2, 3, 4]); > > would work. Opened: https://issues.dlang.org/show_bug.cgi?id=16779 And regardless

Re: the best language I have ever met(?)

2016-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 25, 2016 17:03:32 Artur Skawina via Digitalmars-d-learn wrote: > On 11/25/16 15:51, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Friday, November 25, 2016 14:27:39 Igor Shirkalin via > > Digitalmars-d-learn> > > wrote: > >> I think you may write it (I mean actual D)

Re: the best language I have ever met(?)

2016-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 25, 2016 15:59:48 Igor Shirkalin via Digitalmars-d-learn wrote: > On Friday, 25 November 2016 at 14:51:52 UTC, Jonathan M Davis > > auto arr = staticArray!ubyte([1, 2, 3, 4]); > > > > doesn't compile either. The most straightforward > > implementations are something like > >

Re: the best language I have ever met(?)

2016-11-25 Thread Artur Skawina via Digitalmars-d-learn
On 11/25/16 15:51, Jonathan M Davis via Digitalmars-d-learn wrote: > On Friday, November 25, 2016 14:27:39 Igor Shirkalin via Digitalmars-d-learn > wrote: >> I think you may write it (I mean actual D) with using some >> template like this: >> >> auto array = static_array!uint(1, 2, 3, 4) >> >>

Re: the best language I have ever met(?)

2016-11-25 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 25 November 2016 at 07:17:18 UTC, MGW wrote: On Wednesday, 23 November 2016 at 18:54:35 UTC, Igor Shirkalin wrote: Igor, is the good Russian-speaking forum https://vk.com/vk_dlang. There are articles on GUI and other aspects of dlang. Thank you, I'll tale a look at it for sure.

Re: the best language I have ever met(?)

2016-11-25 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 25 November 2016 at 14:51:52 UTC, Jonathan M Davis wrote: I think you may write it (I mean actual D) with using some template like this: auto array = static_array!uint(1, 2, 3, 4) Could you please help to write down this template in the best and clear manner? That's easy. The

Re: the best language I have ever met(?)

2016-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 25, 2016 14:27:39 Igor Shirkalin via Digitalmars-d-learn wrote: > On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote: > >> We can define static array without counting the elements as > >> following: > >> > >> > >> enum array_ = [1u,2,3,4]; > >> uint[array_.length]

Re: the best language I have ever met(?)

2016-11-25 Thread Igor Shirkalin via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote: We can define static array without counting the elements as following: enum array_ = [1u,2,3,4]; uint[array_.length] static_array = array_; there are workarounds, of course. yet i'll take mine `uint[$] a = [1u,2,3,4];` over that

Re: the best language I have ever met(?)

2016-11-24 Thread MGW via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 18:54:35 UTC, Igor Shirkalin wrote: Igor, is the good Russian-speaking forum https://vk.com/vk_dlang. There are articles on GUI and other aspects of dlang.

Re: the best language I have ever met(?)

2016-11-23 Thread Dsby via Digitalmars-d-learn
On Friday, 18 November 2016 at 17:54:52 UTC, Igor Shirkalin wrote: The simpler - the better. After reading "D p.l." by A.Alexandrescu two years ago I have found my past dream. It's theory to start with. That book should be read at least two times especially if you have

Re: the best language I have ever met(?)

2016-11-23 Thread ketmar via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 19:15:52 UTC, Jonathan M Davis wrote: It's nice, but it's non-standard. So, it seems to me that using it is just going to lead to problems like you ran into in this thread where you posted an example that wasn't valid D, and it'll make you that much more

Re: the best language I have ever met(?)

2016-11-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 23, 2016 18:58:55 ketmar via Digitalmars-d-learn wrote: > On Wednesday, 23 November 2016 at 18:54:35 UTC, Igor Shirkalin > > wrote: > > On Tuesday, 22 November 2016 at 00:08:05 UTC, ketmar wrote: > >> On Monday, 21 November 2016 at 23:49:27 UTC, burjui wrote: > >>> Though I

Re: the best language I have ever met(?)

2016-11-23 Thread ketmar via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 18:54:35 UTC, Igor Shirkalin wrote: On Tuesday, 22 November 2016 at 00:08:05 UTC, ketmar wrote: On Monday, 21 November 2016 at 23:49:27 UTC, burjui wrote: Though I would argue that it's better to use '_' instead of '$' to denote deduced fixed size, it seems

Re: the best language I have ever met(?)

2016-11-23 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 00:08:05 UTC, ketmar wrote: On Monday, 21 November 2016 at 23:49:27 UTC, burjui wrote: Though I would argue that it's better to use '_' instead of '$' to denote deduced fixed size, it seems more obvious to me: int[_] array = [ 1, 2, 3 ]; alas, `_` is valid

Re: the best language I have ever met(?)

2016-11-21 Thread Daniel Kozak via Digitalmars-d-learn
Dne 21.11.2016 v 13:44 Jonathan M Davis via Digitalmars-d-learn napsal(a): ... it's easy enough to just create a template to do the same thing, it's not worth adding to the language. That's a problem. I belive there is a lot of things which are easy to add by some kind of magic (template or

Re: the best language I have ever met(?)

2016-11-21 Thread ketmar via Digitalmars-d-learn
On Monday, 21 November 2016 at 12:44:47 UTC, Jonathan M Davis wrote: (it might have even had a PR which was rejected), and presumably, Ketmar added it to his own compiler, because he liked the feature. exactly. it is the old patch from Kenji. the patch even survived C++ -> D transition, 'cause

Re: the best language I have ever met(?)

2016-11-21 Thread ketmar via Digitalmars-d-learn
On Monday, 21 November 2016 at 23:49:27 UTC, burjui wrote: Though I would argue that it's better to use '_' instead of '$' to denote deduced fixed size, it seems more obvious to me: int[_] array = [ 1, 2, 3 ]; alas, `_` is valid identifier, so `enum _ = 42; int[_] a;` is perfectly valid.

Re: the best language I have ever met(?)

2016-11-21 Thread burjui via Digitalmars-d-learn
On Monday, 21 November 2016 at 12:44:47 UTC, Jonathan M Davis wrote: Someone could create a DIP for it though and argue for it. If they did that convincingly enough, maybe it would become a feature. I suspect that the response will be though that since it's easy enough to just create a

Re: the best language I have ever met(?)

2016-11-21 Thread ketmar via Digitalmars-d-learn
On Monday, 21 November 2016 at 12:42:34 UTC, ZombineDev wrote: That was a proposal for D that was rejected in the last moment by Andrei. My guess is that ketmar's modified dmd has that feature implemented. exactly. it is handy feature, so i used to it. and it slept into code (i usually test

Re: the best language I have ever met(?)

2016-11-21 Thread Namespace via Digitalmars-d-learn
On Monday, 21 November 2016 at 12:44:47 UTC, Jonathan M Davis wrote: On Monday, November 21, 2016 12:08:30 Patric Dexheimer via Digitalmars-d- learn wrote: No. D doesn't have that, though it's easy enough to do the same thing with a helper template. However, Ketmar seems to like to use his own

Re: the best language I have ever met(?)

2016-11-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, November 21, 2016 12:08:30 Patric Dexheimer via Digitalmars-d- learn wrote: > On Saturday, 19 November 2016 at 00:47:00 UTC, ketmar wrote: > > On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch > > > > wrote: > >> Please don't post non-d. > > > > it slipped accidentally, sorry.

Re: the best language I have ever met(?)

2016-11-21 Thread ZombineDev via Digitalmars-d-learn
On Monday, 21 November 2016 at 12:08:30 UTC, Patric Dexheimer wrote: On Saturday, 19 November 2016 at 00:47:00 UTC, ketmar wrote: On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch wrote: Please don't post non-d. it slipped accidentally, sorry. ;-) for OP: `uint[2] a = [42, 69];` is

Re: the best language I have ever met(?)

2016-11-21 Thread Patric Dexheimer via Digitalmars-d-learn
On Saturday, 19 November 2016 at 00:47:00 UTC, ketmar wrote: On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch wrote: Please don't post non-d. it slipped accidentally, sorry. ;-) for OP: `uint[2] a = [42, 69];` is the correct syntax. "uint[$] a = [42, 69];" haha for a moment I

Re: the best language I have ever met(?)

2016-11-19 Thread Igor Shirkalin via Digitalmars-d-learn
On Saturday, 19 November 2016 at 20:54:32 UTC, ketmar wrote: On Saturday, 19 November 2016 at 17:12:13 UTC, Igor Shirkalin wrote: string s = "%(%s, %)".format(a); writefln(s); } Accepted. Is it really needed to call 'writefln'? I mean 'f'. no. it's a leftover from the code without

Re: the best language I have ever met(?)

2016-11-19 Thread ketmar via Digitalmars-d-learn
On Saturday, 19 November 2016 at 17:12:13 UTC, Igor Shirkalin wrote: string s = "%(%s, %)".format(a); writefln(s); } Accepted. Is it really needed to call 'writefln'? I mean 'f'. no. it's a leftover from the code without format. it originally was `writefln("%(%s, %)", a);`, but i wanted

Re: the best language I have ever met(?)

2016-11-19 Thread Igor Shirkalin via Digitalmars-d-learn
On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch wrote: import std.stdio; import std.format; void main () { uint[$] a = [42, 69]; string s = "%(%s, %)".format(a); writefln(s); } Please don't post non-d. People might use it an then complain that it does not work. Let these

Re: the best language I have ever met(?)

2016-11-19 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 21:28:44 UTC, ketmar wrote: On Friday, 18 November 2016 at 20:31:57 UTC, Igor Shirkalin wrote: After 2 hours of brain breaking (as D newbie) I have come to: uint_array.map!(v=>"%x".format(v)).join(", ") Why 2 hours? Because I have started with 'joiner' function

Re: the best language I have ever met(?)

2016-11-18 Thread ketmar via Digitalmars-d-learn
On Saturday, 19 November 2016 at 00:28:36 UTC, Stefan Koch wrote: Please don't post non-d. it slipped accidentally, sorry. ;-) for OP: `uint[2] a = [42, 69];` is the correct syntax.

Re: the best language I have ever met(?)

2016-11-18 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 18 November 2016 at 21:28:44 UTC, ketmar wrote: On Friday, 18 November 2016 at 20:31:57 UTC, Igor Shirkalin wrote: After 2 hours of brain breaking (as D newbie) I have come to: uint_array.map!(v=>"%x".format(v)).join(", ") Why 2 hours? Because I have started with 'joiner' function

Re: the best language I have ever met(?)

2016-11-18 Thread ketmar via Digitalmars-d-learn
On Friday, 18 November 2016 at 20:31:57 UTC, Igor Shirkalin wrote: After 2 hours of brain breaking (as D newbie) I have come to: uint_array.map!(v=>"%x".format(v)).join(", ") Why 2 hours? Because I have started with 'joiner' function and aftewords found out the 'join'. To my mind there is

Re: the best language I have ever met(?)

2016-11-18 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 19:47:17 UTC, H. S. Teoh wrote: On Fri, Nov 18, 2016 at 11:43:49AM -0800, H. S. Teoh via Digitalmars-d-learn wrote: [...] Yes, I meant 'sentiments' as in опыта, not as in сентметальность. :-) [...] Sorry, typo. I meant сентиментальности. But I think you

Re: the best language I have ever met(?)

2016-11-18 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 19:47:17 UTC, H. S. Teoh wrote: Yes, I meant 'sentiments' as in опыта, not as in сентметальность. :-) [...] Sorry, typo. I meant сентиментальности. But I think you understand what I mean. :-) Oh, I think you understand what you think what I mean :)

Re: the best language I have ever met(?)

2016-11-18 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 19:43:49 UTC, H. S. Teoh wrote: I was a little bit afraid of my missunderstanding in terms of sentiments. You've got me right (I don't quite feel the meaning of that in these non-cyrillic letters:). But what I understand is the path you have walked and what I

Re: the best language I have ever met(?)

2016-11-18 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 19:43:49 UTC, H. S. Teoh wrote: I was a little bit afraid of my missunderstanding in terms of sentiments. You've got me right (I don't quite feel the meaning of that in these non-cyrillic letters:). But what I understand is the path you have walked and what I

Re: the best language I have ever met(?)

2016-11-18 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 18, 2016 at 11:43:49AM -0800, H. S. Teoh via Digitalmars-d-learn wrote: [...] > Yes, I meant 'sentiments' as in опыта, not as in сентметальность. :-) [...] Sorry, typo. I meant сентиментальности. But I think you understand what I mean. :-) T -- The most powerful one-line C

Re: the best language I have ever met(?)

2016-11-18 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 18, 2016 at 07:26:56PM +, Igor Shirkalin via Digitalmars-d-learn wrote: > On Friday, 18 November 2016 at 18:14:41 UTC, H. S. Teoh wrote: > > Welcome, Igor! > Hello, Teoh! > > > > Your sentiments reflect mine years ago when I first discovered D. I > > came from a C/C++/Perl

Re: the best language I have ever met(?)

2016-11-18 Thread Igor Shirkalin via Digitalmars-d-learn
On Friday, 18 November 2016 at 18:14:41 UTC, H. S. Teoh wrote: Welcome, Igor! Hello, Teoh! Your sentiments reflect mine years ago when I first discovered D. I came from a C/C++/Perl background. It was also Andrei's book that got me started; in those early days documentation was scant and

Re: the best language I have ever met(?)

2016-11-18 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 18, 2016 at 05:54:52PM +, Igor Shirkalin via Digitalmars-d-learn wrote: > The simpler - the better. > After reading "D p.l." by A.Alexandrescu two years ago I have found my > past dream. It's theory to start with. That book should be read at > least two times especially if you