2 ms·
I'm curious then what you mean by semantics, like the words used for library function names? I've always equated semantics and syntax, perhaps to my detriment.
by JackMorgan 13y ago
I'm curious then what you mean by semantics, like the words used for library function names? I've always equated semantics and syntax, perhaps to my detriment.
- wonderzombie 13y agoSyntax is the presentation layer for semantics. Semantics are the content, meaning, and/or implications for what you convey via syntax. They're largely orthogonal. def add(x, y): return x + y (define (add x y) (+ x y)) These are similar semantically -- they each define a procedure that takes two parameters, adds them, and returns that result. Hand-waving how the language is actually implemented, they're morally equivalent, anyway. But syntactically they're fairly different. Another example: https://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_furiously https://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_fu.... That sentence is semantically meaningless, but it has the correct syntax. edit: fixed code formatting.