mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
05da25f297
commit
d7b1e063ff
6 changed files with 45 additions and 11 deletions
|
|
@ -1,3 +1,8 @@
|
|||
Tue Jun 30 01:05:20 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* eval.c (BEGIN_CALLARGS): adjust the_block before evaluating the
|
||||
receiver's value and the arguments.
|
||||
|
||||
Fri Jun 26 18:02:50 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||
|
||||
* experimental release 1.1b9_28.
|
||||
|
|
|
|||
1
ToDo
1
ToDo
|
|
@ -1,3 +1,4 @@
|
|||
* remove Enumerable#reverse at 1.2
|
||||
* non-blocking open/write for thread
|
||||
* package or access control for global variables
|
||||
* format
|
||||
|
|
|
|||
33
eval.c
33
eval.c
|
|
@ -401,7 +401,7 @@ struct BLOCK {
|
|||
#endif
|
||||
struct BLOCK *prev;
|
||||
};
|
||||
static struct BLOCK *the_block;
|
||||
static struct BLOCK *the_block;
|
||||
|
||||
#define PUSH_BLOCK(v,b) { \
|
||||
struct BLOCK _block; \
|
||||
|
|
@ -1312,6 +1312,18 @@ mod_alias_method(mod, newname, oldname)
|
|||
}\
|
||||
}
|
||||
|
||||
#define BEGIN_CALLARGS {\
|
||||
struct BLOCK *tmp_block = the_block;\
|
||||
if (the_iter->iter == ITER_PRE) {\
|
||||
the_block = the_block->prev;\
|
||||
}\
|
||||
PUSH_ITER(ITER_NOT);
|
||||
|
||||
#define END_CALLARGS \
|
||||
the_block = tmp_block;\
|
||||
POP_ITER();\
|
||||
}
|
||||
|
||||
#define MATCH_DATA the_scope->local_vars[node->nd_cnt]
|
||||
|
||||
static char* is_defined _((VALUE, NODE*, char*));
|
||||
|
|
@ -1961,10 +1973,11 @@ rb_eval(self, node)
|
|||
int argc; VALUE *argv; /* used in SETUP_ARGS */
|
||||
TMP_PROTECT;
|
||||
|
||||
PUSH_ITER(ITER_NOT);
|
||||
BEGIN_CALLARGS;
|
||||
recv = rb_eval(self, node->nd_recv);
|
||||
SETUP_ARGS(node->nd_args);
|
||||
POP_ITER();
|
||||
END_CALLARGS;
|
||||
|
||||
result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0);
|
||||
}
|
||||
break;
|
||||
|
|
@ -1974,9 +1987,10 @@ rb_eval(self, node)
|
|||
int argc; VALUE *argv; /* used in SETUP_ARGS */
|
||||
TMP_PROTECT;
|
||||
|
||||
PUSH_ITER(ITER_NOT);
|
||||
BEGIN_CALLARGS;
|
||||
SETUP_ARGS(node->nd_args);
|
||||
POP_ITER();
|
||||
END_CALLARGS;
|
||||
|
||||
result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1);
|
||||
}
|
||||
break;
|
||||
|
|
@ -2000,9 +2014,9 @@ rb_eval(self, node)
|
|||
argv = the_frame->argv;
|
||||
}
|
||||
else {
|
||||
PUSH_ITER(ITER_NOT);
|
||||
BEGIN_CALLARGS;
|
||||
SETUP_ARGS(node->nd_args);
|
||||
POP_ITER();
|
||||
END_CALLARGS;
|
||||
}
|
||||
|
||||
PUSH_ITER(the_iter->iter?ITER_PRE:ITER_NOT);
|
||||
|
|
@ -3072,9 +3086,10 @@ handle_rescue(self, node)
|
|||
return obj_is_kind_of(errinfo, eStandardError);
|
||||
}
|
||||
|
||||
PUSH_ITER(ITER_NOT);
|
||||
BEGIN_CALLARGS;
|
||||
SETUP_ARGS(node->nd_args);
|
||||
POP_ITER();
|
||||
END_CALLARGS;
|
||||
|
||||
while (argc--) {
|
||||
if (!obj_is_kind_of(argv[0], cModule)) {
|
||||
TypeError("class or module required for rescue clause");
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
gtk.o: gtk.c $(hdrdir)/ruby.h $(hdrdir)/config.h $(hdrdir)/defines.h \
|
||||
$(hdrdir)/intern.h $(hdrdir)/sig.h
|
||||
$(hdrdir)/intern.h $(hdrdir)/rubysig.h
|
||||
|
|
|
|||
|
|
@ -5779,7 +5779,7 @@ idle()
|
|||
{
|
||||
CHECK_INTS;
|
||||
#ifdef THREAD
|
||||
if (!thred_critical) thred_schedule();
|
||||
if (!thread_critical) thread_schedule();
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -453,6 +453,19 @@ end
|
|||
ok($x.size == 10)
|
||||
ok($x == [1, 2, 3, 1, 2, 3, 4, 5, 6, 7])
|
||||
|
||||
# append method to built-in class
|
||||
class Array
|
||||
def iter_test1
|
||||
collect{|e| [e, yield(e)]}.sort{|a,b|a[1]<=>b[1]}
|
||||
end
|
||||
def iter_test2
|
||||
a = collect{|e| [e, yield(e)]}
|
||||
a.sort{|a,b|a[1]<=>b[1]}
|
||||
end
|
||||
end
|
||||
$x = [[1,2],[3,4],[5,6]]
|
||||
ok($x.iter_test1{|x|x} == $x.iter_test2{|x|x})
|
||||
|
||||
check "bignum"
|
||||
def fact(n)
|
||||
return 1 if n == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue