[Uim] list vs ' in uim-scheme
TOKUNAGA Hiroyuki
tkng at xem.jp
Tue Jun 15 07:27:38 EEST 2004
On Mon, 14 Jun 2004 01:21:25 -0500
Hiroyuki Komatsu <komatsu at taiyaki.org> wrote:
> What is a difference between list and ' in uim-scheme?
>
>
> The following code with list works well in uim-scheme.
>
> (set! command-list (list function1 function2 function3))
> (let ((command (nth 0 command-list)))
> (command 1 2 3))
>
> However, the next code with ' does not work.
>
> (set! command-list '(function1 function2 function3))
> (let ((command (nth 0 command-list)))
> (command 1 2 3))
>
>
> Is it a feature? If so, please let me know the difference.
> Thank you,
' is abbreviation of quote, not list. list make new list(This is a
structure of data, not the name of procedure), and arguments of list
will be evaluated when list called. ' means quote, quote doesn't
evaluate it's arguments at all.
For example,
(define c (list a b))
doesn't work, but
(define d '(a b))
works. (I'm assuming that you don't define a and b)
I don't know much about scheme, so that's all I can write. I hope that
will help you.
--
TOKUNAGA Hiroyuki
http://kodou.net/
More information about the uim
mailing list