s/type tuple/template pack/g please
Artur Skawina
art.08.09 at gmail.com
Fri Aug 23 02:55:33 PDT 2013
On 08/22/13 16:57, Dicebot wrote:
> On Thursday, 22 August 2013 at 14:39:59 UTC, Jakob Ovrum wrote:
>> I don't think it's correct or useful to label one as compile-time and the other as runtime. I think the mutability or immutability of the expression tuple is an obvious result of its lvalue-ish or rvalue-ish nature, respectively. As such - with the current semantics - I'm not sure it's important to be able to easily distinguish the two. I'd be happy to be convinced otherwise if you think it's important.
>
> I don't know either :) I am just trying to find some order in existing scheme. What frustrates me most in expression sequences being both runtime and compile-time is that compile-time still can act as if they are almost types:
>
> alias a = TypeTuple!(1, 2); // ok
> auto b = TypeTuple!(1, 2); // also ok!
>
> Isn't it the only entity in the whole language that can be used in type context (alias) and value context (initializer) at the same time?
It's not a "type context". That alias declaration only creates another
name ("alias").
int v;
alias a = v;
auto b = v;
Which btw means that introducing /just/ a new tuple syntax w/o other
changes would make the equivalent of that first 'a' declaration illegal,
for the same reasons that make
alias c = 1;
not valid right now. But allowing literals here shouldn't be a problem
(allowing /all/ rvalues would be, at least w/o a working lifetime system).
artur
More information about the Digitalmars-d
mailing list