Changeset 11648 for lang/c

Show
Ignore:
Timestamp:
05/15/08 23:21:29 (6 months ago)
Author:
mokehehe
Message:

allow compound lambda' body

Location:
lang/c/misc/mlisp
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/c/misc/mlisp/core/c_compiler.cpp

    r11551 r11648  
    260260} 
    261261 
    262 SExp compile_block(SExp sexps, SExp e, SExp next) { 
    263         return nil; 
     262SExp compile_block(SExp sexps, SExp e, SExp s, SExp next) { 
     263        SExp d = cdr(sexps); 
     264        SExp nx = nilp(d) ? next : compile_block(d, e, s, next); 
     265        return compile(car(sexps), e, s, nx); 
    264266} 
    265267 
     
    283285                } else if (eq(op, intern("lambda"))) { 
    284286                        SExp vars = cadr(x); 
    285                         SExp body = caddr(x); 
     287                        SExp body = cddr(x); 
    286288                        SExp non_local = find_free(body, vars); 
    287289                        SExp free = filter_member(append2(car(e), cdr(e)), non_local); 
    288290                        SExp sets = find_sets(body, vars); 
    289291 
    290                         SExp boxes = make_boxes(sets, vars, compile(body, cons(vars, free), set_union(sets, set_intersect(s, free)), list(1, RETURN))); 
     292                        SExp boxes = make_boxes(sets, vars, compile_block(body, cons(vars, free), set_union(sets, set_intersect(s, free)), list(1, RETURN))); 
    291293                        return collect_free(free, e, list(4, CLOSE, int2s(length(free)), boxes, next)); 
    292294                } else if (eq(op, intern("if"))) { 
  • lang/c/misc/mlisp/readme.txt

    r11549 r11648  
    4444 
    4545* ToDo 
    46 -[v] �X�^�b�N�x�[�X�ɒu��������-[v] �C�ӌ‚̈��󂯎� 
     46-[v] �X�^�b�N�x�[�X�ɒu��������-[x] �C�ӌ‚̈��󂯎� 
    4747-[x] �}�N����� 
    4848--[x] macroexpand ��- C �������[�o���̊֐���яo�������ɂ���- �unil�v�ut�v���V���{���Ȃ̂ŁA�R���p�C�������V���{���Q�ƂɂȂ�Ă��܂� 
     
    6262 
    6363* �o�O 
    64  
    65  
     64- eval ����ƃX�^�b�N���󂳂��A�l�����������Ȃ� 
    6665 
    6766