Thursday, June 7, 2007

i am, at least in the non-programming sense, fairly functional

hooray, for i did the first iteration of MusicXML export in less than a day. I had a little bit of fighting with lisp, particularly where I tried to be extra lispy and use mapcar. Eventually, I realized that mapcar just wasn't doing what I wanted and I switched it to loop. I felt like I cheated a little, since I know that some lispers consider loop to be insufficiently lispy, and one of my major goals for the summer is to be able to think in lisp, whatever that means. On the other hand, I think the real spirit of lisp is probably more along the lines of this programming language makes it easier for you to hack code. Given that as an ethos, using loop allowed me to meet my goal, and got me there significantly faster than figuring out the right functional way would have. hence it was the right choice.

2 comments:

Anonymous said...

For what it's worth, I think the epiphany in "thinking in Lisp" comes when you realise that the only way you can write non-Lispy code is when you contort yourself to match some view of the language that you have, rather than allowing the language to help you express whatever it is you want to express.

That's probably a bit vague for you right now, so maybe here's another way to put it: when loop is the easiest way to express the solution to your problem, use loop – and then you'll be writing in Lisp.

Christophe

Anonymous said...

It's good to read about this project! It sounds like most of the issues now are on the Lisp / Gsharp learning curve. But if you get to issues on the MusicXML learning curve, feel free to sign up to join the MusicXML developer mailing list and ask questions there:

http://www.recordare.com/lists#MusicXML

Michael