labria’s ruby blog

random ruby/rails stuff

My first working Erlang code.

leave a comment

I wrote my first working bit of Erlang code. Wasn't much code, actually. Here it is:

<erl>
out(A) ->
    {ok, Challenge} = queryvar(A,"hub.challenge"),
    {html,io_lib:format('~s', [Challenge])}.
</erl>

Wow... my highlighter doesn't even support Erlang! now it does

This a complete and finished piece of code, yes. If you heard of PubSubHubbub — that's the code to confirm all subscriptions in async mode.

The funny thing about it is the amount of code I would user to do the same in Rails/Sinatra/Whatever + erb:

<%= params["hub.challenge"]%>

Written by labria

September 15th, 2009 at 1:13 am

Posted in Erlang

Leave a Reply