Representations Count
summary
Demonstrates two Ruby implementations of signed numbers: a naive sign + size version that accumulates nested conditionals and special cases for positive and negative zero, and a second left/right stacks representation with factory methods that implements equality, +, -, < and × by flipping and dropping shapes. The stack version removes conditionals, gives infinitely many equivalent representations (so zero is no longer special), is shorter, and matches all IRB examples; repo and code examples are provided.
AI-written summary · about
chapters (7)
- 0:00Intro
- 1:05The Problem
- 8:12Refactoring
- 12:05Consistency
- 13:12Spatial Reasoning
- 14:15Compositionality
- 21:07Conclusion








