One of the things that I've been puzzled by for a long time is the distinction between syntax and semantics. Start with this syntactically flawed bit of English:
- I am swimming a hamburger.
- Let xyzzing be eating if the temperature is more than 34 degrees and let it be swimming otherwise. I am xyzzing a hamburger.
One might object that the second sentence of (2) is syntactically correct even when the temperature is 30 degrees. It's just that it then has a semantic value of undefined. This move is similar to how we might analyze this bit of Python code:
def a(f): print(f(1,2)) def g(x,y): x+y def h(x): 2*x a(g if temperatureSensor()>34 else h)This code will crash with
TypeError:when the temperature sensor value is, say, 30. But the behavior of a program, including crashing, is a matter of semantics. The Python standard (I assume) specifies that the program is going to crash in this way. I could catch the TypeError if I liked with
() takes exactly 1 argument (2 given)
try/except, and make the program print "Sorry!" when that happens instead of crashing. There is no syntactic problem:
print(f(1,2))is always a perfectly syntactically correct bit of code, even though it results in a TypeError if it's called with
fhaving only one argument.
I think the move to say that it is the semantic value of the second sentence of (2) that depends on temperature, not its grammaticality, is plausible. But this move allows for a different way of attacking the distinction between syntax and semantics. Once we've admitted that the second sentence of (2) is always grammatical but sometimes has the undefined value, we can say that (1) is grammatically correct, but always has the semantic value of undefined, and the same is true for anything else that we didn't want to consider grammatically correct.
One might then try to recapture something like the syntax/semantics distinction by saying things like this: an item is syntactically incorrect in a given context provided that it's not a priori that its semantic value in that context is undefined. This would mean that (2) is syntactically correct, but the following is not:
- Let xyzzing be eating if Fermat's Last Theorem is false and let it be swimming otherwise. I am xyzzing a hamburger.
It may, however, be the case that even if there is no general distinction between syntax and semantics, in the case of particular languages or families of languages one can draw a line in the send for convenience of linguistic analysis. But nothing philosophically or semantically deep should rely on that line.