Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Linked lists considered harmful

Name: Anonymous 2009-10-10 20:46

  ↑    slava_pestov 4 points 5 hours ago [-]
  ↓    A perfect illustration of why single linked lists are simply the wrong data structure in
        99% of cases. Just use arrays and you won't have to choose between tail recursion, and
        front-to-back iteration order.
        permalink report reply

Name: Anonymous 2009-10-10 22:42

>>21
Nothing comes to mind at the moment, although I have in the past had code that I totally could have factored in Factor but couldn't in the language I was using. But the basic idea is that since Factor is concatenative, “snipping” out a portion of code verbatim (or nearly) is often easier than it would be if a bunch of nesting were involved. You can usually just lift out code directly into a new function. It helps that Factor is particularly concise. Plus concatenative languages make for something that isn't exactly automatic curring (as it appears to me now), but is similar in practice. A function whose body is something like “2 *” is not a problem. Factoring in Factor involves less plumbing with variables than it would in Lisp or most other languages. Obviously Haskell has some of these benefits as well.

Sorry if that's lame.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List