Sunday, April 24, 2016
Wednesday, April 20, 2016
def foo(a,b,c): bar() L = [1,4,"s"] foo(*L)
This implicitly takes a sequence type (in this case, a list) and explodes its contents into the parameters a,b,c. (You have to watch out that the sequence contains the right number of parameters, of course.)
In Scala, which I'm writing for my current job, I was pleasantly surprised to find that the same kind of functionality exists, as long as the function is declared varargs:
def foo(ts: T*) L = List(t0,t1,t2) foo(L :_*)
This is especially useful if, for example, foo() is defined in some Java library that doesn't do any kind of polymorphism well.
Apparently, the ":_*" type annotation on the end there is called the "splat operator" (much easier to pronounce), and it's a part of the Scala Language Specification.
Monday, January 4, 2016
Thursday, October 29, 2015
Thursday, October 1, 2015
Winners: Chris Bell out the gate knew his details, knew his programs, and was very personable. Sylvester Turner also kept his base happy, and in particular kept bringing questions of equity and access for the whole city to the fore.
King burnished his fiscally-conservative-curmudgeon badge. If that's your thing.
Losers: McVey was out of his depth. Also Ben Hall for not even showing up (though apparently it was due to some kind of medical event, so that gets a pass).
The rest: they all convinced me they want the job more than they want to do the job. That goes double for Adrian Garcia.