summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--eval.c4
-rw-r--r--struct.c2
-rw-r--r--variable.c8
4 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 547c29252a..af7085e3c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Sep 4 01:25:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_f_local_variables): list symbols.
+
+ * struct.c (rb_struct_s_members_m): ditto.
+
+ * variable.c (ivar_i): ditto.
+
+ * variable.c (gvar_i): ditto.
+
+ * variable.c (cv_i): ditto.
+
Sun Sep 3 20:47:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.h (SYMBOL_P): Qnil and Qfalse are not Symbol.
diff --git a/eval.c b/eval.c
index 6f41e28c71..66347120c1 100644
--- a/eval.c
+++ b/eval.c
@@ -7602,14 +7602,14 @@ rb_f_local_variables(void)
n = *tbl++;
for (i=2; i<n; i++) { /* skip first 2 ($_ and $~) */
if (!rb_is_local_id(tbl[i])) continue; /* skip flip states */
- rb_ary_push(ary, rb_str_new2(rb_id2name(tbl[i])));
+ rb_ary_push(ary, ID2SYM(tbl[i]));
}
}
vars = ruby_dyna_vars;
while (vars) {
if (vars->id && rb_is_local_id(vars->id)) { /* skip $_, $~ and flip states */
- rb_ary_push(ary, rb_str_new2(rb_id2name(vars->id)));
+ rb_ary_push(ary, ID2SYM(vars->id));
}
vars = vars->next;
}
diff --git a/struct.c b/struct.c
index cc09b093e8..778a0d7a6b 100644
--- a/struct.c
+++ b/struct.c
@@ -64,7 +64,7 @@ rb_struct_s_members_m(VALUE klass)
ary = rb_ary_new2(RARRAY_LEN(members));
p = RARRAY_PTR(members); pend = p + RARRAY_LEN(members);
while (p < pend) {
- rb_ary_push(ary, rb_str_new2(rb_id2name(SYM2ID(*p))));
+ rb_ary_push(ary, *p);
p++;
}
diff --git a/variable.c b/variable.c
index 47ef4dd54a..11a3017339 100644
--- a/variable.c
+++ b/variable.c
@@ -693,7 +693,7 @@ rb_gvar_defined(struct global_entry *entry)
static int
gvar_i(ID key, struct global_entry *entry, VALUE ary)
{
- rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
+ rb_ary_push(ary, ID2SYM(key));
return ST_CONTINUE;
}
@@ -988,7 +988,7 @@ static int
ivar_i(ID key, struct global_entry *entry, VALUE ary)
{
if (rb_is_instance_id(key)) {
- rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
+ rb_ary_push(ary, ID2SYM(key));
}
return ST_CONTINUE;
}
@@ -1418,7 +1418,7 @@ rb_mod_const_of(VALUE mod, void *data)
static int
list_i(ID key, ID value, VALUE ary)
{
- rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
+ rb_ary_push(ary, ID2SYM(key));
return ST_CONTINUE;
}
@@ -1633,7 +1633,7 @@ static int
cv_i(ID key, VALUE value, VALUE ary)
{
if (rb_is_class_id(key)) {
- VALUE kval = rb_str_new2(rb_id2name(key));
+ VALUE kval = ID2SYM(key);
if (!rb_ary_includes(ary, kval)) {
rb_ary_push(ary, kval);
}