June 18, 2008
Reply to Walter,

> Some new stuff to make writing templates easier.
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.031.zip
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.015.zip

what is the solution on 2144? ('==' vs. 'is')

Change the spec or change the way things work?


June 18, 2008
Reply to Walter,

> Some new stuff to make writing templates easier.
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.031.zip
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.015.zip

template alias args using local names. Sweet! The docs mention this but don't have an example.

----

auto return type: Will this work?

class A {}
class B {}

auto Fn()(bool a)
{
 if(false) return new Object();

 if(a) return new A();
 else return new B();
}

----

Template Constraints! (/me drooling)

----

Issue 2112: the type of undefined variable incorrectly assumed to be int
What was this ix here? did a real error type get implmeneted or was it just this bug getting fixed?


June 18, 2008
BCS wrote:
> what is the solution on 2144? ('==' vs. 'is')
> 
> Change the spec or change the way things work?

spec
June 18, 2008
"Walter Bright" <newshound1@digitalmars.com> wrote in message news:g3ba3r$ppu$1@digitalmars.com...

> Good question!
>
> Because deducing the return type requires semantic analysis, and for functions that introduces the old forward reference chicken-and-egg problem. This doesn't happen with function templates, because semantic analysis of them doesn't happen until later.

And what exactly is the problem?  It's "too hard" to implement, or?

I thought D was supposed to drop forward reference restrictions.

Furthermore, the compiler already has support for deducing return types for delegate and function literals.  Why can't the same mechanism be used for declarations?


June 18, 2008
"Walter Bright" <newshound1@digitalmars.com> wrote in message news:g3baci$qou$1@digitalmars.com...
> Jarrett Billingsley wrote:
>> Bug 1675 -- wait, how did you fix that one?
>
> Too long identifiers get turned into an md5 hash (a suggestion made many times here). It's ugly, and the names are not demanglable, but it works.

Joy upon joys.  This means Pyd and my binding library will now work correctly in DMDWin.

>> Will the template alias parameter extension eventually extend to being able to alias expressions in general?
>
> No, because they have to be evaluatable at compile time.

And...?

alias 5 x; // ok

int foo()
{
    return 10;
}

alias foo() y; // ok

alias some.expression z; // error, can't evaluate at compile time.

I see no issue.  The same restriction applies to const variable initializers.  (Or enum variables as they're so called in D2.  Lol, what a dumb name.)


June 18, 2008
Jarrett Billingsley wrote:
> "Walter Bright" <newshound1@digitalmars.com> wrote in message news:g3ba3r$ppu$1@digitalmars.com...
> 
>> Good question!
>>
>> Because deducing the return type requires semantic analysis, and for functions that introduces the old forward reference chicken-and-egg problem. This doesn't happen with function templates, because semantic analysis of them doesn't happen until later.
> 
> And what exactly is the problem?  It's "too hard" to implement, or?
> 
> I thought D was supposed to drop forward reference restrictions.
> 
> Furthermore, the compiler already has support for deducing return types for delegate and function literals.

Because the context in which they appear, statements, do not allow forward references.

> Why can't the same mechanism be used for declarations? 

June 18, 2008
BCS wrote:
> Issue 2112: the type of undefined variable incorrectly assumed to be int
> What was this ix here? did a real error type get implmeneted or was it just this bug getting fixed?

just a bug
June 18, 2008
Reply to Walter,

> BCS wrote:
> 
>> what is the solution on 2144? ('==' vs. 'is')
>> 
>> Change the spec or change the way things work?
>> 
> spec
> 

:)


June 18, 2008
Reply to Walter,

> BCS wrote:
> 
>> Issue 2112: the type of undefined variable incorrectly assumed to be
>> int What was this ix here? did a real error type get implmeneted or
>> was it just this bug getting fixed?
>> 
> just a bug
> 

:(


June 18, 2008
"Walter Bright" <newshound1@digitalmars.com> wrote in message news:g3bf7i$17br$1@digitalmars.com...

>
> Because the context in which they appear, statements, do not allow forward references.

You haven't yet answered the more important question: what exactly is the problem with forward references?  Is it too hard to implement, or is there something much deeper?  Again, I thought D wasn't supposed to have such silliness.