Thread overview
January NWCPP Presentation
Jan 22, 2007
Kyle Furlong
Jan 22, 2007
Walter Bright
Jan 27, 2007
Bill Baxter
Jan 27, 2007
Frits van Bommel
January 22, 2007
How did it go? :-)
January 22, 2007
Kyle Furlong wrote:
> How did it go? :-)

I've been told it went over well. The video is supposed to go up on google video at some point.
January 27, 2007
Walter Bright wrote:
> Kyle Furlong wrote:
>> How did it go? :-)
> 
> I've been told it went over well. The video is supposed to go up on google video at some point.

Slides from the talk are up now.

http://www.nwcpp.org/Meetings/2007/01.html

--bb
January 27, 2007
Bill Baxter wrote:
> Walter Bright wrote:
>> Kyle Furlong wrote:
>>> How did it go? :-)
>>
>> I've been told it went over well. The video is supposed to go up on google video at some point.
> 
> Slides from the talk are up now.
> 
> http://www.nwcpp.org/Meetings/2007/01.html

From the section on expression tuples:
"""
It can be used to create an array literal:

alias Tuple!(3, 7, 6) AT;

...
int[] a = [AT];		// same as [3,7,6]
"""

I was surprised to read this, as I tried that very thing just yesterday and it didn't work. I have now investigated further. My findings:
-----
import std.stdio;

alias Tuple!(1,2,3) AT;

void main() {
    int[] foo_dyn_local = [AT];     // works
    int[3] foo_static_local = [AT]; // works

    writefln(foo_dyn_local);
    writefln(foo_static_local);
//    writefln(foo_dyn_global);
//    writefln(foo_static_global);


}

// Error: cannot implicitly convert expression (tuple1,2,3)
// of type (int, int, int) to int
//int[] foo_dyn_global = [AT];

// Error: cannot implicitly convert expression (tuple1,2,3)
// of type (int, int, int) to int
//int[3] foo_static_global = [AT];
-----

Why does this only work at function scope?