# Roxanne

The lovely and talented Paul Frankl is making a(nother) film, and needs some help with funding it.

Here’s some of Paul’s previous work:

The cast for Roxanne includes the sensational Miss Cairo, in the title role. Check out her performance in/as Jessica Rabbit, below…

# Mathematics is a symptom…

Spelled out a little, the argument runs like this: a completely chaotic universe not only would not be amenable to mathematical description, but would not be such that any kind of mathematics could be practised in it, since the practice of mathematics itself requires that it be possible for certain kinds of stable entities and entailments (a stock of symbols, arrangements of those symbols according to a syntax, repeatable procedures of induction and verification) to exist.

The existence of mathematics does not prove that the universe is in essence mathematical, but it does prove that the universe is capable of at least local stability and regularity, of which the stability and regularity of mathematics itself is a demonstrable instance. Phenomena that are amenable to mathematical description are by that token also instances of at least local stability and regularity.

There is no good reason to suppose that the universe is fundamentally chaotic, any more than we are obliged to suppose that the universe is fundamentally stable and regular. Chaos is not necessarily degenerate order; order is not necessarily arrested (or misperceived) chaos.

# Cosmos and Disaster

First recording from Sombre Gratification.

# Enriching is Easy

Today I’d like to talk about a pattern that as far as I know is unique to Java 8. It makes use of the unusual way Java 8 implements lambdas as single-method interfaces, and the support for default methods in interfaces, to produce what I call “enriched lambdas”.

Here’s a simple example: a “Logged function” that logs every call that is made to it:

Now we can add the logging behaviour to any function by assigning or casting it to LoggedFunction rather than Function:

How does this work? LoggedFunction has only one method without a default implementation, so any lambda that matches the signature of this method can be cast to an instance of LoggedFunction. Instead of overriding the “apply” method of LoggedFunction, the lambda will override the “applyLogged” method, which the default “apply” method implementation delegates to.

Octarine uses this pattern in a variety of ways, notably to build up Schemas, Serialisers and Deserialisers from single lambda expressions:

In this case, the unimplemented method is used to configure the object, and all other methods (with their default implementations) use this method to obtain their configuration.

This pattern is similar in some respects to the “enrich my library” pattern in Scala, which uses implicits – it provides a safe and convenient way to “upcast” simple lambdas to objects with enriched behaviour.