Archive for the Uncategorized Category

Announcing cl-op: a partial application library for Common Lisp

Posted in Uncategorized with tags , , on March 5, 2009 by blarneyfellow

UPDATE: fixed an erroneous example.

Finally pulled my finger out and started releasing. First to face the mess that is the real world is cl-op, my attempt at partial application in Common Lisp.

I harbor no illusions this is something novel but as far as I can tell there is no canonical way of doing it. There is curly but I am not a big fan of reader macros. A lot of projects seem to roll their own but it sucks to depend on a massive code-base for such a small and simple utility. Besides such approaches are often tailored to a specific need and introduce additional impedance if used outside their scope.

Enough rationalisation, let’s get down to business:

(mapcar (op / (+ _ _)) '(2 3 4) '(2 3 4)) => '(1/4 1/6 1/8)

Careful readers will note / is passed as a function name not a designator. When cleaning up cl-op for release I initially changed this to accept function designators like funcall but latter decided against it. Why? Two reasons:

1) it makes Lisp-2 less of a compromise. I’m a lazy and hate function-quoting.

2) plays nice with macros.

The biggest cons was inconsistency but then I remember function works exactly the same way. I fact, I dare say op is semantically closer to function (the creates a lexical closure bit to be precise) than funcall.

An important consideration when writing cl-op was performance. That is why op lifts all complex arguments not containing slots to a closure. In code-speak:

(op foo (baz 1 2 3) (bar _))
==
(let ((#:G100 (baz 1 2 3)))
  (lambda (#:G101) (foo #:G100 (bar #:G101))))

For cases where such behavior is not desired (i.e. relying on side-effects), there is op* which works exactly like op except for invariant lifting:

(mapcar (op + _ (random 100)) '(1 1 1 1 1)) => '(26 26 26 26 26)
(mapcar (op* + _ (random 100)) '(1 1 1 1 1)) => '(51 51 89 13 99)

In addition partial application equivalents (with and without invariant lifting) of funcall, apply and multiple-value-call are provided.

pfuncall is here primarily to compensate for op’s inability to handle functions passed by value. However it also opens an interesting possibility of having function argument as a slot:

(mapcar (pfuncall _ '(1 2 3 4 5))
            (list #'first (op nth 2 _))) => '(1 3)

The rest should be pretty self-explanatory, besides there is even a semblance of documentation at the official homepage.

Reblog this post [with Zemanta]

The Yalta Game . Afterplay

Posted in Uncategorized with tags , , on April 19, 2008 by blarneyfellow
As preformed by SNG Drama on 17th of April 2008.

No, the title is not me trying to cram two posts into one (god knows I need quantity, the last post was over a year ago). It is in fact the exact title of the play. Or rather two plays. In one.

Both are by the contemporary Irish playwright Brian Friel. The first (The Yalta Game) is a dramatisation of Chekhov’s short story Lady With Lapdog. Where it gets interesting is the Afterplay. Friel so masterfully captured Chekhov’s time and spirit I had to remind myself time and again it is actually an original work. The feeling is further reinforced by the characters. Both old acquaintances; Sonya from Uncle Vanya and Andrey Prozorov from The Three Sisters, set about twenty years after their initial ordeals.

The problem is that was it. Sure, the dialogues were witty, the acting good, but for some reason the play just did not resonate with me.

Except for one thing. Nina Ivanišin from AGRFT deserves a big shout-out. Standing out whilst alongside someone like Igor Samobor is a tall order, but she managed it with flying colours. I sincerely hope she joins the ranks of Drama upon graduation.

The Maids

Posted in Uncategorized with tags , , on March 13, 2007 by blarneyfellow
As preformed by SNG Drama on 10th of March 2007.

For me any theatre of the absurd will always be measured against Drama’s Waiting for Godot, the first play that really blew my mind. So, how does The Maids stack up? Very well actually.

predstava-525-custom.jpg

Building on the tradition Drama’s minimalist theatre all that is left are three people, a chair and a dress. What ensues is a vastly oppresing but captivating study into routine, longings, envy, hatred, duty. And than there is the crime. However this motif, so often used to great effect in uncovering the inner workings of our society (just think of Dürrenmatt’s opus, Marat/Sade, Crime and Punishment…), here plays a different, much more central, role. It brings inevitability. A catalyst if you will, that brutally separates fact from fiction.

It should come as no surprise such a complex proposition can only be communicated through superb acting. Starting at the end we have Alojz Svete who unfortunately went a bit over the top. Although usually not a big deal, this play is so tight even a slightest misstep stands out. Gregor Baković is for a change not his usual melancholic self and consequently treats us to a very deep charachter (probably the most fleshed out). However it is Janez Škof who dons laurels with his uncanny ability to portrait what would normally be a rather repugnant person in such a way as to induce a most potent empathic response.

Balancing One-Wheeled Scooter

Posted in Uncategorized with tags , , on March 10, 2007 by blarneyfellow

Another day, another take on Segway (in a nutshell a self-stabilising inherently unstable vehicle), this time with two important differences:

1) riding it does not make you look like a dork,
2) it is a DIY job.

balancing-scooter.jpg

Via MAKE.

The five dinner guests

Posted in Uncategorized with tags on February 16, 2007 by blarneyfellow

I am sure you all know the silly game/psychological test where one is asked which five people one would invite to dinner, if one could pick anyone from history, real or fictitious. I was confronted with said dilemma not long ago while speeding through German countryside. Now most people ponder a bit, present their answers, have a jolly good laugh and move on. Not yours truly. For some reason the question of invitations kept popping back to my mind. I was certainly not satisfied with my answer nor the rationale behind it. After some further deliberation, comparison and analysis, here is a list I feel comfortable with (obviously I am not the first to come up with the idea to share my ramblings with the rest of the world):

  1. Donatien Alphonse François, Marquis de Sade – making sure the conversation will be entrancing for everyone. Maybe we can even get him to organise the after-party.
  2. Godot – so for once I will not be the last to come.
  3. Richard Feynman – epitome of elegance in physics.
  4. Richard Dawkins – evolution may well be the “0th level” of framework for Theory of everything.
  5. Leonardo da Vinci – probably the first hacker.

Careful readers may have noticed science, philosophy and art are represented by three voices each. While symetry as such was not sought, a representative sample of various fields [of my interests] was. This also neatly brings me to the people who did not make the cut:

  • John von Neumann – he was the hardest to let go. Feynman’s knack for simple and to the point explanations eliminated him in the end.
  • Gerardus ‘t Hooft – to many (modern) physicists. Holographic Principle is great, the only thing it lacks is a better link to higher level phenomena. When that happens there just might be an invitation heading Gerarduses way.
  • Friedrich Nietzsche – de Sade without the sex. Enough said.
  • Julius Caesar – a great guy all-around, no doubt about it. He looses on his insights being the least interesting [to me].
  • Otto Lilienthal – too narrow. da Vinci simply brings more to the table.
  • God – a sentient god interacting with us is a rather more complex hypothesis than I find reasonable to entertain.
  • Sakyamuni – the very core of Buddhism is a great ethical/epistemological system, the Noble Eightfold Path however is little bit too dogmatic for my taste.
  • Stephen Wolfram – I like most of his ideas but they are just not groundbreaking enough to warrant a seat.

Gentlemen, bon appetite!

P.S. it seems this post somehow managed to degenerate into a weird celebrity death-match. Perhaps I did overanalyse the whole thing a little bit.

Kleist

Posted in Uncategorized with tags , , on February 15, 2007 by blarneyfellow
As preformed by Slovensko Mladinsko Gledališče.

A play based on fragments of a person’s life has to be very very good to captivate the audience. This one is not.

up805jpg.jpeg

Let me elaborate a bit further, while it certainly has it’s moments, for example the surreal scene featuring the automaton or the atmosphere created by a darkened stage illuminated by a single candle, overall Kleist is bland. It simply lacks any sort of distinction. A spark that the audience would bring back home with them, constantly pecking at them making them to think about the play for days to come. Take repetition for instance, a powerful focus tool, here however it only promotes boredom.

The final straw is an obnoxious amount of pathos in Ivan Rupnik’s interpretation of the title role. Olga Kacjan is good but nowhere near enough to save the play.

Rippin’ it in mud and snow

Posted in Uncategorized with tags , , , , on December 23, 2006 by blarneyfellow

Plowing through deep mud or snow is great fun all around. However as splatter progresses, progress unfortunately diminishes. Not anymore! Now we can have our cake and eat it too. Behold the KTrak:

KTrak

Truth be told such a contraption is strictly speaking not really needed but new vehicles and propulsion methods are always cool. Great for the environment. As we all know, tracks have a lighter footprint and therefore disturb Nature less. Just pure responsibility here, no fun whatsoever, no sir!

P.S. I gladly volunteer to test it in Slovene mud and snow (for the sake of the environment naturally).

The Physics of Sex

Posted in Uncategorized with tags , on December 16, 2006 by blarneyfellow

Love is chemistry and sex is physics is quite a popular saying these days but have you ever wondered what are the actual mechanisms behind it? All nodding frantically should head over to The Physics of Sex for a wonderful explanation. Could do with some schematics though.

We are living in exciting times when science is finally starting to catch up with our curiosity. For example, even our dress choices can be explained in terms of hormone levels.

A Taste of Honey

Posted in Uncategorized with tags , , on December 14, 2006 by blarneyfellow
As preformed by SNG Drama on 11th of December 2006.

It is a cold cold day in hell and Saša Mihelčič was fairly good in the lead role. For me this singular event will mark this play more than anything else which is a shame really, as it was a decent show although nothing to write home about (in retrospect I actually am writing about it; note to self, invest more effort in selecting idioms).

okus_po_medu.jpg

All in all a thought provoking parade of messed-up inter-human relationships (it immediately put me in mind of Pains of Youth) needlessly diluted by being overlong. It is a bit unsettling how seeing plays with such motifs always leads me to seeking similarities with my own experiences. Since most of our interactions can apparently be reduced to a finite number of simple games, such probing usually uncovers at least some resemblance leaving me with even more to think about. As perverted as it may sound, this is one of the reasons I like theater so much.

Lockpicking II

Posted in Uncategorized with tags , , on December 8, 2006 by blarneyfellow