Wednesday, April 20, 2016

Scala varargs and splats

Coming from a Python background, I got a lot of mileage out of the easy sequence parameter expansion pattern:

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

We Sold Our Souls To Metal Tour

Earth Side: Proggy all-instrumental trio (with canned vocals from, of all people, Bjorn Strid). Got skills, though their technical musicianship isn't quite there yet. I like the songwriting too, such as I can hear in this deafening mix.


Shattered Sun: Texas metalcore, a little like Threat Signal but with a more grinding guitar style. I have no idea what the keyboard player was there for.

Soilwork: needs no introduction


There was also this band called Soulfly that played last, but fuck those assholes.

Thursday, October 1, 2015

Forum wrap-up

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.