Re: Any Chinese Lispers here?



Lei Tang <L.Tang@xxxxxxx> writes:
Pascal Bourguignon wrote:
"Pebblestone" <hadeshuang@xxxxxxxxx> writes:

Le'ts keep contact! Lisp is an awesome language!

send me email!
hadeshuang@xxxxxxxxx
Hello! Even if we're not chinese, we can keep contact all the same.
Just don't use too many chinese symbols in your sources :-)
[126]> (defun 因子 (x) (if (< x 1) 1 (* x (因子 (1- x)))))
因子
[127]> (因子 12)
479001600
[128]> (lisp-implementation-type)
"CLISP"

Oh, this is way too cool. I didn't expect CLISP can handle Chinese
directly. But the problem is emacs/xemacs and slime might not be good
at handling Chinese.


Works from slime too:


; SLIME 2006-02-10
CL-USER> (defun 阶乘 (x) (if (< x 1) 1 (* x (阶乘- x))))
阶乘
CL-USER> (阶乘 12)
; Evaluation aborted
CL-USER> (defun 阶乘 (x) (if (< x 1) 1 (* x (阶乘 (1- x)))))
阶乘
CL-USER> (阶乘 12)
479001600
CL-USER>

And also from a lisp buffer, if I type:
(defun 阶乘 (x) (if (< x 1) 1 (* x (阶乘 (1- x))))) C-x C-e
(阶乘 13) C-x C-e

I get the result:

6227020800

and in *slime-repl*:

;;;; (defun 阶乘 (x) (if (< x 1) 1 (* x (阶乘 (1- x))))) ...
;;;; (阶乘 13) ...
CL-USER>


If I right-click on the function name and select inspect, I get a buffer with:

A symbol.
[type: SYMBOL]
--------------------
Its name is: "阶乘"
It is unbound.
It is a function: #<FUNCTION 阶乘 (X) (DECLARE (SYSTEM::IN-DEFUN 阶乘)) (BLOCK 阶乘 (IF (< X 1) 1 (* X (阶乘 (1- X)))))> [make funbound]
It is internal to the package: COMMON-LISP-USER [export it] [unintern it]
Property list: (SYSTEM::DEFINITION ((DEFUN 阶乘 (X) (IF (< X 1) 1 (* X (阶乘 (1- X))))) . #(NIL NIL NIL NIL ((DECLARATION XLIB::CLX-VALUES VALUES OPTIMIZE DECLARATION)))))

etc...


I'd be hard pressed to cite the minimal configuration settings needed
to make it work (I don't use slime often enough to know it that well),
but you can download my ~/.emacs from cvs at:

cvs -z3 -d :pserver:anonymous@xxxxxxxxxxxxxxxxxxxxx:/usr/local/cvs/public/chrooted-cvs/cvs co home

and what I've cited in another message in this thread may be all there
is to it. You can also check M-x apropos RET slime.*coding RET or
read the manual of slime.

--
__Pascal Bourguignon__
.