https://ashwinram.org/1986/01/28/a-short-ballad-dedicated-to-the-growth-of-programs/ Cognitive Computing A research blog by Ashwin Ram, PhD [Search this Blog ] Search * Home * About Me * Formal Bio * Products * Startups * Students << Evaluating Text-Mining Strategies for Interpreting DNA Microarray Expression Profiles How To Present A Paper >> 28 Jan A Short Ballad Dedicated to the Growth of Programs Posted January 28, 1986 by cognitivecomputing in Opinion. 2 Comments I wrote this as a junior PhD student at Yale, as a commentary on the sociotechnical (aka religious) wars in the functional programming community at the time. Reproduced here, complete with archane email headers. Date: 28 Jan 86 06:22:59 EST (Tue) From: ram@yale-ring Subject: Of growing code and diminishing hacks... Sender: ram%yale-ring%arpa.yale@edu.mit.lcs.mc To: t-discussion@arpa.yale, scheme@arpa.mit-mc This is a tale of a sorry quest To master pure code at the T guru's behest I enrolled in a class that appealing did seem For it promised to teach fine things like T3 and Scheme The first day went fine; we learned of cells And symbols and lists and functions as well Lisp I had mastered and excited was I For to master T3 my hackstincts did cry I sailed through the first week with no problems at all And I even said "closure" instead of "function call" Then said the master that ready were we To start real hacking instead of simple theory Will you, said he, write me a function please That in lists would associate values with keys I went home and turned on my trusty Apollo And wrote a function whose definition follows: (cdr (assq key a-list)) A one-liner I thought, fool that I was Just two simple calls without a COND clause But when I tried this function to run CDR didn't think that NIL was much fun So I tried again like the good King of yore And of code I easily generated some more: (cond ((assq key a-list) => cdr)) It got longer but purer, and it wasn't too bad But then COND ran out and that was quite sad Well, that isn't hard to fix, I was told Just write some more code, my son, be bold Being young, not even a moment did I pause I stifled my instincts and added a clause (cond ((assq key a-list) => cdr) (else nil)) Sometimes this worked and sometimes it broke I debugged and prayed and even had a stroke Many a guru tried valiantly to help But undefined datums their efforts did squelch. I returneth once more to the great sage of T For no way out of the dilemma I could see He said it was easy -- more lines must I fill with code, for FALSE was no longer NIL. (let ((val (assq key a-list))) (cond (val (cdr val)) (else nil))) You'd think by now I might be nearing the end Of my ballad which seems bad things to portend You'd think that we could all go home scot-free But COND eschewed VAL; it wanted #T So I went back to the master and appealed once again I said, pardon me, but now I'm really insane He said, no you're not really going out of your head Instead of just VAL, you must use NOT NULL instead (let ((val (assq key a-list))) (cond ((not (null? val)) (cdr val)) (else nil))) My song is over and I'm going home to bed With this ineffable feeling that I've been misled And just in case my point you have missed Somehow I preferred (cdr (assq key a-list)) LYSP, a recent programming language inspired by the ballad: www.piumarta.com/software/lysp/ And yes: (cdr (assq key a-list)) does work in LYSP! --------------------------------------------------------------------- Here's my latest geek poem: cognitivecomputing.wordpress.com/2010/10/ 11/a-is-for-apple--the-new-millennial-edition/ Rate this: Share this: * Twitter * Facebook * Like this: Like Loading... Related 2 responses to this post. 1. # Posted by vinit on October 6, 2009 at 1:00 am Well done Ashwin. Really nice Reply 2. Posted by A is for Apple--The New Millennial Edition << Cognitive Computing on October 11, 2010 at 8:25 pm [...] Related Posts: Here's a ballad I wrote many years ago: cognitivecomputing.wordpress.com/1986/01/28/ a-short-ballad-dedicated-to-the-growth-of-programs [...] Reply Leave a Reply Cancel reply Enter your comment here... [ ] Fill in your details below or click an icon to log in: * * * Gravatar Email (required) (Address never made public) [ ] Name (required) [ ] Website [ ] WordPress.com Logo You are commenting using your WordPress.com account. ( Log Out / Change ) Facebook photo You are commenting using your Facebook account. ( Log Out / Change ) Cancel Connecting to %s [ ] Notify me of new comments via email. [ ] Notify me of new posts via email. [Post Comment] [ ] [ ] [ ] [ ] [ ] [ ] [ ] D[ ] About Ashwin Ram Professor. Researcher. Entrepreneur. View my LinkedIn profileView my profile Read my bio on WikipediaRead my bio Follow me on TwitterFollow me OpenStudy with meOpenStudy with me Tags believable agents case-based reasoning cognitive media creativity educational technology games goal-driven learning healthcare information retrieval interactive drama Learning meta-reasoning multistrategy learning natural language open education personality models planning problem-based learning problem solving real-time cbr rts games semantic memory social learning text cbr virtual worlds Categories * Agents (50) * Books (3) * Education (20) * Game AI (37) * Health & Wellness (23) * Language (58) * Learning (96) * Opinion (32) * Reviews (2) * Robotics (13) * Talks (35) * Web / Web 2.0 (41) Recent Posts * Hardware as the interface for AI, ML, and Data * Innovating+Interacting with AI * Alexa Prize -- State of the Art in Conversational AI * An Inside Look at the 2017 Alexa Prize Finals * Podcast: How Amazon's Alexa Learns Top Posts * A Short Ballad Dedicated to the Growth of Programs * A is for Apple--The New Millennial Edition * A Theory of Questions and Question Asking Twitter Updates Tweets by ashwinram January 1986 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 << Sep Aug >> Blog at WordPress.com. * Follow Following + [wpcom-] Cognitive Computing Join 39 other followers [ ] Sign me up + Already have a WordPress.com account? Log in now. * + [wpcom-] Cognitive Computing + Customize + Follow Following + Sign up + Log in + Copy shortlink + Report this content + View post in Reader + Manage subscriptions + Collapse this bar %d bloggers like this: [b]