Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 144 lines (127 sloc) 5.077 kB
9c1d230 committing experimental branch content
Laurent Sansonetti authored
1 /**********************************************************************
2
3 id.c -
4
5 $Author: ko1 $
6 created at: Thu Jul 12 04:37:51 2007
7
8 Copyright (C) 2004-2007 Koichi Sasada
9
10 **********************************************************************/
11
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
12 #include "macruby_internal.h"
301b43b ported to rb_objc_block_call() + misc cleanup
Laurent Sansonetti authored
13 #include "ruby/node.h"
cb65416 the great schism, part I
Laurent Sansonetti authored
14 #include "vm.h"
9c1d230 committing experimental branch content
Laurent Sansonetti authored
15
16 #define extern
17 #include "id.h"
18 #undef extern
19
20 void
21 Init_id(void)
22 {
23 /* Symbols */
24 symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
25 symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
26
27 /* IDs */
28 idPLUS = rb_intern("+");
29 idMINUS = rb_intern("-");
30 idMULT = rb_intern("*");
31 idDIV = rb_intern("/");
32 idMOD = rb_intern("%");
33 idLT = rb_intern("<");
34 idLTLT = rb_intern("<<");
35 idLE = rb_intern("<=");
36 idGT = rb_intern(">");
37 idGE = rb_intern(">=");
38 idEq = rb_intern("==");
39 idEqq = rb_intern("===");
40 idBackquote = rb_intern("`");
41 idEqTilde = rb_intern("=~");
42 idNot = rb_intern("!");
43 idNeq = rb_intern("!=");
44
45 #if WITH_OBJC
46 selPLUS = sel_registerName("+:");
47 selMINUS = sel_registerName("-:");
48 selMULT = sel_registerName("*:");
49 selDIV = sel_registerName("/:");
50 selMOD = sel_registerName("%:");
e59fe57 fixed String#sum to accept bits argument greater than 64 (logic impor…
Laurent Sansonetti authored
51 selAND = sel_registerName("&:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
52 selEq = sel_registerName("==:");
53 selNeq = sel_registerName("!=:");
35d9f66 optimized rb_num_coerce_bin() calls + optimized complex.c to use the …
Laurent Sansonetti authored
54 selCmp = sel_registerName("<=>:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
55 selLT = sel_registerName("<:");
56 selLE = sel_registerName("<=:");
57 selGT = sel_registerName(">:");
58 selGE = sel_registerName(">=:");
59 selLTLT = sel_registerName("<<:");
60 selAREF = sel_registerName("[]:");
61 selASET = sel_registerName("[]=:");
62 selLength = sel_registerName("length");
63 selSucc = sel_registerName("succ");
64 selNot = sel_registerName("!");
19f18d3 a new Symbol class, unicode-aware + refactored/cleaned symbol generation
Laurent Sansonetti authored
65 selNot2 = sel_registerName("!:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
66 selAlloc = sel_registerName("alloc");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored
67 selAllocWithZone = sel_registerName("allocWithZone:");
06f4a0c create -copyWithZone: on every new Object-based Ruby class
Laurent Sansonetti authored
68 selCopyWithZone = sel_registerName("copyWithZone:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
69 selInit = sel_registerName("init");
70 selInitialize = sel_registerName("initialize");
71 selInitialize2 = sel_registerName("initialize:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
72 selInitializeCopy = sel_registerName("initialize_copy:");
a3ff57f overwrite -[NSObject description] in every new subclass + optimized o…
Laurent Sansonetti authored
73 selDescription = sel_registerName("description");
74 selInspect = sel_registerName("inspect");
792d1ad implemented Method#to_proc, fixed Hash.new{}
Laurent Sansonetti authored
75 selNew = sel_registerName("new");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
76 selRespondTo = sel_registerName("respond_to?:");
77 selMethodMissing = sel_registerName("method_missing:");
927e7ec call const_missing with a direct VM call
Laurent Sansonetti authored
78 selConstMissing = sel_registerName("const_missing:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
79 selCopy = sel_registerName("copy");
28f110b removed the previous bytestring code and now use the new one
Laurent Sansonetti authored
80 selMutableCopy = sel_registerName("mutableCopy");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
81 sel_zone = sel_registerName("zone");
82 selToS = sel_registerName("to_s");
3d5760c more small Array optimizations
Laurent Sansonetti authored
83 selToAry = sel_registerName("to_ary");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
84 selSend = sel_registerName("send:");
85 sel__send__ = sel_registerName("__send__:");
639c64d implemented ObjectSpace finalizers (experimental)
Laurent Sansonetti authored
86 selCall = sel_registerName("call:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
87 selEqTilde = sel_registerName("=~:");
c59aa3c working on a new objc dispatch, marked a few methods are always_inline
Laurent Sansonetti authored
88 selClass = sel_registerName("class");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
89 selEval = sel_registerName("eval:");
084a52a a faster implementation of dvars + fixed eval bugs + preliminary impl…
Laurent Sansonetti authored
90 selInstanceEval = sel_registerName("instance_eval:");
91 selClassEval = sel_registerName("class_eval:");
92 selModuleEval = sel_registerName("module_eval:");
93 selLocalVariables = sel_registerName("local_variables");
94 selBinding = sel_registerName("binding");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
95 selEach = sel_registerName("each");
96 selEqq = sel_registerName("===:");
6a7c8b6 implemented struct #dup/#clone
Laurent Sansonetti authored
97 selDup = sel_registerName("dup");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
98 selBackquote = sel_registerName("`:");
99 selMethodAdded = sel_registerName("method_added:");
100 selSingletonMethodAdded = sel_registerName("singleton_method_added:");
e732379 moved the removed_method code to the VM + fixed undef_method callbacks
Laurent Sansonetti authored
101 selMethodRemoved = sel_registerName("method_removed:");
102 selSingletonMethodRemoved = sel_registerName("singleton_method_removed:");
103 selMethodUndefined = sel_registerName("method_undefined:");
104 selSingletonMethodUndefined = sel_registerName("singleton_method_undefined:");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored
105 selIsEqual = sel_registerName("isEqual:");
c0d189d IO#write: if the receiver isn't an IO object, dispatches the write: s…
Laurent Sansonetti authored
106 selWrite = sel_registerName("write:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
107 selInherited = sel_registerName("inherited:");
295167b - Added NODE_LAMBDA compatibility (for the "->" syntax)
Thibault Martin-Lagardette authored
108 selLambda = sel_registerName("lambda");
420a9db - Fixes #531 by implementing #[] and #[]= as shortcuts for objectFor…
Thibault Martin-Lagardette authored
109 selObjectForKey = sel_registerName("objectForKey:");
110 selSetObjectForKey = sel_registerName("setObject:forKey:");
00b147f add basic support for __method__ and __callee__
Laurent Sansonetti authored
111
112 sel__method__= sel_registerName("__method__");
113 sel__callee__ = sel_registerName("__callee__");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
114 #endif
115
116 idAREF = rb_intern("[]");
117 idASET = rb_intern("[]=");
118
119 idEach = rb_intern("each");
120 idTimes = rb_intern("times");
121 idLength = rb_intern("length");
122 idLambda = rb_intern("lambda");
123 idIntern = rb_intern("intern");
124 idGets = rb_intern("gets");
125 idSucc = rb_intern("succ");
126 idEnd = rb_intern("end");
127 idRangeEachLT = rb_intern("Range#each#LT");
128 idRangeEachLE = rb_intern("Range#each#LE");
129 idArrayEach = rb_intern("Array#each");
130 idMethodMissing = rb_intern("method_missing");
131
132 idThrowState = rb_intern("#__ThrowState__");
133
134 idSend = rb_intern("send");
135 id__send__ = rb_intern("__send__");
136
137 idRespond_to = rb_intern("respond_to?");
138 idInitialize = rb_intern("initialize");
139
140 idIncludedModules = rb_intern("__included_modules__");
141 idIncludedInClasses = rb_intern("__included_in_classes__");
142 idAncestors = rb_intern("__ancestors__");
143 }
Something went wrong with that request. Please try again.