Hi David,
Yes, I think that the xTalk-family provides us with the most English-
like programming languages. Anything more sophisticated is doable,
but also a lot of work. As an example, here is a script which
responds to polite requests to create an object. Don't take this
example too seriously, please.
on mouseUp
doPhrase "Would you be so kind to create a field?"
put the result into rslt
if rslt is not empty then
beep
answer rslt
end if
end mouseUp
on doPhrase theRequest
put "(^[Pp]lease*|^[Cc]ould you please*|^[Ww]ould you" && ¬
"be so kind to*)" into myPattern
if matchText(theRequest,myPattern,myFormality) is false then
return "Sorry, didn't hear ya!"
else
if last char of theRequest is among the chars of "?!"
then delete last char of theRequest
put word (number of words of myFormality + 1) to -1 of ¬
theRequest into theRequest
switch (word 1 of theRequest)
case "create"
repeat for each word myWord in theRequest)
if myWord is not "a" then put myWord & space after ¬
myNewRequest
end repeat
put myNewRequest
try
do myNewRequest
catch myError
return "Sorry, I could not" && theRequest
end try
break
-- more "cases"
default
return "Sorry, I could not" && theRequest
end switch
end if
end doPhrase
Best regards,
Mark
--
Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Download ErrorLib at http://economy-x-talk.com/developers.html and
get full control of error handling in Revolution.
Op 11-aug-2006, om 0:13 heeft David Bovill het volgende geschreven:
By the way is Transcript still the official term for Revs programming
language?
Spent an hour looking for links references and articles on English-
like
programming languages - looking at the syntax. Found no good links
yet. Lots
of stuff about COBOL, things about how it was the flavour of the
month in
the 80's - how good perl is. Here is a nice quote from
http://www.whynot.net/ideas/1441:
By this, I mean the source file would be something like a text
file..
and the interpreter would interpret the english language commands
and build
a program based on it. The commands for the English Programming
Language
could be something like this (consider this a raw source file):
<begin source>
First, create a window approximately 75% of the screen size.
Then, add
two menus to the top, one File and one Help. Under the File menu,
add Exit.
When a user clicks on Exit, the program should exit. Under the
help menu,
add a simple About option that describes this program.
Now create two buttons in the main window (the first one). The
first
button should say "Message", and the second one should say
"Exit" (without
the quotes). When a user clicks on Message, a message box should
pop up
saying "Hello, World!". When the user clicks on the Exit button,
the program
should exit.
<end source>
Now that would be more English-like than Transcript, but to date i
cannot
find anything much more English-like than the syntax of Transcript.
There is
some AI stuff like -
http://www.softwaretheories.com/Examples/index.html(not a good link) -
and Ruslan you there - some older links I had for
parsers that took XML - there is an MIT project to create a meta
language...
but no good links I can find - and certainly nothing solid and
useable.
So the question is this - is Transcipt the best real programming
language
out there in terms of it's English-likeness! That is the ease in
which a
non-programmer, or non-speaker of the computer language can
understand it?
Help, links, rants and gossip appreciated!
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution