On Friday, 6 December 2019 at 23:25:30 UTC, Johannes Loher wrote:
On Tuesday, 3 December 2019 at 10:06:22 UTC, Mike Parker wrote:
On Tuesday, 3 December 2019 at 10:03:22 UTC, Basile B. wrote:
That's interesting details of D developement. Since you reply
to the first message I think you have
On Tuesday, 3 December 2019 at 10:06:22 UTC, Mike Parker wrote:
On Tuesday, 3 December 2019 at 10:03:22 UTC, Basile B. wrote:
That's interesting details of D developement. Since you reply
to the first message I think you have not followed but in the
last reply I told that maybe we should be
On Wednesday, 4 December 2019 at 12:54:34 UTC, Basile B. wrote:
On Wednesday, 4 December 2019 at 03:17:27 UTC, Adam D. Ruppe
wrote:
On Wednesday, 4 December 2019 at 01:28:00 UTC, H. S. Teoh
wrote:
typeof(return) is one of the lesser known cool things about D
that make it so cool. Somebody
On Wednesday, 4 December 2019 at 03:17:27 UTC, Adam D. Ruppe
wrote:
On Wednesday, 4 December 2019 at 01:28:00 UTC, H. S. Teoh wrote:
typeof(return) is one of the lesser known cool things about D
that make it so cool. Somebody should write an article about
it to raise awareness of it. :-D
On Tuesday, 3 December 2019 at 10:19:02 UTC, Jonathan M Davis
wrote:
On Tuesday, December 3, 2019 3:03:22 AM MST Basile B. via
Digitalmars-d- learn wrote:
On Tuesday, 3 December 2019 at 09:58:36 UTC, Jonathan M Davis
wrote:
> On Tuesday, December 3, 2019 12:12:18 AM MST Basile B. via
>
>
On Tuesday, 3 December 2019 at 23:44:59 UTC, mipri wrote:
On Tuesday, 3 December 2019 at 10:13:30 UTC, mipri wrote:
Speaking of nice stuff and aliases, suppose you want to
return a nice tuple with named elements?
Option 1: auto
auto option1() {
return tuple!(int, "apples", int,
On Wednesday, 4 December 2019 at 01:28:00 UTC, H. S. Teoh wrote:
typeof(return) is one of the lesser known cool things about D
that make it so cool. Somebody should write an article about
it to raise awareness of it. :-D
you know i probably will write about that next week. so be sure
to
On Wed, Dec 04, 2019 at 01:01:04AM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Tuesday, 3 December 2019 at 23:44:59 UTC, mipri wrote:
> > Option 4: typeof(return)
>
> typeof(return) is super cool for like option type things too!
typeof(return) is one of the lesser known cool things
On Tuesday, 3 December 2019 at 23:44:59 UTC, mipri wrote:
Option 4: typeof(return)
typeof(return) is super cool for like option type things too!
On Tuesday, 3 December 2019 at 10:13:30 UTC, mipri wrote:
Speaking of nice stuff and aliases, suppose you want to
return a nice tuple with named elements?
Option 1: auto
auto option1() {
return tuple!(int, "apples", int, "oranges")(1, 2);
}
Option 2: redundancy
Tuple!(int,
On Tuesday, 3 December 2019 at 22:11:39 UTC, Meta wrote:
On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote:
The thing is, `void` means "no return type" (or "no type" in
some contexts), i.e., void == TBottom in that case.
Not *quite* correct. void is not a bottom type; it's a unit
On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote:
The thing is, `void` means "no return type" (or "no type" in
some contexts), i.e., void == TBottom in that case.
Not *quite* correct. void is not a bottom type; it's a unit type,
meaning that it's a type with only 1 value (as is
On Tue, Dec 03, 2019 at 09:08:55PM +, Paul Backus via Digitalmars-d-learn
wrote:
> On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote:
> > The thing is, `void` means "no return type" (or "no type" in some
> > contexts), i.e., void == TBottom in that case.
>
> This is incorrect.
On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote:
The thing is, `void` means "no return type" (or "no type" in
some contexts), i.e., void == TBottom in that case.
This is incorrect. `void` as a return type is a unit type; that
is, a type with exactly one value. A function with a
On Tue, Dec 03, 2019 at 03:19:02AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Tuesday, December 3, 2019 3:03:22 AM MST Basile B. via Digitalmars-d-
> learn wrote:
[...]
> > [...] maybe we should be able to name the type of null. I think this
> > relates to TBottom too a bit.
>
>
On Tuesday, December 3, 2019 3:23:20 AM MST Basile B. via Digitalmars-d-
learn wrote:
> On Tuesday, 3 December 2019 at 10:19:02 UTC, Jonathan M Davis
>
> wrote:
> > On Tuesday, December 3, 2019 3:03:22 AM MST Basile B. via
> >
> > Digitalmars-d- learn wrote:
> >> [...]
> >
> > There isn't much
On Tuesday, 3 December 2019 at 10:19:02 UTC, Jonathan M Davis
wrote:
On Tuesday, December 3, 2019 3:03:22 AM MST Basile B. via
Digitalmars-d- learn wrote:
[...]
There isn't much point in giving the type of null an explicit
name given that it doesn't come up very often, and typeof(null)
is
On Tuesday, December 3, 2019 3:03:22 AM MST Basile B. via Digitalmars-d-
learn wrote:
> On Tuesday, 3 December 2019 at 09:58:36 UTC, Jonathan M Davis
>
> wrote:
> > On Tuesday, December 3, 2019 12:12:18 AM MST Basile B. via
> >
> > Digitalmars-d- learn wrote:
> >> I wish something like this was
On Tuesday, 3 December 2019 at 10:02:47 UTC, Andrea Fontana wrote:
On Tuesday, 3 December 2019 at 09:48:39 UTC, Basile B. wrote:
You see what surprises me here is that we cannot express the
special type that is `TypeNull` and that can only have one
value (`null`) so instead we have to use
On Tuesday, 3 December 2019 at 10:06:22 UTC, Mike Parker wrote:
On Tuesday, 3 December 2019 at 10:03:22 UTC, Basile B. wrote:
That's interesting details of D developement. Since you reply
to the first message I think you have not followed but in the
last reply I told that maybe we should be
On Tuesday, 3 December 2019 at 10:03:22 UTC, Basile B. wrote:
That's interesting details of D developement. Since you reply
to the first message I think you have not followed but in the
last reply I told that maybe we should be able to name the type
of null. I think this relates to TBottom
On Tuesday, 3 December 2019 at 09:48:39 UTC, Basile B. wrote:
You see what surprises me here is that we cannot express the
special type that is `TypeNull` and that can only have one
value (`null`) so instead we have to use `auto` or
`typeof(null)`.
You can still create an alias anyway :)
On Tuesday, 3 December 2019 at 09:58:36 UTC, Jonathan M Davis
wrote:
On Tuesday, December 3, 2019 12:12:18 AM MST Basile B. via
Digitalmars-d- learn wrote:
I wish something like this was possible, until I change the
return type of `alwaysReturnNull` from `void*` to `auto`.
---
class A {}
On Tuesday, December 3, 2019 12:12:18 AM MST Basile B. via Digitalmars-d-
learn wrote:
> I wish something like this was possible, until I change the
> return type of `alwaysReturnNull` from `void*` to `auto`.
>
>
> ---
> class A {}
> class B {}
>
> auto alwaysReturnNull() // void*, don't compile
>
On Tuesday, 3 December 2019 at 09:44:20 UTC, Basile B. wrote:
On Tuesday, 3 December 2019 at 08:47:45 UTC, Andrea Fontana
wrote:
On Tuesday, 3 December 2019 at 07:24:31 UTC, Basile B. wrote:
A testA()
{
return alwaysReturnNull(); // Tnull can be implictly
converted to A
On Tuesday, 3 December 2019 at 08:47:45 UTC, Andrea Fontana wrote:
On Tuesday, 3 December 2019 at 07:24:31 UTC, Basile B. wrote:
A testA()
{
return alwaysReturnNull(); // Tnull can be implictly
converted to A
}
still nice tho.
Why not [1]?
[1] typeof(null)
On Tuesday, 3 December 2019 at 07:24:31 UTC, Basile B. wrote:
A testA()
{
return alwaysReturnNull(); // Tnull can be implictly
converted to A
}
still nice tho.
Why not [1]?
[1] typeof(null) alwaysReturnNull() { ... }
Andrea
On Tuesday, 3 December 2019 at 07:12:18 UTC, Basile B. wrote:
I wish something like this was possible, until I change the
return type of `alwaysReturnNull` from `void*` to `auto`.
---
class A {}
class B {}
auto alwaysReturnNull() // void*, don't compile
{
writeln();
return null;
}
A
I wish something like this was possible, until I change the
return type of `alwaysReturnNull` from `void*` to `auto`.
---
class A {}
class B {}
auto alwaysReturnNull() // void*, don't compile
{
writeln();
return null;
}
A testA()
{
return alwaysReturnNull();
}
B testB()
{
29 matches
Mail list logo