A bug in get_iplayer-3.01?

Graham Temple Personal graham.j.temple at gmail.com
Thu Jul 6 14:46:14 PDT 2017


I have received nothing from the list since 18/6.  Can I be added back on to
the mailing list please?

Regards

Graham Temple

-----Original Message-----
From: get_iplayer [mailto:get_iplayer-bounces at lists.infradead.org] On Behalf
Of Ralph Corderoy
Sent: 18 June 2017 12:25
To: get_iplayer at lists.infradead.org
Subject: Re: A bug in get_iplayer-3.01?

Hi Richard,

> I was frantically reading about the scope of variables.  My background 
> is Algol 60 and PLI where a block is a compound statement with local 
> declarations.  I gather in Perl it's the other way round.

No, I think it's the same as those language, C.  Running

    $n = 1;

    sub foo {
	print "b $n\n";
	my $n = 2;
	print "c $n\n";
	for (my $i = 0; $i < 2; $i++) {
	    print "d $n\n";
	    if ($i == 0) {
		my $n = 3; # Never printed.
	    } else {
		$n = 4; # No my.
	    }
	    print "e $n\n";
	}
	print "f $n\n";
    }

    print "a $n\n";
    foo;
    print "g $n\n";

gives

    a 1
    b 1
    c 2
    d 2
    e 2
    d 2
    e 4
    f 4
    g 1

> I hear what you say about C++, but I find it easier than Python.

If that's because you like its types-defined-at-compile-time nature then Go
will appeal.

    func main() {
	    type (
		    foo int
		    bar int
	    )
	    var (
		    f foo
		    b bar
	    )
	    f = 42
	    b = f
    }

"cannot use f (type foo) as type bar in assignment".

--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

_______________________________________________
get_iplayer mailing list
get_iplayer at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer




More information about the get_iplayer mailing list