On Friday, 18 January 2019 at 20:29:08 UTC, H. S. Teoh wrote:
That would work, but it would also suffer from all the same
problems as macro-based programming in C. The compiler would
be unable to detect when you accidentally pasted type names
together where you intended to be separate, the
On Friday, 18 January 2019 at 20:03:48 UTC, Mark wrote:
[...]
Represent types as strings, CTFE them as you see fit, and
output a string that can then be mixin'ed to use the actual
type. :)
Two problems:
1) Mixing in a string is unhygienic. If two modules (or two
scopes in the same module)
On Friday, 18 January 2019 at 20:32:35 UTC, Jacob Carlborg wrote:
On 2019-01-18 20:28, Stefan Koch wrote:
The only difference that type-functions have from what you
describe is that it does not need to occupy a keyword 'type'.
You're using "alias" instead of my "type" keyword?
yes. After
On 2019-01-18 20:28, Stefan Koch wrote:
The only difference that type-functions have from what you describe is
that it does not need to occupy a keyword 'type'.
You're using "alias" instead of my "type" keyword?
--
/Jacob Carlborg
On Fri, Jan 18, 2019 at 08:03:48PM +, Mark via Digitalmars-d-announce wrote:
[...]
> Why not do away with AliasSeq and use strings all the way?
>
> string Constify(string type)
> {
> // can add input checks here
> return "const(" ~ type ~ ")";
> }
>
> void main()
> {
> import
On Thursday, 17 January 2019 at 20:47:38 UTC, Steven
Schveighoffer wrote:
well, there was no static foreach for that article (which I
admit I didn't read, but I know what you mean).
But it's DEFINITELY not as easy as it could be:
import std.conv;
alias AliasSeq(P...) = P;
template
On Friday, 18 January 2019 at 10:23:11 UTC, Jacob Carlborg wrote:
On 2019-01-17 23:44, H. S. Teoh wrote:
YES! This is the way it should be. Type-tuples become first
class
citizens, and you can pass them around to functions and return
them from
functions
No no no, not only type-tuples, you
On Fri, Jan 18, 2019 at 11:23:11AM +0100, Jacob Carlborg via
Digitalmars-d-announce wrote:
> On 2019-01-17 23:44, H. S. Teoh wrote:
>
> > YES! This is the way it should be. Type-tuples become first class
> > citizens, and you can pass them around to functions and return them
> > from functions
On Thu, Jan 17, 2019 at 05:32:52PM -0800, Walter Bright via
Digitalmars-d-announce wrote:
> On 1/17/2019 11:31 AM, H. S. Teoh wrote:
> > [...]
>
> Thanks for the thoughtful and well-written piece.
>
> But there is a counterpoint: symmetry in mathematics is one thing, but
> symmetry in human
On 2019-01-17 23:44, H. S. Teoh wrote:
Interesting. Is it possible to assign a "fake" mangle to type functions
that never actually gets emitted into the object code, but just enough
to make various internal compiler stuff that needs to know the mangle
work properly?
Not sure that would be
On 2019-01-17 23:44, H. S. Teoh wrote:
YES! This is the way it should be. Type-tuples become first class
citizens, and you can pass them around to functions and return them from
functions
No no no, not only type-tuples, you want types to be first class
citizens. This makes it possible to
On 1/17/2019 11:31 AM, H. S. Teoh wrote:
[...]
Thanks for the thoughtful and well-written piece.
But there is a counterpoint: symmetry in mathematics is one thing, but symmetry
in human intuition is not. Anytime one is dealing in human interfaces, one runs
into this. I certainly did with
On 1/17/2019 8:06 AM, bpr wrote:
Was that a pre C++11 version of C++, or a more modern one?
pre C++11
On Thursday, 17 January 2019 at 22:44:08 UTC, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 10:20:24PM +, Stefan Koch via
Digitalmars-d-announce wrote:
P.S. There is one caveat: because of how type-functions work
they cannot, you cannot create a non-anonymous symbol inside a
type-function,
Am 17.01.19 um 23:20 schrieb Stefan Koch:
> For 2 years I have pondered this problem, and I did come up with a
> solution.
> It's actually not that hard to have CTFE interact with type-tuples.
> You can pass them as function parameters, or return them if you wish.
> Of course a type-tuple
On Thu, Jan 17, 2019 at 10:20:24PM +, Stefan Koch via
Digitalmars-d-announce wrote:
> On Thursday, 17 January 2019 at 19:31:24 UTC, H. S. Teoh wrote:
[...]
> > Coming back to the D example at the end, I totally agree with the
> > sentiment that D templates, in spite of their significant
> >
On Thursday, 17 January 2019 at 19:31:24 UTC, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote: [...]
[2]
https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Coming back to the D example at the end, I
On 1/17/19 2:31 PM, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote:
[...]
[2]
https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Haha, seems D did better than C++ in this respect, but not quite at the
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote:
[...]
> [2]
> https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Haha, seems D did better than C++ in this respect, but not quite at the
level of Haskell.
The C++ example of a
On Thursday, 17 January 2019 at 16:06:39 UTC, bpr wrote:
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright
wrote:
Bartosz Milewski is a C++ programmer and a Haskell fan. He
once gave a presentation at NWCPP where he wrote a few lines
of Haskell code. Then, he showed the same code
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright wrote:
On 1/16/2019 4:19 PM, H. S. Teoh wrote:
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
[...]
Yes, that's one of the outstanding qualities of D, and one
that I was
immensely impressed
On Wed, Jan 16, 2019 at 05:59:29PM -0800, Walter Bright via
Digitalmars-d-announce wrote:
[...]
> Bartosz Milewski is a C++ programmer and a Haskell fan. He once gave a
> presentation at NWCPP where he wrote a few lines of Haskell code.
> Then, he showed the same code written using C++ template
>
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright wrote:
Bartosz Milewski is a C++ programmer and a Haskell fan. He once
gave a presentation at NWCPP where he wrote a few lines of
Haskell code. Then, he showed the same code written using C++
template metaprogramming.
The Haskell
On 1/16/2019 4:19 PM, H. S. Teoh wrote:
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
...I do find it remarkable that I can read the d code quite easily
without reaching for the reference manual, but to make sense of his
C++, it sends me trawling
On 1/16/2019 3:43 PM, John Carter wrote:
Somebody on the C++ side has written a reply
https://brevzin.github.io/c++/2019/01/15/if-constexpr-isnt-broken/
From the article:
D (with corrections):
static if (maxLength < 0xFFFE) {
alias CellIdx = uint16_t;
} else {
alias CellIdx
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
[...]
> Given that I have probably written a lot more C++ code in my life than
> d...
>
> ...I do find it remarkable that I can read the d code quite easily
> without reaching for the reference manual, but to
26 matches
Mail list logo