🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.os.linux
Article #9902

Re: Scheme �����еĶ��� "," �������Ϸ��",@"��ʲô�ã�

#9902
From: �����
Date: Thu, 18 Sep 2003 10:57
50 lines
3451 bytes
ժ��"The Emacs Lisp Reference Manual"������֪����ͬ�� lisp �����Ƿ�ͬ��

��,�� ���� macro ���Ԫ���DZ�������ֵ��

      `(a list of (+ 2 3) elements)
           => (a list of (+ 2 3) elements)
    
      `(a list of ,(+ 2 3) elements)
           => (a list of 5 elements)

��,@�� ��� list ���ӡ�

       (setq some-list '(2 3))
            => (2 3)
       (cons 1 (append some-list '(4) some-list))
            => (1 2 3 4 2 3)
       `(1 ,@some-list 4 ,@some-list)
            => (1 2 3 4 2 3)
       
       (setq list '(hack foo bar))
            => (hack foo bar)
       (cons 'use
         (cons 'the
           (cons 'words (append (cdr list) '(as elements)))))
            => (use the words foo bar as elements)
       `(use the words ,@(cdr list) as elements)
            => (use the words foo bar as elements)
  

> ����ѧϰ��ѧУ��ͼ�������һ�������˹����ܳ�����Ƶ��飬���й��ں��
> ����Ƶ�һ�ھ�������ķ�ţ����ǰ����鷭��N�飬Ҳû�з����н���������
> ���������ݡ�  ���ǰ�common lisp �е�dotimes ����scheme ���ú��ʾ������
> (macro dotimes
> 	(lambda (x)
> 		(set! x (cdr x))
> 		(let ((var (caar x)) (proc (gensym "%0000')))
> 	   '(begin ((named-lambda (,proc ,var)
> 		  (when (<? ,var ,(cadar x))
> 			,@(cdr x)
> 			(,proc (1+ ,var))))
> 			0)
> 			,(caddar x)))))
> �ⲻ����emacs �������ò��ÿ���
> ����88���������е����ݣ�macroר�����Ѿ����define-macro , named-lambdaҲ
> û�ˣ� ��֪�����ʲô�ˣ�

-- 
 ~~һ�쵽��~�����~~
   <dddkk@sina.com>
Technical Details
Message-ID: <m2y8wmfjny.fsf@db.cs.hit.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.cn99.com!news.yaako.com!not-for-mail
References: <pan.2003.09.18.10.38.30.8499@163.com>

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 10b277,9343c21d86ca43b3
X-Google-Attributes: gid10b277,public
X-Google-ArrivalTime: 2003-09-18 03:57:45 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.cn99.com!news.yaako.com!not-for-mail
From: "�����" <dddkk@sina.com>
Newsgroups: cn.comp.os.linux
Subject: Re: Scheme �����еĶ��� "," �������Ϸ��",@"��ʲô�ã�
Date: Thu, 18 Sep 2003 18:57:53 +0800
Organization: Bentium Ltd. (CN99)
Lines: 50
Message-ID: <m2y8wmfjny.fsf@db.cs.hit.edu.cn>
References: <pan.2003.09.18.10.38.30.8499@163.com>
NNTP-Posting-Host: 61.167.60.204
Mime-Version: 1.0
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit
X-Trace: news.yaako.com 1063882609 19293 61.167.60.204 (18 Sep 2003 10:56:49 GMT)
X-Complaints-To: usenet@news.yaako.com
NNTP-Posting-Date: Thu, 18 Sep 2003 10:56:49 +0000 (UTC)
X-Face: $,MrC{".#Of"+5o4f&"Y%BEXbu::2[3u0PK.G\]'&Irj>a%BRPq%aA"6f<Ywarj_/A
 R5<o9'<!"9.\ZqzkDv-OK0&Vx&D(0'5O(jx,]LgQk/J@P<F$X\br>y"[Eo8lEBloB*tfsz~]\
 Ll\}&C{}ar^R\Ic9shnEW?'8o-9%MQ03+izFFbQV&CUKVd>%V1sog)m1$L=Z(K!I5ID8nucdF
 }Bb(/r>b]7*t@GP%=VS_~:&~:F$?7,i1Wqj\C(q)|@71421c2ynlCQ<u%"'6|28Oww":7N6=F
 s/?mUj&_^u&\^yrrY{O
User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)
Cancel-Lock: sha1:i0x1KFpdtr7l55qNNbC/DDfep1s=