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 12/3/19 12:15 PM, James Blachly wrote:
On 11/17/19 7:15 PM, Steven Schveighoffer wrote:
On 11/17/19 10:45 AM, James Blachly wrote:
/home/james/dmd2.087/dmd2/linux/bin64/../../src/druntime/import/object.d(3453,36):
Error: cannot implicitly convert expression aa of type
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 Tuesday, 3 December 2019 at 18:45:18 UTC, Jan Hönig wrote:
On Tuesday, 3 December 2019 at 13:55:51 UTC, Alex wrote:
This depends on the available accesses on your sets. In terms
of ranges:
Are your sets InputRanges, ForwardRange, ... ?
2) Are there some build-in function for handling
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 Tuesday, 3 December 2019 at 13:55:51 UTC, Alex wrote:
This depends on the available accesses on your sets. In terms
of ranges:
Are your sets InputRanges, ForwardRange, ... ?
2) Are there some build-in function for handling such sets?
This is maybe what you are looking for:
On Tue, Dec 03, 2019 at 09:22:49AM +, Jan Hönig via Digitalmars-d-learn
wrote:
> Today i have stumbled on Hacker News into: https://0.30004.com/
>
> I am learning D, that's why i have to ask.
>
> Why does
>
> writefln("%.17f", .1+.2);
>
> not evaluate into:
On Tuesday, 3 December 2019 at 15:14:03 UTC, ikod wrote:
Never tried, but depending of the nature of your "something"
you can try bit sets. There are efficient algorithms for large
bit arrays (see "roaring" for example).
"roaring" is massive overkill for my case, but thanks for
suggesting
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 2019-12-03 16:34:43 +, Robert M. Münch said:
I have very strange casting error I don't understand:
alias typeof(windows_message_streams[WM_MOUSEMOVE].filter!(win =>
(win.wParam & MK_LBUTTON))) WM_MOUSEMOVE_LBUTTON_TYPE;
WM_MOUSEMOVE_LBUTTON_TYPE WM_MOUSEMOVE_LBUTTON_STREAM;
On 11/17/19 7:15 PM, Steven Schveighoffer wrote:
On 11/17/19 10:45 AM, James Blachly wrote:
/home/james/dmd2.087/dmd2/linux/bin64/../../src/druntime/import/object.d(3453,36):
Error: cannot implicitly convert expression aa of type
shared(GSeqAllele[string]) to const(shared(GSeqAllele)[string])
I have very strange casting error I don't understand:
alias typeof(windows_message_streams[WM_MOUSEMOVE].filter!(win =>
(win.wParam & MK_LBUTTON))) WM_MOUSEMOVE_LBUTTON_TYPE;
WM_MOUSEMOVE_LBUTTON_TYPE WM_MOUSEMOVE_LBUTTON_STREAM;
pragma(msg,typeof(WM_MOUSEMOVE_LBUTTON_STREAM));
On Tuesday, 3 December 2019 at 13:43:26 UTC, Jan Hönig wrote:
It seems i don't google the right keywords.
What i want to do: I have two sets. (I didn't find how to do
sets, so i have two associative boolean arrays
`bool[]`). And i want to join them, via an
intersection.
I know how to code
On Tuesday, 3 December 2019 at 13:43:26 UTC, Jan Hönig wrote:
It seems i don't google the right keywords.
What i want to do: I have two sets. (I didn't find how to do
sets, so i have two associative boolean arrays
`bool[]`). And i want to join them, via an
intersection.
I know how to code
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
It seems i don't google the right keywords.
What i want to do: I have two sets. (I didn't find how to do
sets, so i have two associative boolean arrays
`bool[]`). And i want to join them, via an
intersection.
I know how to code this. Loop over one AA, if the key is also in
the other one,
On Tuesday, 3 December 2019 at 09:22:49 UTC, Jan Hönig wrote:
Today i have stumbled on Hacker News into:
https://0.30004.com/
I am learning D, that's why i have to ask.
Why does
writefln("%.17f", .1+.2);
not evaluate into: 0.30004, like C++
but rather to:
On Tuesday, 3 December 2019 at 09:52:18 UTC, mipri wrote:
Most other languages give you the double result for very
reasonable historical reasons
Not only historical, it is also for numerical reasons. You can
get very unpredictable results if you do compares and compiletime
evalution is
On Tuesday, 3 December 2019 at 09:22:49 UTC, Jan Hönig wrote:
not evaluate into: 0.30004, like C++
but rather to: 0.2
You get the same in C++ with:
#include
int main()
{
printf("%.17f",double(0.1L + 0.2L));
}
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
>
Today, we carry on looking at Window stats and how we can prepare
to preserve them. You'll find it here:
https://gtkdcoding.com/2019/12/03/0092-window-stats-ii-size.html
On Tuesday, 3 December 2019 at 09:22:49 UTC, Jan Hönig wrote:
Today i have stumbled on Hacker News into:
https://0.30004.com/
I am learning D, that's why i have to ask.
Why does
writefln("%.17f", .1+.2);
not evaluate into: 0.30004, like C++
but rather to:
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)
Today i have stumbled on Hacker News into:
https://0.30004.com/
I am learning D, that's why i have to ask.
Why does
writefln("%.17f", .1+.2);
not evaluate into: 0.30004, like C++
but rather to: 0.2
Many other languages evaluate to
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
38 matches
Mail list logo