On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying to do was D'ify C expressions like
this:
typedef ((struct t*)0) blah;
This doesn't compile for me with GCC, and I don't know what it's
supposed to mean. ((struct t*) 0) is a
On Thursday, 12 June 2014 at 22:54:20 UTC, Ali Çehreli wrote:
On 06/12/2014 03:38 PM, monarch_dodra wrote:
So there's something special about null.
The difference is that null is an expression. It is the same
limitation as not being able to alias a literal.
alias zero = 0;
alias
On Fri, Jun 13, 2014 at 7:59 AM, via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying to do was D'ify C expressions like this:
typedef ((struct t*)0) blah;
This
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via
Digitalmars-d-learn wrote:
On Fri, Jun 13, 2014 at 7:59 AM, via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via
Digitalmars-d-learn wrote:
So I'm not sure how to translate that into D. I do know my
first
attempt here doesn't work, even with it being surrounded by
extern (C)
{}:
$ cat chdr.d
struct t;
struct t* t_ptr = null;
This seems to work
On Fri, Jun 13, 2014 at 10:15 AM, monarch_dodra via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via Digitalmars-d-learn
wrote:
So I'm not sure how to translate that into D. I do know my first
attempt here doesn't work,
On 06/12/2014 01:26 PM, Tom Browder via Digitalmars-d-learn wrote:
This will not compile:
alias blah = null;
The dmd message are:
di/test_hdr.d(10): Error: basic type expected, not null
di/test_hdr.d(10): Error: semicolon expected to close alias declaration
di/test_hdr.d(10): Error:
On 6/12/14, 4:29 PM, Ali Çehreli wrote:
On 06/12/2014 01:26 PM, Tom Browder via Digitalmars-d-learn wrote:
This will not compile:
alias blah = null;
The dmd message are:
di/test_hdr.d(10): Error: basic type expected, not null
di/test_hdr.d(10): Error: semicolon expected to
On Thu, Jun 12, 2014 at 03:26:13PM -0500, Tom Browder via Digitalmars-d-learn
wrote:
This will not compile:
alias blah = null;
[...]
'null' is a value, not a type. Try:
alias blah = typeof(null);
T
--
If it's green, it's biology, If it stinks, it's chemistry, If it has numbers
On 06/12/2014 01:36 PM, Andrew Edwards wrote:
void foo() {}
alias bar = foo();
Am I just misunderstanding what is meant by types?
Seems to be an old behavior. That does not compile with 2.066:
Error: function declaration without return type. (Note that constructors
are always named
On Thu, Jun 12, 2014 at 3:42 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thu, Jun 12, 2014 at 03:26:13PM -0500, Tom Browder via Digitalmars-d-learn
wrote:
This will not compile:
alias blah = null;
[...]
'null' is a value, not a type. Try:
On 06/12/2014 02:06 PM, Tom Browder via Digitalmars-d-learn wrote:
What I was really trying to do was D'ify C expressions like this:
typedef ((struct t*)0) blah;
Is that actually a function pointer typedef? I can't parse that line. :)
So, taking your advice, I found this to work (at
On Thu, Jun 12, 2014 at 4:17 PM, Ali Çehreli
digitalmars-d-learn@puremagic.com wrote:
On 06/12/2014 02:06 PM, Tom Browder via Digitalmars-d-learn wrote:
...
What I was really trying to do was D'ify C expressions like this:
typedef ((struct t*)0) blah;
...
So, taking your advice, I found
since null is a value maybe you want
enum blah = null;
you may also give it a type after the enum word
On Thu, Jun 12, 2014 at 4:58 PM, Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
since null is a value maybe you want
enum blah = null;
That works.
you may also give it a type after the enum word
But I can't get any other variant to work so far.
-Tom
On Thursday, 12 June 2014 at 20:44:16 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Thu, Jun 12, 2014 at 03:26:13PM -0500, Tom Browder via
Digitalmars-d-learn wrote:
This will not compile:
alias blah = null;
[...]
'null' is a value, not a type. Try:
alias blah = typeof(null);
On Thursday, 12 June 2014 at 21:58:32 UTC, Adam D. Ruppe wrote:
since null is a value maybe you want
enum blah = null;
you may also give it a type after the enum word
I *think* the issue might be that null is an rvalue? Because
you can alias variable names all you want. I do it all the time
On 06/12/2014 03:38 PM, monarch_dodra wrote:
Yet you can alias variables...
int i;
alias j = i;
Initially I forgot about the fact that symbols can be alias'ed as well.
So that's fine.
So there's something special about null.
The difference is that null is an expression. It is the same
18 matches
Mail list logo