summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--eval.c2
-rw-r--r--numeric.c1
-rw-r--r--object.c16
4 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fe17e603e0..1633f6214c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jun 16 23:05:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * object.c (rb_mod_freeze): prepare string representation before
+ freezing. [ruby-talk:103646]
+
Wed Jun 16 16:04:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (rb_mod_le): singleton class inherits Class rather than its
diff --git a/eval.c b/eval.c
index e837a9be5f..42cef9df10 100644
--- a/eval.c
+++ b/eval.c
@@ -8031,8 +8031,6 @@ static int
block_orphan(data)
struct BLOCK *data;
{
- struct tag *tt;
-
if (data->scope->flags & SCOPE_NOSTACK) {
return 1;
}
diff --git a/numeric.c b/numeric.c
index 900054f83e..fc1e0d2e78 100644
--- a/numeric.c
+++ b/numeric.c
@@ -12,6 +12,7 @@
#include "ruby.h"
#include "env.h"
+#include <ctype.h>
#include <math.h>
#include <stdio.h>
diff --git a/object.c b/object.c
index dd6b1f3aea..b65259609c 100644
--- a/object.c
+++ b/object.c
@@ -1241,6 +1241,21 @@ rb_mod_to_s(klass)
/*
* call-seq:
+ * mod.freeze
+ *
+ * Prevents further modifications to <i>mod</i>.
+ */
+
+static VALUE
+rb_mod_freeze(mod)
+ VALUE mod;
+{
+ rb_mod_to_s(mod);
+ return rb_obj_freeze(mod);
+}
+
+/*
+ * call-seq:
* mod === obj => true or false
*
* Case Equality---Returns <code>true</code> if <i>anObject</i> is an
@@ -2570,6 +2585,7 @@ Init_Object()
rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0);
rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
+ rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);
rb_define_method(rb_cModule, "==", rb_obj_equal, 1);
rb_define_method(rb_cModule, "<=>", rb_mod_cmp, 1);