Skip to content

Commit

Permalink
version 0.52
Browse files Browse the repository at this point in the history
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.51-0.52.diff.gz

Fri Oct 14 13:22:18 1994  Yukihiro Matsumoto  (matz@ix-02)

	* version 0.52: ……なんてこったい.

	* eval.c(rb_call): returnの処理が間違っていたので, マシンによって
	  はreturnで関数を終了するだけでなくtoplevelまでつき抜けていた.

	* object.c: Builtinクラスを新設. 組み込み関数をKernelから移した.
	  nilが組み込み関数を理解するとトラブルの元である.

	* dbm.c: Dictと同様にeachが[key,value]を返すように.
  • Loading branch information
matz authored and k0kubun committed Aug 17, 2019
1 parent eed5c92 commit 173976c
Show file tree
Hide file tree
Showing 38 changed files with 163 additions and 112 deletions.
20 changes: 17 additions & 3 deletions ChangeLog
@@ -1,3 +1,17 @@
Fri Oct 14 13:22:18 1994 Yukihiro Matsumoto (matz@ix-02)

* version 0.52: �ġĤʤ�Ƥ��ä���.

* eval.c(rb_call): return�ν������ְ�äƤ����Τ�, �ޥ���ˤ�ä�
��return�Ǵؿ���λ��������Ǥʤ�toplevel�ޤǤĤ�ȴ���Ƥ���.

* object.c: Builtin���饹����. �Ȥ߹��ߴؿ���Kernel����ܤ���.
nil���Ȥ߹��ߴؿ������򤹤�ȥȥ�֥�θ��Ǥ���.

* dbm.c: Dict��Ʊ�ͤ�each��[key,value]���֤��褦��.

* version 0.51

Thu Oct 13 12:13:48 1994 Yukihiro Matsumoto (matz@ix-02)

* eval.c(SETUP_ARGS): �ղñ黻�Ҥ�����Ǥʤ����ˤ�������Ѵ�����.
Expand Down Expand Up @@ -26,9 +40,9 @@ Tue Oct 11 17:10:46 1994 Yukihiro Matsumoto (matz@ix-02)
* io.c(to_i): IO���饹�Υ��󥹥��󥹤��������Ѵ�����Ȥ��Υե�����
���һҤ��֤��褦��.

* numeric.c(num2int): to_i�᥽�åɤ�Ȥä�, �Ǥ���¤��������Ѵ���
��. ������num2fix���������ƤΥ��֥������Ȥ��Ф���to_i�᥽�åɤ�
Ŭ�Ѥ��Ƥ���.
* numeric.c(num2int): to_i�᥽�åɤ�ȤäƤǤ���¤��������Ѵ�����.
������num2fix���������ƤΥ��֥������Ȥ��Ф���to_i�᥽�åɤ�Ŭ�
��Ƥ���.

* sprintf.c(Fsprintf): ����ɽ���κ�, ���֥������Ȥ�Ǥ���¤�����
���Ѵ�����褦��(to_i�᥽�åɤ�Ȥ�).
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -142,7 +142,7 @@ install: $(bindir)/$(PROGRAM)
clean:; @rm -f $(OBJS)

realclean:; @rm -f $(OBJS)
@rm -f core ruby *~
@rm -f core ruby *~ config.status Makefile

dbm.o:dbm.c
$(CC) -c $(DBM) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I$(srcdir) -I$(srcdir)/lib dbm.c
Expand Down
1 change: 1 addition & 0 deletions ToDo
@@ -1,3 +1,4 @@
* tr����BSD�����ɤ������
* Ŭ�ڤ�signal handling
* dln��COFF�б�
* ruby����������ѿ�hook�μ¸�
Expand Down
2 changes: 1 addition & 1 deletion array.c
Expand Up @@ -3,7 +3,7 @@
array.c -
$Author: matz $
$Date: 1994/08/12 11:06:34 $
$Date: 1994/10/14 06:19:01 $
created at: Fri Aug 6 09:46:12 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion bignum.c
Expand Up @@ -3,7 +3,7 @@
bignum.c -
$Author: matz $
$Date: 1994/08/12 04:47:06 $
$Date: 1994/10/14 06:19:03 $
created at: Fri Jun 10 00:48:55 JST 1994
************************************************/
Expand Down
2 changes: 1 addition & 1 deletion class.c
Expand Up @@ -3,7 +3,7 @@
class.c -
$Author: matz $
$Date: 1994/08/12 11:06:35 $
$Date: 1994/10/14 06:19:04 $
created at: Tue Aug 10 15:05:44 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion compar.c
Expand Up @@ -3,7 +3,7 @@
compar.c -
$Author: matz $
$Date: 1994/08/12 04:47:09 $
$Date: 1994/10/14 06:19:05 $
created at: Thu Aug 26 14:39:48 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
8 changes: 4 additions & 4 deletions dbm.c
Expand Up @@ -3,7 +3,7 @@
dbm.c -
$Author: matz $
$Date: 1994/08/12 11:06:37 $
$Date: 1994/10/14 10:00:51 $
created at: Mon Jan 24 15:59:52 JST 1994
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -243,7 +243,7 @@ Fdbm_length(obj)
}

static VALUE
Fdbm_each(obj)
Fdbm_each_value(obj)
VALUE obj;
{
datum key, val;
Expand Down Expand Up @@ -396,8 +396,8 @@ Init_DBM()
rb_define_method(C_DBM, "indexes", Fdbm_indexes, -2);
rb_define_method(C_DBM, "length", Fdbm_length, 0);
rb_define_alias(C_DBM, "size", "length");
rb_define_method(C_DBM, "each", Fdbm_each, 0);
rb_define_method(C_DBM, "each_value", Fdbm_each, 0);
rb_define_method(C_DBM, "each", Fdbm_each_pair, 0);
rb_define_method(C_DBM, "each_value", Fdbm_each_value, 0);
rb_define_method(C_DBM, "each_key", Fdbm_each_key, 0);
rb_define_method(C_DBM, "each_pair", Fdbm_each_pair, 0);
rb_define_method(C_DBM, "keys", Fdbm_keys, 0);
Expand Down
8 changes: 4 additions & 4 deletions dict.c
Expand Up @@ -3,7 +3,7 @@
dict.c -
$Author: matz $
$Date: 1994/08/12 04:47:13 $
$Date: 1994/10/14 10:00:52 $
created at: Mon Nov 22 18:51:18 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -523,7 +523,7 @@ Fsetenv(obj, name, value)

Init_Dict()
{
extern VALUE C_Kernel;
extern VALUE C_Builtin;
extern VALUE M_Enumerable;
static VALUE envtbl;

Expand Down Expand Up @@ -578,6 +578,6 @@ Init_Dict()
envtbl = obj_alloc(C_EnvDict);
rb_define_variable("$ENV", &envtbl, Qnil, rb_readonly_hook);

rb_define_method(C_Kernel, "getenv", Fgetenv, 1);
rb_define_method(C_Kernel, "setenv", Fsetenv, 2);
rb_define_method(C_Builtin, "getenv", Fgetenv, 1);
rb_define_method(C_Builtin, "setenv", Fsetenv, 2);
}
2 changes: 1 addition & 1 deletion dir.c
Expand Up @@ -3,7 +3,7 @@
dir.c -
$Author: matz $
$Date: 1994/08/12 11:06:38 $
$Date: 1994/10/14 06:19:12 $
created at: Wed Jan 5 09:51:01 JST 1994
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion dln.c
Expand Up @@ -3,7 +3,7 @@
dln.c -
$Author: matz $
$Date: 1994/08/12 04:47:16 $
$Date: 1994/10/14 06:19:13 $
created at: Tue Jan 18 17:05:06 JST 1994
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
4 changes: 2 additions & 2 deletions env.h
Expand Up @@ -3,8 +3,8 @@
env.h -
$Author: matz $
$Revision: 1.3 $
$Date: 1994/08/12 11:06:39 $
$Revision: 1.4 $
$Date: 1994/10/14 06:19:14 $
created at: Mon Jul 11 11:53:03 JST 1994
************************************************/
Expand Down
2 changes: 1 addition & 1 deletion error.c
Expand Up @@ -3,7 +3,7 @@
error.c -
$Author: matz $
$Date: 1994/08/12 04:47:21 $
$Date: 1994/10/14 06:19:16 $
created at: Mon Aug 9 16:11:34 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion etc.c
Expand Up @@ -3,7 +3,7 @@
etc.c -
$Author: matz $
$Date: 1994/08/24 09:25:27 $
$Date: 1994/10/14 06:19:17 $
created at: Tue Mar 22 18:39:19 JST 1994
************************************************/
Expand Down
28 changes: 16 additions & 12 deletions eval.c
Expand Up @@ -3,7 +3,7 @@
eval.c -
$Author: matz $
$Date: 1994/08/24 09:25:28 $
$Date: 1994/10/14 10:00:53 $
created at: Thu Jun 10 14:22:17 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -1139,7 +1139,9 @@ rb_exit(status)
int status;
{
last_val = INT2FIX(status);
JUMP_TAG(TAG_EXIT);
if (prot_tag)
JUMP_TAG(TAG_EXIT);
exit(FIX2UINT(last_val));
}

VALUE
Expand Down Expand Up @@ -1519,7 +1521,6 @@ rb_call(class, recv, mid, argc, argv)
int argc;
ID mid;
{
int state, go_out;
NODE *body;
VALUE result;
VALUE saved_self = Qself;
Expand Down Expand Up @@ -1655,6 +1656,8 @@ rb_call(class, recv, mid, argc, argv)
}
}
else {
int state;

PUSH_ENV();

the_env->local_vars = Qnil;
Expand All @@ -1670,10 +1673,13 @@ rb_call(class, recv, mid, argc, argv)
#endif

PUSH_TAG();
switch (state = EXEC_TAG()) {
case 0:
state = EXEC_TAG();
if (state == 0) {
result = rb_eval(body);
go_out=0;
}
POP_TAG();
switch (state) {
case 0:
break;
case TAG_CONTINUE:
Fatal("unexpected continue");
Expand All @@ -1691,11 +1697,9 @@ rb_call(class, recv, mid, argc, argv)
result = last_val;
break;
default:
go_out=1;
JUMP_TAG(state);
}
POP_TAG();
POP_ENV();
if (go_out) JUMP_TAG(state);
}
Qself = saved_self;
the_env->iterator = saved_ilevel;
Expand Down Expand Up @@ -2004,7 +2008,7 @@ addpath(path)

Init_load()
{
extern VALUE C_Kernel;
extern VALUE C_Builtin;
extern VALUE rb_check_str();
char *path;

Expand All @@ -2015,6 +2019,6 @@ Init_load()
addpath(getenv("RUBYLIB"));
addpath(RUBY_LIB);

rb_define_method(C_Kernel, "load", Fload, 1);
rb_define_method(C_Kernel, "require", Frequire, 1);
rb_define_method(C_Builtin, "load", Fload, 1);
rb_define_method(C_Builtin, "require", Frequire, 1);
}
2 changes: 1 addition & 1 deletion file.c
Expand Up @@ -4,7 +4,7 @@
file.c -
$Author: matz $
$Date: 1994/08/18 07:06:21 $
$Date: 1994/10/14 06:19:20 $
created at: Mon Nov 15 12:24:34 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion gc.c
Expand Up @@ -3,7 +3,7 @@
gc.c -
$Author: matz $
$Date: 1994/08/12 04:47:27 $
$Date: 1994/10/14 06:19:22 $
created at: Tue Oct 5 09:44:46 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion inits.c
Expand Up @@ -3,7 +3,7 @@
inits.c -
$Author: matz $
$Date: 1994/08/19 09:32:02 $
$Date: 1994/10/14 06:19:24 $
created at: Tue Dec 28 16:01:58 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
26 changes: 13 additions & 13 deletions io.c
Expand Up @@ -3,7 +3,7 @@
io.c -
$Author: matz $
$Date: 1994/08/12 11:06:40 $
$Date: 1994/10/14 10:00:55 $
created at: Fri Oct 15 18:08:59 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down Expand Up @@ -1261,26 +1261,26 @@ VALUE rb_readonly_hook();

Init_IO()
{
extern VALUE C_Kernel;
extern VALUE C_Builtin;

id_write = rb_intern("write");
id_fd = rb_intern("fd");
id_print_on = rb_intern("print_on");

rb_define_method(C_Kernel, "syscall", Fsyscall, -1);
rb_define_method(C_Builtin, "syscall", Fsyscall, -1);

rb_define_method(C_Kernel, "open", Fopen, -2);
rb_define_method(C_Kernel, "printf", Fprintf, -1);
rb_define_method(C_Kernel, "print", Fprint, -1);
rb_define_method(C_Kernel, "gets", Fgets, 0);
rb_define_alias(C_Kernel,"readline", "gets");
rb_define_method(C_Kernel, "eof", Feof, 0);
rb_define_method(C_Kernel, "getc", Fgetc, 0);
rb_define_method(C_Kernel, "select", Fselect, -2);
rb_define_method(C_Builtin, "open", Fopen, -2);
rb_define_method(C_Builtin, "printf", Fprintf, -1);
rb_define_method(C_Builtin, "print", Fprint, -1);
rb_define_method(C_Builtin, "gets", Fgets, 0);
rb_define_alias(C_Builtin,"readline", "gets");
rb_define_method(C_Builtin, "eof", Feof, 0);
rb_define_method(C_Builtin, "getc", Fgetc, 0);
rb_define_method(C_Builtin, "select", Fselect, -2);

rb_define_method(C_Kernel, "readlines", Freadlines, 0);
rb_define_method(C_Builtin, "readlines", Freadlines, 0);

rb_define_method(C_Kernel, "print_on", Fprint_on, 1);
rb_define_method(C_Builtin, "print_on", Fprint_on, 1);

C_IO = rb_define_class("IO", C_Object);
rb_include_module(C_IO, M_Enumerable);
Expand Down
2 changes: 1 addition & 1 deletion math.c
Expand Up @@ -3,7 +3,7 @@
math.c -
$Author: matz $
$Date: 1994/08/12 04:47:35 $
$Date: 1994/10/14 06:19:27 $
created at: Tue Jan 25 14:12:56 JST 1994
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
19 changes: 19 additions & 0 deletions newver.rb
@@ -0,0 +1,19 @@
#! /usr/local/bin/ruby
f = open("version.h", "r")
f.gets()
f.close

if $_ =~ /"(\d+)\.(\d+)"/;
f = open("version.h", "w")
i = $2.to_i
if $ARGV[0] == "-f"
i += 1
end
date = Time.now.strftime("%d %b %y")
printf("ruby version %d.%0d (%s)\n", $1, i, date)
printf(f, "#define RUBY_VERSION \"%d.%0d\"\n", $1, i)
printf(f, "#define VERSION_DATE \"%s\"\n", date)
f.close
else
printf("match error - %s\n", $_)
end
2 changes: 1 addition & 1 deletion node.h
Expand Up @@ -3,7 +3,7 @@
node.h -
$Author: matz $
$Date: 1994/08/24 09:25:29 $
$Date: 1994/10/14 06:19:30 $
created at: Fri May 28 15:14:02 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down
2 changes: 1 addition & 1 deletion numeric.c
Expand Up @@ -3,7 +3,7 @@
numeric.c -
$Author: matz $
$Date: 1994/08/12 04:47:41 $
$Date: 1994/10/14 06:19:31 $
created at: Fri Aug 13 18:33:09 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
Expand Down

0 comments on commit 173976c

Please sign in to comment.