English-like Python

Aaron Brady castironpi at gmail.com
Thu Jan 22 03:19:35 EST 2009


On Jan 22, 1:46 am, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Wed, 21 Jan 2009 00:57:49 -0800, Aaron Brady wrote:
> > Natural language doesn't have the equivalent of parentheses,
>
> I take it you mean natural language doesn't have the equivalent of
> parentheses for *calling*, since NLs can (and do) use parentheses for
> grouping -- as well as various conventions regarding dashes -- terms
> together.

I take it back.  I meant spoken languages.

> I'm not aware of any NL that uses some sort of calling convention, but it
> isn't impossible. Most sentences have an object, a subject and a verb,
> just like OO method calls. So logically:
>
> "Peter ate the sandwich"
>
> is equivalent to:
>
> Peter.eat(sandwich)
>
> modulo complications due to tenses and similar.

I don't think it's as common as you imply to give a sequence of
instructions in spoken language.  It's more often rule-based, such as
'when X, Y' (the German for 'if' is 'wenn'), and 'Employees will X',
as well as 'X was wearing', and 'X is doing'.  'John is dating Mary'
is informational, whereas 'John.date( Mary )' is a step in a
procedure.  How-to knowledge is often (I guess predominantly) tacit,
relying on agents to determine a missing step in a process, or fill in
from context.  In fact, knowledge-based might be a better description
of most NL aims (many times with implied ordering).  That is, mostly,
I want to alter your beliefs (OT: too often to create fear), not your
know-how specifically.  When you do see imperatives, they're just
function calls, not walkthroughs.  Programming is more resemblant to
math structure building.  You'll notice that a PL translation of a
narrative don't look anything like code ('Banquo.take( dagger )'), and
declarative knowledge is best (I advance) expressed in a relational
language, like SQL.  Further, when you have to be precise, PLs
(programming languages) are the language to do it in.



More information about the Python-list mailing list