Page 1 of 1
How to program in own Language using LISP
Posted: Tue Dec 02, 2014 3:18 am
by vignezds
Dear friends, again with new doubt, I supposed to do a program in other language(i.e not in English). How Can be it Created? How do I give meaning to keywords
? expecting your help asap
Re: How to program in own Language using LISP
Posted: Tue Dec 02, 2014 5:42 am
by pjstirling
I'm afraid that common-lisp is no more (or less) helpful for this than any of the more popular languages. In general, I think, people either create wrappers to rename functions to their primary language, or they use the English words as necessary and use their language for all other identifiers (variables or function)
Re: How to program in own Language using LISP
Posted: Wed Dec 03, 2014 9:59 pm
by edgar-rft
If you're using a
computer operating system and a
Common Lisp implementation that
both have proper
Unicode support, then you should not have to worry much about non-ASCII characters.
I live in Germany, where we use some non-ASCII characters called "umlauts". The weird characters with funny dots in the following example are German umlauts to demonstrate that
SBCL on
Debian Linux has no problems with this code:
Code: Select all
CL-USER> (defun äöü (ärg)
(format t "äöü: ~a~%" ärg)
ärg)
ÄÖÜ
CL-USER> (äöü 'ß)
äöü: ß
ß
But you must be aware that
2.1.3 Standard Characters says that only ASCII characters 10 and 32-126 need to be supported by all conforming Common Lisp implementations and it's left to the implementor to support more characters or not, what means that Unicode support in symbol names is optional and not guaranteed at all. There also still exist computer operating systems with no proper Unicode support.
The only other possibility is to parse user input containing non-ASCII characters as binary data and then decode the "meaning" of the data bytes yourself. But therefore you need detailed knowledge of all possible
character encodings of all computer systems you want to support, what is not a trivial task. Libraries like
Babel have tried to solve this, more libraries are listed in the CLiki section
internationalization, but I don't know how good or bad they work.