ruby/id.c
usa f8665e42f0 merge revision(s) 40525,40526,40528,40530: [Backport #8345]
proc.c: remove unnecessary static function

	* proc.c (proc_lambda): remove and use rb_block_lambda directly
  instead.
	* include/ruby/intern.h (rb_block_lambda): add declaration instead of
	  deprecated rb_f_lambda.

	* proc.c (mproc, mlambda): use frozen core methods instead of plain
	  global methods, so that methods cannot be overridden.
	  [ruby-core:54687] [Bug #8345]

	* vm.c (Init_VM): define proc and lambda on the frozen core object.

	* defs/id.def (predefined): add "idProc".

	* proc.c (mnew, mproc, mlambda): use predefined IDs.

	* vm.c (Init_VM): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26 07:51:04 +00:00

52 lines
1.7 KiB
C

/**********************************************************************
id.c -
$Author$
created at: Thu Jul 12 04:37:51 2007
Copyright (C) 2004-2007 Koichi Sasada
**********************************************************************/
#include "ruby/ruby.h"
#include "id.h"
static void
Init_id(void)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
rb_encoding *enc = rb_usascii_encoding();
REGISTER_SYMID(idNULL, "");
REGISTER_SYMID(idIFUNC, "<IFUNC>");
REGISTER_SYMID(idCFUNC, "<CFUNC>");
REGISTER_SYMID(idRespond_to, "respond_to?");
REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
REGISTER_SYMID(id_core_undef_method, "core#undef_method");
REGISTER_SYMID(id_core_define_method, "core#define_method");
REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
REGISTER_SYMID(idEach, "each");
REGISTER_SYMID(idLength, "length");
REGISTER_SYMID(idSize, "size");
REGISTER_SYMID(idProc, "proc");
REGISTER_SYMID(idLambda, "lambda");
REGISTER_SYMID(idIntern, "intern");
REGISTER_SYMID(idGets, "gets");
REGISTER_SYMID(idSucc, "succ");
REGISTER_SYMID(idMethodMissing, "method_missing");
#if SUPPORT_JOKE
REGISTER_SYMID(idBitblt, "bitblt");
REGISTER_SYMID(idAnswer, "the_answer_to_life_the_universe_and_everything");
#endif
REGISTER_SYMID(idSend, "send");
REGISTER_SYMID(id__send__, "__send__");
REGISTER_SYMID(idInitialize, "initialize");
REGISTER_SYMID(idUScore, "_");
}