Patrick (patrickwonders) wrote,
Patrick
patrickwonders

  • Mood:

Dreaming in Erlang

I was reading Erlang documentation much of last night. I awoke this morning with it on my mind.

It blended with stories from NPR on the radio this morning while I was waking and bits from the opening chapters of The Happiest Baby on the Block (which I also started reading last night).

The end result is that there are sound, functional programming reasons why a multiprocess mother/fetus relationship resulted in the (long gone) 55 m.p.h. national speed limit and why McCain and Obama have differing stances on taxation.

In the dream, there was code. I cannot produce much of it any longer. I have to start keeping a compiler at my bed side. 8^). It started something vaguely like this:

    mother() ->
        baby ! { warmth, self() }
        receive
            { heartbeat, Baby } ->
                f(X),
                mother()
        end.

    -record(speed_limits,{minimum,maximum}).

    f([_|_]) ->
        broadcast(#speed_limits{ minimum = 0, maximum = 55 });
    f([]) ->
        % spending policy here
        .
Tags: dream, erlang
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

  • 1 comment