www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - the typefunction branch is now only fails expected test

reply Stefan Koch <uplink.coder googlemail.com> writes:
Good evening,

I am proud to say that after a couple minutes of bugfixing.

the latest typefunction development branch 'talias_master' does 
no longer fail any tests which don't have to do with the semantic 
changes

the tests which it fails are:

---
/*
TEST_OUTPUT:
---
fail_compilation/fail239.d(8): Error: type `F` is not an 
expression
---
*/
class F { int x; }
alias typeof(F).x b;
---

/*
TEST_OUTPUT:
---
fail_compilation/fail240.d(9): Error: type `F` is not an 
expression
---
*/

class F { int x; }
alias typeof(typeof(F).x) b;
---

and

---
/*
TEST_OUTPUT:
---
fail_compilation/fail248.d(9): Error: type `int` is not an 
expression
---
*/

alias int foo;
typeof(foo) a; // ok
---

Because a type is now indeed an expression.
And the type of 'int' is '__type__'

It should also be noted that, with a minor change to phobos in 
'CommonType' it's unittests pass.
The reason why CommonType has to be changed is because it is 
written to assume that typeof(some_type) yields an error.
Which is now no longer the case.

apart from that; Everything that used to work works!

When using type functions with std.range  however things are 
still failing since std.range is written in an obtuse style and 
very brittle.

Cheers,

Stefan
Jan 04 2021
next sibling parent reply Max Haughton <maxhaton gmail.com> writes:
On Monday, 4 January 2021 at 23:48:32 UTC, Stefan Koch wrote:
 Good evening,

 I am proud to say that after a couple minutes of bugfixing.

 [...]
Have they been mentioned outside of the forums yet? Seems ready for a blog post.
Jan 04 2021
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Tuesday, 5 January 2021 at 00:33:22 UTC, Max Haughton wrote:
 On Monday, 4 January 2021 at 23:48:32 UTC, Stefan Koch wrote:
 Good evening,

 I am proud to say that after a couple minutes of bugfixing.

 [...]
Have they been mentioned outside of the forums yet? Seems ready for a blog post.
I mentioned them in private conversations. I think you are right. I should do something more visible about them. Though is the blog actually more visible than the forums? I don't know :p
Jan 04 2021
parent Max Haughton <maxhaton gmail.com> writes:
On Tuesday, 5 January 2021 at 00:37:19 UTC, Stefan Koch wrote:
 On Tuesday, 5 January 2021 at 00:33:22 UTC, Max Haughton wrote:
 On Monday, 4 January 2021 at 23:48:32 UTC, Stefan Koch wrote:
 Good evening,

 I am proud to say that after a couple minutes of bugfixing.

 [...]
Have they been mentioned outside of the forums yet? Seems ready for a blog post.
I mentioned them in private conversations. I think you are right. I should do something more visible about them. Though is the blog actually more visible than the forums? I don't know :p
No one other than D programmers reads the D forums, whereas almost any blog post will get some traction on hackernews et al. because they usually cause discussion about D in general rather than the subject of the blog usually.
Jan 04 2021
prev sibling parent reply sighoya <sighoya gmail.com> writes:
Cool, is there any DIP planned/existing to be talked about?
Jan 06 2021
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Wednesday, 6 January 2021 at 13:11:59 UTC, sighoya wrote:
 Cool, is there any DIP planned/existing to be talked about?
I am planning to write one. But first I want to make sure that I am accidentally precluding my intended follow-up steps. Namely have typefunctions be usable for most operations you frequently want to do in meta-programming. Including adding auto-generated methods to structs, working with UDAs and so, and so on. The reason for that is that type functions scale better than templates. I am not sure if I will get a one-size-fits-all solution, but I am having success so far.
Jan 07 2021