Re: Solving the impossible?

2018-08-31 Thread aliak via Digitalmars-d-learn
On Thursday, 30 August 2018 at 21:40:40 UTC, Everlast wrote: On Thursday, 30 August 2018 at 00:10:42 UTC, Paul Backus wrote: [...] This is not true! You claim that I'm making a blanket statement about what mathematicians would view then you do the same. [...] If ... implies "an arbitrary

Re: Solving the impossible?

2018-08-30 Thread Everlast via Digitalmars-d-learn
On Thursday, 30 August 2018 at 00:10:42 UTC, Paul Backus wrote: On Wednesday, 29 August 2018 at 22:18:09 UTC, Everlast wrote: No it is not! you have simply accepted it to be fact, which doesn't make it consistent. If you take 100 non-programmers(say, mathematicians) and ask them what is the n

Re: Solving the impossible?

2018-08-30 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 22:18:09 UTC, Everlast wrote: If you take 100 non-programmers(say, mathematicians) and ask them what is the natural extension of allowing an arbitrary number of parameters knowing that A is a type and [] means array and ... means an arbitrary number of, they will

Re: Solving the impossible?

2018-08-29 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 22:18:09 UTC, Everlast wrote: No it is not! you have simply accepted it to be fact, which doesn't make it consistent. If you take 100 non-programmers(say, mathematicians) and ask them what is the natural extension of allowing an arbitrary number of parameters k

Re: Solving the impossible?

2018-08-29 Thread Everlast via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 21:14:59 UTC, Paul Backus wrote: On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier. Determi

Re: Solving the impossible?

2018-08-29 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier. Determinism is a very useful tool as is abstraction consistency. To say

Re: Solving the impossible?

2018-08-29 Thread vit via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: On Tuesday, 28 August 2018 at 22:01:45 UTC, Paul Backus wrote: [...] One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier.

Re: Solving the impossible?

2018-08-29 Thread Everlast via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 22:01:45 UTC, Paul Backus wrote: On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote: Also, the biggest complaint is that when we use [] attached to a type it has a specific meaning as "an array of". e.g., int[] means an array of int's. But int[] a... then

Re: Solving the impossible?

2018-08-29 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote: the second one seems better. Simpler, more direct, more obvious, and inline with the standard non variadic syntax. The ellipses pretty much state that we are dealing with an array, no reason to add redundancy. That's not obvious, e.g

Re: Solving the impossible?

2018-08-28 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote: Also, the biggest complaint is that when we use [] attached to a type it has a specific meaning as "an array of". e.g., int[] means an array of int's. But int[] a... then changes as we don't have an array of int's any more but simply

Re: Solving the impossible?

2018-08-28 Thread Everlast via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 19:40:36 UTC, Paul Backus wrote: On Tuesday, 28 August 2018 at 19:09:38 UTC, Everlast wrote: Yeah, I see the link paul posted. The actual syntax seems a bit strange to me... We don't do A[] a So it is not "logical". foo(A...)(A a) but if A is a specific t

Re: Solving the impossible?

2018-08-28 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 19:09:38 UTC, Everlast wrote: Yeah, I see the link paul posted. The actual syntax seems a bit strange to me... We don't do A[] a So it is not "logical". foo(A...)(A a) but if A is a specific type we must do foo(int[] a ...) The actual syntax then looks l

Re: Solving the impossible?

2018-08-28 Thread bauss via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 19:09:38 UTC, Everlast wrote: On Tuesday, 28 August 2018 at 12:00:50 UTC, bauss wrote: On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote: in fact, I'd rather see void print(T)(T t, int... a) You were actually close. void print(T)(T t, int[] a ...); Ye

Re: Solving the impossible?

2018-08-28 Thread Everlast via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 12:00:50 UTC, bauss wrote: On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote: in fact, I'd rather see void print(T)(T t, int... a) You were actually close. void print(T)(T t, int[] a ...); Yeah, I see the link paul posted. The actual syntax seems a bit

Re: Solving the impossible?

2018-08-28 Thread bauss via Digitalmars-d-learn
On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote: in fact, I'd rather see void print(T)(T t, int... a) You were actually close. void print(T)(T t, int[] a ...);

Re: Solving the impossible?

2018-08-25 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote: The problem is, suppose one wants to specify A void print(T, int... A)(T t, A a) while tricks can be used, why doesn't D support such an obvious syntax? We can specify an arbitrary type but can't restrict it in an obvious way, in fact

Solving the impossible?

2018-08-25 Thread Everlast via Digitalmars-d-learn
void print() { } void print(T, A...)(T t, A a) { import std.stdio; writeln(t); print(a); } The problem is, suppose one wants to specify A void print(T, int... A)(T t, A a) while tricks can be used, why doesn't D support such an obvious syntax? We can specify an arbitrary type but