Pattern Overloading

Ramsey Nasser
Dec 6, 2016 · 3 min read
foo(45)

function foo(int x) {

for(int i=0;i < 10; i++) {

if(x > 10) {

case(x) {
foo(x < 20); { ... }

if(int x = 0; x < 10; x++);

for(playerName) { ...
int foo(int x) {
if(x < 10) {
return x * (width() + getSize(thing));
}
return 0;
}

Syntactic similarity should mirror semantic similarity

Similar things should look similar and dissimilar things should look dissimilar

(+ 1 2)

(map inc [1 2 3])

(vals {:foo "bar" :baz qux})
{:foo "bar"}

#{:foo "bar"}
(+ 1 2)'(+ 1 2)

Ramsey Nasser

Written by

World famous Commuter Scientist

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade