Hacker News new | past | comments | ask | show | jobs | submit login
Knitting is an Acceptable Lisp (wetpixels.blogspot.com)
19 points by gruseom on Feb 17, 2009 | hide | past | favorite | 6 comments



Knitting patterns make an acceptable Logo, with basic operational commands (KnitML: usingNeedle), subroutines (instruction), and control structures (repeat/until).

Suffice it to say that s-expressions aren't an acceptable lisp. Thanks for keyword doping the subject, tho.


Not really knowing knitting patterns, it took me a little while to figure out the example. Here's what I come up with through some wikipedia-ing and staring at it for awhile:

1) p = purl stitch and is represented by the horizontal line

2) k = knit stitch and is represented by the vertical line

3) the numbers are the number of stitches of that kind

4) the line start in the lower-right and work to the left and up

Anyone who knows better, please correct me if I'm wrong.


(wow, i never thought my obsession with knitting would come in handy here)

Basically, that's it. My only problem with the pattern is that it's not entirely specific about what to repeat, typically patterns will go "(p2, k2, p1, k1) repeat to end", using parentheses or asterisks to clarify what to repeat, but that's a nitpick at most.


So is it normal for the graphic to go right-to-left even though the pattern is left-to-right?


The way one typically knits on straight needles, you knit from the left needle to the right. When you are done with one row, reverse the right needle so it becomes the left, then knit the next row, repeat. What you see is the graphic when you are done knitting. What the pattern should be doing is zigzagging left-to-right then right-to-left in reverse, i.e. the purl and knit stitches look the opposite from each other: to create something that looks all knitted from the front (and all purled from the back), you knit one row and purl the next row.

edit: Also, the graphic could go the other way, but there is usually a front and back to a knitted piece. There's also knitting in reverse and knitting in the round and more, but generally the pattern will account for that.


Now all you need to do is compile it down to punched cards.

http://en.wikipedia.org/wiki/Jacquard_loom#Importance_to_Com...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: