One year of Go

Russel Winder russel at russel.org.uk
Fri Nov 12 10:39:05 PST 2010


On Fri, 2010-11-12 at 13:06 -0500, Steven Schveighoffer wrote:

> >> if(x)
> >> {
> >>     g(x)
> >> }

> If that is invalid code, then I stand corrected.  If it compiles, then  
> it's a serious flaw that is inexcusable.

I think there is element of "more by luck than judgement" here.  In the
example I tried:

        package main
        
        import "fmt"
        
        func main ( ) {
        	x := false
        	if ( x )
        	{
        		fmt.Printf ( "Hello World." )
        	}
        }


I got the error:

... 7: x not used

So all in all, not entirely satisfactory :-(

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101112/f20c923a/attachment.pgp>


More information about the Digitalmars-d mailing list