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

So, say I have: `characters = [A, B, ...]` and I want to maintain for each character `x` the invariant: `x.target = (first y in 'characters' where y.score > x.score)`

Can Skip maintain such a self-referential invariant automatically? Does the answer depend on A and B's mutability?

(This "graph as array" escape hatch seems to come up in many language designs with compile-time pointer analysis. It's useful, maybe even essential, but you tend to lose some nice language features/guarantees with it, in my limited experience.)

The GC thing sounds excellent!



Not responding to your question directly but I just want to mention that if you mark your class as mutable and use mutable instances, you can write code as you’d expect from other languages. The only downside is that you can’t pass those values to a memoized function unless you do a deep copy.




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

Search: