On 2013-04-15 13:01, Mike Parker wrote:
On Monday, 14 January 2013 at 21:00:12 UTC, Simen Kjaeraas wrote:
alias foo = extern(System) void function();
Gives me an error about expecting basic type, not extern.
extern(System) alias void function() foo;
But that's the old syntax, with which o
On Monday, 14 January 2013 at 21:00:12 UTC, Simen Kjaeraas wrote:
alias foo = extern(System) void function();
Gives me an error about expecting basic type, not extern.
extern(System) alias void function() foo;
On 22/05/2011 21:51, Timon Gehr wrote:
I suspect what Andrej actually meant is to kill treating function
signatures as types in this way. And possibly "enhancement
request" rather than "bug".
It is the opposite of an enhancement request. It means removing a
feature that cannot be meaningfull
On 23/05/2011 07:43, David Nadlinger wrote:
On 5/23/11 8:41 AM, Andrej Mitrovic wrote:
What's wrong with using this:
alias void function(int, int) funcAlias;
It's a function pointer type, not a function type.
How is that something wrong with it? I.e. what can you do with a function type
On Mon, 23 May 2011 14:06:31 -0400, Timon Gehr wrote:
Steven Schveighoffer wrote:
On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic
wrote:
Since &main can't be a template value argument, maybe he meant this use
case:
alias int func();
void foo(alias T)()
{
static assert(is(typeof
Steven Schveighoffer wrote:
> On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic
> wrote:
>
>> Since &main can't be a template value argument, maybe he meant this use
>> case:
>>
>> alias int func();
>>
>> void foo(alias T)()
>> {
> static assert(is(typeof(&T) == int function())); // fixed
Nice.
On Mon, 23 May 2011 10:50:11 -0400, Andrej Mitrovic
wrote:
Since &main can't be a template value argument, maybe he meant this use
case:
alias int func();
void foo(alias T)()
{
static assert(is(typeof(&T) == int function())); // fixed
}
int main()
{
foo!main;
return 0;
}
Since &main can't be a template value argument, maybe he meant this use case:
alias int func();
void foo(alias T)()
{
static assert(is(typeof(T) == func));
}
int main()
{
foo!main;
return 0;
}
On Mon, 23 May 2011 09:59:01 -0400, Steven Schveighoffer
wrote:
On Mon, 23 May 2011 09:32:47 -0400, Timon Gehr wrote:
Steven Schveighoffer wrote:
it's akin to
making:
if(x);
invalid. Yes, it's valid syntax, but it's almost certainly not what the
user wanted. It's special cased for fail
On Mon, 23 May 2011 09:32:47 -0400, Timon Gehr wrote:
Steven Schveighoffer wrote:
it's akin to
making:
if(x);
invalid. Yes, it's valid syntax, but it's almost certainly not what the
user wanted. It's special cased for failure, to aid the developer in
writing less buggy programs. This would
Well if there's no better way to do it and it's useful, we should do a
feature request for a better syntax, no?
On 5/23/11, Timon Gehr wrote:
> BTW:
>
> writeln(typeid(int function(int))); //int()*
>
> wtf?
Yeah, typeid generally seems to be bad for these things.
typeof.stringof to the rescue:
writeln((int function(int)).stringof); // int function(int)
Steven Schveighoffer wrote:
> It is not perfectly consistent. The function type syntax is useless,
> because you can only use it if you use the pointer modifier with it. If
> you want to declare a function pointer, there are other (better) ways.
Yes, other ways of declaring a function pointer ar
On Sun, 22 May 2011 11:20:15 -0400, Timon Gehr wrote:
Andrej Mitrovic wrote:
Should I file a bug report to kill this syntax?
No. It is perfectly valid, see grammar:
http://www.digitalmars.com/d/2.0/declaration.html
What is strange about this syntax in particular?
int i; //declares i of typ
Ah ok.
Hey if it's used for something useful I won't steal it from you. ;)
On 5/23/11 8:41 AM, Andrej Mitrovic wrote:
On 5/22/11, Timon Gehr wrote:
The problem is, that currently there is no other
I do not get why anybody would want to remove the possibility to refer to
function
signatures.
What's wrong with using this:
alias void function(int, int) funcAlias;
It
On 5/22/11, Timon Gehr wrote:
> The problem is, that currently there is no other
> I do not get why anybody would want to remove the possibility to refer to
> function
> signatures.
What's wrong with using this:
alias void function(int, int) funcAlias;
> On 22/05/2011 16:20, Timon Gehr wrote:
>> Andrej Mitrovic wrote:
>>> Should I file a bug report to kill this syntax?
>>
>> No. It is perfectly valid, see grammar:
>> http://www.digitalmars.com/d/2.0/declaration.html
>
> Grammar states only that it's syntactically valid, and makes no comment on
se
On 22/05/2011 16:20, Timon Gehr wrote:
Andrej Mitrovic wrote:
Should I file a bug report to kill this syntax?
No. It is perfectly valid, see grammar:
http://www.digitalmars.com/d/2.0/declaration.html
Grammar states only that it's syntactically valid, and makes no comment on
semantic validit
Andrej Mitrovic wrote:
> Should I file a bug report to kill this syntax?
No. It is perfectly valid, see grammar:
http://www.digitalmars.com/d/2.0/declaration.html
What is strange about this syntax in particular?
int i; //declares i of type "int"
alias int i; //defines i as type "int"
int func(i
Should I file a bug report to kill this syntax?
On 22/05/2011 11:57, Steven Schveighoffer wrote:
On Sat, 21 May 2011 05:15:32 -0400, Simen Kjaeraas
wrote:
It's the old C syntax for defining function pointers. Well, without the
pointer. And that last part is important, because the latter example is
an array of function pointers, with which
On 21/05/2011 10:15, Simen Kjaeraas wrote:
On Sat, 21 May 2011 05:12:20 +0200, Andrej Mitrovic wrote:
Taken from the docs:
alias int func(int);
It's the old C syntax for defining function pointers.
Functions, not function pointers. The C syntax for declaring function pointers
is
i
On Sat, 21 May 2011 05:15:32 -0400, Simen Kjaeraas
wrote:
On Sat, 21 May 2011 05:12:20 +0200, Andrej Mitrovic
wrote:
Taken from the docs:
alias int func(int);
void main()
{
if ( is(func[]) ) // not satisfied because arrays of
writeln("satisfied");// functio
On Sat, 21 May 2011 05:12:20 +0200, Andrej Mitrovic wrote:
Taken from the docs:
alias int func(int);
void main()
{
if ( is(func[]) ) // not satisfied because arrays of
writeln("satisfied");// functions are not allowed
else
writeln("not satisfied");
}
Andrej Mitrovic Wrote:
> Taken from the docs:
>
> alias int func(int);
> void main()
> {
> if ( is(func[]) ) // not satisfied because arrays of
> writeln("satisfied");// functions are not allowed
> else
> writeln("not satisfied");
> }
>
> It will print n
Taken from the docs:
alias int func(int);
void main()
{
if ( is(func[]) ) // not satisfied because arrays of
writeln("satisfied");// functions are not allowed
else
writeln("not satisfied");
}
It will print not satisfied. But I'm not sure what func is supp
> --
> As to your question:
> class K{
> alias static int B;
> B b; // b is non-static
> }
> --
>
Curious. I didn't actually test the example, but I did for deprecated,
and it doesn
Ellery Newcomer Wrote:
> > You mean how the compiler rejects "alias const int x;" but not "alias
> > static int x;"? That is strange..
>
> I want to know why
>
> alias static int x;
>
> is allowed in the first place
d.grammar accepts: alias const int a; but compiler no (it is ok).
d.grammar a
> You mean how the compiler rejects "alias const int x;" but not "alias
> static int x;"? That is strange..
I want to know why
alias static int x;
is allowed in the first place
On Sat, Aug 1, 2009 at 11:13 PM, Ellery
Newcomer wrote:
> um, yeah.
>
> Declaration:
> typedef Decl
> alias Decl
> Decl
>
> Decl:
> StorageClasses Decl
> BasicType Declarators ;
> BasicType Declarator FunctionBody
> AutoDeclaration
>
>
> Never mind
Jarrett Billingsley wrote:
> On Sat, Aug 1, 2009 at 8:31 PM, Ellery
> Newcomer wrote:
>> what is the purpose of the syntax
>>
>> alias StorageClasses Declarator
>>
>> ?
>
> I don't know where you're getting that grammar. Is that from the D spec?
um, yeah.
Declaration:
typedef Decl
On Sat, Aug 1, 2009 at 8:31 PM, Ellery
Newcomer wrote:
> what is the purpose of the syntax
>
> alias StorageClasses Declarator
>
> ?
I don't know where you're getting that grammar. Is that from the D spec?
what is the purpose of the syntax
alias StorageClasses Declarator
?
(I just noticed my parser doesn't support it, but I don't see any reason to)
35 matches
Mail list logo