Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mean generally tying the knot is a useful technique, but I think these scenarios all require/exploit non-strict, which is in itself not really immutable in the sense most people use it.

But yes, such code is often useful so that e.g. a parent xml node can refer to its childen nodes while also children nodes can refer to their parents.

Anyway, I'm not sure about this, but I think you can't have circular data structures in the context of strict evaluation (or can you? maybe by defering execution via anonymous functions? I wonder....)



I'm fairly certain I've done similar things in Ocaml (in fact, I think it's where I learned this technique).




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

Search: