[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statements as zero-value forms (expressions vs. statements)

[Mmm, connections between natural and programming languages -- a
favorite topic of mine!  Please let me know if this discussion is
considered off-topic...]

On 2001-12-27T17:29:57-0000, Oliver Steele wrote:
> There's an analogy here, to sentences and phrases in natural language.  Paul
> Graham suggested here that functions were verbs, because they take
> arguments.  Actually both functions and nouns take arguments, and both can
> be saturated to produce phrases, which act as the arguments to embedding
> phrases, and so forth up to the maximally spanning phrase, which is the
> sentence.  Phrases are (arguably) referential: like expressions, they
> produce or name values.  Sentences, on the other hand, are sequenced, not
> (in general) composed.  And modern treatments of sentence semantics, such as
> Discourse Representation Theory and Dynamic Binding, take the meanings of
> sentences to be update functions on the discourse state, just like
> statements.

I'm not quite sure what you mean here.  You mention several potential
distinctions between sentences (clauses) and (noun) phrases in natural

        sentences               phrases
        ---------               -------
    (1) have side effects       have no side effects
    (2) do not produce values   produce values (are referential)
    (3) are sequenced           are composed

Regarding (1), it's not clear that phrases have no side effects.  For
example, in "a boy saw his mother", the phrase "a boy" modifies the
global state (in the Discourse Representation Theory and Dynamic
Binding sense) so that "his mother" can refer to him.  We can draw a
rough analogy between evaluation order in programming languages and
binding in natural languages: In "his mother saw a boy", it is much
more difficult for "his" and "a boy" to refer to the same person.

Regarding (2), perhaps adverbial phrases can be considered phrases
that do not produce values?  In "a boy saw his mother yesterday", the
phrase "yesterday" doesn't seem to produce a value that "see" takes as
argument, but causes a shift in tense.

Regarding (3), can I think of sequencing as a special kind of

If so, perhaps natural languages are -- in these senses -- imperative?

Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"Give me love, give me life, give me peace on earth..."  --George Harrison

Attachment: pgp19002.pgp
Description: PGP signature