This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
This is an appendix to part 3, which also has the license information.
There are two things that a listener needs to track, the stack and the syntactic meanings/effects of their vocabulary. A syntactic effect has stack effect phrase-so-far >> altered-phrase
, and this stack effect occurs while the word is still parsing. In unquoted speech, a listener applies the syntactic effect of each word to an empty quote, then immediately evokes it. Or at least that's one way to look at it.
Before continuing, note that the effect of adding an item like 2
to the stack is [ 2 ]
; since quotes represent an effect of adding a quote to the stack, this is the sort of effect they represent.
Getting into how quote words work, [
adds an empty quote [ ]
to the stack and applies each subsequent word's syntactic effect. Note that this effect can continue forever since it takes priority over the normal sentence parsing. To stop it, ]
's syntactic effect is to end what [
is doing and append the effect of pushing the finished quote to whatever parent phrase it's in. In terms of usage, [
essentially adds a layer of quotation to parsing, and ]
removes it, putting the result where it should go.
This might seem a bit fancy, but it's the technical reason that lets us put quotes inside quotes. Fortunately, it's intuitive enough that the steps aren't necessary to know. As an example, [ 1 [ 2 ] 3 ]
has each word parse as follows:
[ ( [ ] [ ] ) pushes [ ] to the stack.
1 ( [ ] [ 1 ] ) appends [ 1 ] after the current phrase [ ] .
[ ( [ ] [ 1 ] [ ] ) pushes another [ ] .
2 ( [ ] [ 1 ] [ 2 ] ) appends [ 2 ] .
] ( [ ] [ 1 [ 2 ] ] ) appends [ [ 2 ] ] (the subquote quoted) to the quote above it and ends the inner quote.
3 ( [ ] [ 1 [ 2 ] 3 ] ) appends [ 3 ] .
] ( [ [ 1 [ 2 ] 3 ] ] ) appends that whole quote quoted to the main quote, ending the first quote.
and so [ [ 1 [ 2 ] 3 ] ]
is the effect that [ 1 [ 2 ] 3 ]
represents, i.e. the phrase represents the effect of pushing the concept we expect it to and everything is sound.
It rarely becomes necessary to get this involved in the semantics, but it's relevant in programming a stack language that works like this. Hence, this is an appendix. If nothing else, this should provide some insight into how complex languages really are under the hood.
Subreddit
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/minlangs/co...