How to program in own Language using LISP

Discussion of Common Lisp
Post Reply
vignezds
Posts: 7
Joined: Tue Nov 18, 2014 4:26 am

How to program in own Language using LISP

Post by vignezds » Tue Dec 02, 2014 3:18 am

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

pjstirling
Posts: 166
Joined: Sun Nov 28, 2010 4:21 pm

Re: How to program in own Language using LISP

Post by pjstirling » Tue Dec 02, 2014 5:42 am

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)

edgar-rft
Posts: 226
Joined: Fri Aug 06, 2010 6:34 am
Location: Germany

Re: How to program in own Language using LISP

Post by edgar-rft » Wed Dec 03, 2014 9:59 pm

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.

Post Reply