Hacker News new | past | comments | ask | show | jobs | submit login

I agree that your example isn’t very convincing, for an additional reason. You can treat 2x as a function, or you can treat it as an expression, where x is its own special kind of thing: a symbol.

With how the notation is typically used, it’s at least closer to my mental model.

Treating the expression as a function under substitution is one way to look at it, but not the only way.




The point is that 2 and (λ (x) 2) are vastly different objects, yet in standard math are treated the same.

Also you don't need a symbol type to deal with variables, you just need to allow type variables to be used in standard expressions. (define x R) (^ x 2) is just as easy to manipulate as (λ (x) (^ x 2)), the only issue is that your rewrite rules how aren't just looking at syntax, but semantics too.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: