Programming in other human languages
As the syntax of a Motto program is dictated by the programmer himself, it is easy to transform it to support languages other than English. The following example re-defines some built-in Motto procedures in Greek and use them to write a simple program.
First we need the Greek versions of def, eq and display:
> (cdef 'ορίζουν (lambda (self)
(list (c-push (get-symbol (compiler-input self)))
(c-def))))
> [eq] ορίζουν ίση
> [display] ορίζουν οθόνηNext we define a new procedure that will say a greeting based on an English input. If the input is “hi” it will print the Greek equivalent of “hello”, otherwise it will print the Greek equivalent of “bye”:
> [hi ίση ? γειά-σου αντίο .s .c] ορίζουν χαιρετώ > hi χαιρετώ γειά-σου > see-you χαιρετώ αντίο
I don’t know Greek. So I used on Google for translation. If you know Greek and find some problem with the translation used here, please let me know.