Kernel-Collections.js 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580
  1. smalltalk.addPackage('Kernel-Collections', {});
  2. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  3. smalltalk.addMethod(
  4. unescape('_size'),
  5. smalltalk.method({
  6. selector: unescape('size'),
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. smalltalk.send(self, "_subclassResponsibility", []);
  11. return self;},
  12. args: [],
  13. source: unescape('size%0A%09self%20subclassResponsibility'),
  14. messageSends: ["subclassResponsibility"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Collection);
  18. smalltalk.addMethod(
  19. unescape('_readStream'),
  20. smalltalk.method({
  21. selector: unescape('readStream'),
  22. category: 'accessing',
  23. fn: function (){
  24. var self=this;
  25. return smalltalk.send(self, "_stream", []);
  26. return self;},
  27. args: [],
  28. source: unescape('readStream%0A%09%5Eself%20stream'),
  29. messageSends: ["stream"],
  30. referencedClasses: []
  31. }),
  32. smalltalk.Collection);
  33. smalltalk.addMethod(
  34. unescape('_writeStream'),
  35. smalltalk.method({
  36. selector: unescape('writeStream'),
  37. category: 'accessing',
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.send(self, "_stream", []);
  41. return self;},
  42. args: [],
  43. source: unescape('writeStream%0A%09%5Eself%20stream'),
  44. messageSends: ["stream"],
  45. referencedClasses: []
  46. }),
  47. smalltalk.Collection);
  48. smalltalk.addMethod(
  49. unescape('_stream'),
  50. smalltalk.method({
  51. selector: unescape('stream'),
  52. category: 'accessing',
  53. fn: function (){
  54. var self=this;
  55. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  56. return self;},
  57. args: [],
  58. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self'),
  59. messageSends: ["on:", "streamClass"],
  60. referencedClasses: []
  61. }),
  62. smalltalk.Collection);
  63. smalltalk.addMethod(
  64. unescape('_streamClass'),
  65. smalltalk.method({
  66. selector: unescape('streamClass'),
  67. category: 'accessing',
  68. fn: function (){
  69. var self=this;
  70. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  71. return self;},
  72. args: [],
  73. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass'),
  74. messageSends: ["streamClass", "class"],
  75. referencedClasses: []
  76. }),
  77. smalltalk.Collection);
  78. smalltalk.addMethod(
  79. unescape('_add_'),
  80. smalltalk.method({
  81. selector: unescape('add%3A'),
  82. category: 'adding/removing',
  83. fn: function (anObject){
  84. var self=this;
  85. smalltalk.send(self, "_subclassResponsibility", []);
  86. return self;},
  87. args: ["anObject"],
  88. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility'),
  89. messageSends: ["subclassResponsibility"],
  90. referencedClasses: []
  91. }),
  92. smalltalk.Collection);
  93. smalltalk.addMethod(
  94. unescape('_addAll_'),
  95. smalltalk.method({
  96. selector: unescape('addAll%3A'),
  97. category: 'adding/removing',
  98. fn: function (aCollection){
  99. var self=this;
  100. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  101. return aCollection;
  102. return self;},
  103. args: ["aCollection"],
  104. source: unescape('addAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20add%3A%20each%5D.%0A%09%5EaCollection'),
  105. messageSends: ["do:", "add:"],
  106. referencedClasses: []
  107. }),
  108. smalltalk.Collection);
  109. smalltalk.addMethod(
  110. unescape('__comma'),
  111. smalltalk.method({
  112. selector: unescape('%2C'),
  113. category: 'copying',
  114. fn: function (aCollection){
  115. var self=this;
  116. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  117. return self;},
  118. args: ["aCollection"],
  119. source: unescape('%2C%20aCollection%0A%09%5Eself%20copy%20%0A%09%20%20%20%20addAll%3A%20aCollection%3B%20%0A%09%20%20%20%20yourself'),
  120. messageSends: ["addAll:", "yourself", "copy"],
  121. referencedClasses: []
  122. }),
  123. smalltalk.Collection);
  124. smalltalk.addMethod(
  125. unescape('_copyWith_'),
  126. smalltalk.method({
  127. selector: unescape('copyWith%3A'),
  128. category: 'copying',
  129. fn: function (anObject){
  130. var self=this;
  131. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  132. return self;},
  133. args: ["anObject"],
  134. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself'),
  135. messageSends: ["add:", "yourself", "copy"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.Collection);
  139. smalltalk.addMethod(
  140. unescape('_copyWithAll_'),
  141. smalltalk.method({
  142. selector: unescape('copyWithAll%3A'),
  143. category: 'copying',
  144. fn: function (aCollection){
  145. var self=this;
  146. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  147. return self;},
  148. args: ["aCollection"],
  149. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself'),
  150. messageSends: ["addAll:", "yourself", "copy"],
  151. referencedClasses: []
  152. }),
  153. smalltalk.Collection);
  154. smalltalk.addMethod(
  155. unescape('_asArray'),
  156. smalltalk.method({
  157. selector: unescape('asArray'),
  158. category: 'converting',
  159. fn: function (){
  160. var self=this;
  161. var array=nil;
  162. var index=nil;
  163. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  164. index=(0);
  165. smalltalk.send(self, "_do_", [(function(each){index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return smalltalk.send(array, "_at_put_", [index, each]);})]);
  166. return array;
  167. return self;},
  168. args: [],
  169. source: unescape('asArray%0A%09%7C%20array%20index%20%7C%0A%09array%20%3A%3D%20Array%20new.%0A%09index%20%3A%3D%200.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20array%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Earray'),
  170. messageSends: ["new", "do:", unescape("+"), "at:put:"],
  171. referencedClasses: ["Array"]
  172. }),
  173. smalltalk.Collection);
  174. smalltalk.addMethod(
  175. unescape('_do_'),
  176. smalltalk.method({
  177. selector: unescape('do%3A'),
  178. category: 'enumerating',
  179. fn: function (aBlock){
  180. var self=this;
  181. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  182. return self;},
  183. args: ["aBlock"],
  184. source: unescape('do%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%3E'),
  185. messageSends: [],
  186. referencedClasses: []
  187. }),
  188. smalltalk.Collection);
  189. smalltalk.addMethod(
  190. unescape('_collect_'),
  191. smalltalk.method({
  192. selector: unescape('collect%3A'),
  193. category: 'enumerating',
  194. fn: function (aBlock){
  195. var self=this;
  196. var newCollection=nil;
  197. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  198. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  199. return newCollection;
  200. return self;},
  201. args: ["aBlock"],
  202. source: unescape('collect%3A%20aBlock%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20newCollection%20add%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5EnewCollection'),
  203. messageSends: ["new", "class", "do:", "add:", "value:"],
  204. referencedClasses: []
  205. }),
  206. smalltalk.Collection);
  207. smalltalk.addMethod(
  208. unescape('_detect_'),
  209. smalltalk.method({
  210. selector: unescape('detect%3A'),
  211. category: 'enumerating',
  212. fn: function (aBlock){
  213. var self=this;
  214. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  215. return self;},
  216. args: ["aBlock"],
  217. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D'),
  218. messageSends: ["detect:ifNone:", "errorNotFound"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.Collection);
  222. smalltalk.addMethod(
  223. unescape('_detect_ifNone_'),
  224. smalltalk.method({
  225. selector: unescape('detect%3AifNone%3A'),
  226. category: 'enumerating',
  227. fn: function (aBlock, anotherBlock){
  228. var self=this;
  229. for(var i = 0; i < self.length; i++)
  230. if(aBlock(self[i]))
  231. return self[i];
  232. return anotherBlock();
  233. ;
  234. return self;},
  235. args: ["aBlock", "anotherBlock"],
  236. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%3C%0A%09%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09%09return%20self%5Bi%5D%3B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%3E'),
  237. messageSends: [],
  238. referencedClasses: []
  239. }),
  240. smalltalk.Collection);
  241. smalltalk.addMethod(
  242. unescape('_do_separatedBy_'),
  243. smalltalk.method({
  244. selector: unescape('do%3AseparatedBy%3A'),
  245. category: 'enumerating',
  246. fn: function (aBlock, anotherBlock){
  247. var self=this;
  248. var first=nil;
  249. first=true;
  250. smalltalk.send(self, "_do_", [(function(each){((($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return first=false;})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return first=false;}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]));return smalltalk.send(aBlock, "_value_", [each]);})]);
  251. return self;},
  252. args: ["aBlock", "anotherBlock"],
  253. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%20%20%20%20%09%7C%20first%20%7C%0A%20%20%20%20%09first%20%3A%3D%20true.%0A%20%20%20%20%09self%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20first%0A%20%20%20%20%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%20%20%20%20%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%5D'),
  254. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  255. referencedClasses: []
  256. }),
  257. smalltalk.Collection);
  258. smalltalk.addMethod(
  259. unescape('_inject_into_'),
  260. smalltalk.method({
  261. selector: unescape('inject%3Ainto%3A'),
  262. category: 'enumerating',
  263. fn: function (anObject, aBlock){
  264. var self=this;
  265. var result=nil;
  266. result=anObject;
  267. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  268. return result;
  269. return self;},
  270. args: ["anObject", "aBlock"],
  271. source: unescape('inject%3A%20anObject%20into%3A%20aBlock%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20anObject.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%20%20%20%20result%20%3A%3D%20aBlock%20value%3A%20result%20value%3A%20each%5D.%0A%09%5Eresult'),
  272. messageSends: ["do:", "value:value:"],
  273. referencedClasses: []
  274. }),
  275. smalltalk.Collection);
  276. smalltalk.addMethod(
  277. unescape('_reject_'),
  278. smalltalk.method({
  279. selector: unescape('reject%3A'),
  280. category: 'enumerating',
  281. fn: function (aBlock){
  282. var self=this;
  283. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  284. return self;},
  285. args: ["aBlock"],
  286. source: unescape('reject%3A%20aBlock%0A%09%5Eself%20select%3A%20%5B%3Aeach%20%7C%20%28aBlock%20value%3A%20each%29%20%3D%20false%5D'),
  287. messageSends: ["select:", unescape("%3D"), "value:"],
  288. referencedClasses: []
  289. }),
  290. smalltalk.Collection);
  291. smalltalk.addMethod(
  292. unescape('_select_'),
  293. smalltalk.method({
  294. selector: unescape('select%3A'),
  295. category: 'enumerating',
  296. fn: function (aBlock){
  297. var self=this;
  298. var stream=nil;
  299. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  300. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]));})]);
  301. return smalltalk.send(stream, "_contents", []);
  302. return self;},
  303. args: ["aBlock"],
  304. source: unescape('select%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09stream%20nextPut%3A%20each%5D%5D.%0A%09%5Estream%20contents'),
  305. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  306. referencedClasses: []
  307. }),
  308. smalltalk.Collection);
  309. smalltalk.addMethod(
  310. unescape('_errorNotFound'),
  311. smalltalk.method({
  312. selector: unescape('errorNotFound'),
  313. category: 'error handling',
  314. fn: function (){
  315. var self=this;
  316. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  317. return self;},
  318. args: [],
  319. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27'),
  320. messageSends: ["error:"],
  321. referencedClasses: []
  322. }),
  323. smalltalk.Collection);
  324. smalltalk.addMethod(
  325. unescape('_includes_'),
  326. smalltalk.method({
  327. selector: unescape('includes%3A'),
  328. category: 'testing',
  329. fn: function (anObject){
  330. var self=this;
  331. var i = self.length;
  332. while (i--) {
  333. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  334. }
  335. return false
  336. ;
  337. return self;},
  338. args: ["anObject"],
  339. source: unescape('includes%3A%20anObject%0A%09%3C%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28smalltalk.send%28self%5Bi%5D%2C%20%22__eq%22%2C%20%5BanObject%5D%29%29%20%7Breturn%20true%3B%7D%09%0A%09%09%7D%0A%09%09return%20false%0A%09%3E'),
  340. messageSends: [],
  341. referencedClasses: []
  342. }),
  343. smalltalk.Collection);
  344. smalltalk.addMethod(
  345. unescape('_notEmpty'),
  346. smalltalk.method({
  347. selector: unescape('notEmpty'),
  348. category: 'testing',
  349. fn: function (){
  350. var self=this;
  351. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  352. return self;},
  353. args: [],
  354. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not'),
  355. messageSends: ["not", "isEmpty"],
  356. referencedClasses: []
  357. }),
  358. smalltalk.Collection);
  359. smalltalk.addMethod(
  360. unescape('_isEmpty'),
  361. smalltalk.method({
  362. selector: unescape('isEmpty'),
  363. category: 'testing',
  364. fn: function (){
  365. var self=this;
  366. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  367. return self;},
  368. args: [],
  369. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  370. messageSends: [unescape("%3D"), "size"],
  371. referencedClasses: []
  372. }),
  373. smalltalk.Collection);
  374. smalltalk.addMethod(
  375. unescape('_remove_'),
  376. smalltalk.method({
  377. selector: unescape('remove%3A'),
  378. category: 'adding/removing',
  379. fn: function (anObject){
  380. var self=this;
  381. return smalltalk.send(self, "_remove_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  382. return self;},
  383. args: ["anObject"],
  384. source: unescape('remove%3A%20anObject%0A%20%20%20%20%5Eself%20remove%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  385. messageSends: ["remove:ifAbsent:", "errorNotFound"],
  386. referencedClasses: []
  387. }),
  388. smalltalk.Collection);
  389. smalltalk.addMethod(
  390. unescape('_asSet'),
  391. smalltalk.method({
  392. selector: unescape('asSet'),
  393. category: 'converting',
  394. fn: function (){
  395. var self=this;
  396. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  397. return self;},
  398. args: [],
  399. source: unescape('asSet%0A%09%5ESet%20withAll%3A%20self'),
  400. messageSends: ["withAll:"],
  401. referencedClasses: ["Set"]
  402. }),
  403. smalltalk.Collection);
  404. smalltalk.addMethod(
  405. unescape('_ifNotEmpty_'),
  406. smalltalk.method({
  407. selector: unescape('ifNotEmpty%3A'),
  408. category: 'testing',
  409. fn: function (aBlock){
  410. var self=this;
  411. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  412. return self;},
  413. args: ["aBlock"],
  414. source: unescape('ifNotEmpty%3A%20aBlock%0A%09self%20notEmpty%20ifTrue%3A%20aBlock.'),
  415. messageSends: ["ifTrue:", "notEmpty"],
  416. referencedClasses: []
  417. }),
  418. smalltalk.Collection);
  419. smalltalk.addMethod(
  420. unescape('_ifEmpty_'),
  421. smalltalk.method({
  422. selector: unescape('ifEmpty%3A'),
  423. category: 'testing',
  424. fn: function (aBlock){
  425. var self=this;
  426. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  427. return self;},
  428. args: ["aBlock"],
  429. source: unescape('ifEmpty%3A%20aBlock%0A%09self%20isEmpty%20ifTrue%3A%20aBlock.'),
  430. messageSends: ["ifTrue:", "isEmpty"],
  431. referencedClasses: []
  432. }),
  433. smalltalk.Collection);
  434. smalltalk.addMethod(
  435. unescape('_copyWithoutAll_'),
  436. smalltalk.method({
  437. selector: unescape('copyWithoutAll%3A'),
  438. category: 'copying',
  439. fn: function (aCollection){
  440. var self=this;
  441. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  442. return self;},
  443. args: ["aCollection"],
  444. source: unescape('copyWithoutAll%3A%20aCollection%0A%09%22Answer%20a%20copy%20of%20the%20receiver%20that%20does%20not%20contain%20any%20elements%20%0A%09equal%20to%20those%20in%20aCollection.%22%0A%0A%09%5E%20self%20reject%3A%20%5B%3Aeach%20%7C%20aCollection%20includes%3A%20each%5D'),
  445. messageSends: ["reject:", "includes:"],
  446. referencedClasses: []
  447. }),
  448. smalltalk.Collection);
  449. smalltalk.addMethod(
  450. unescape('_remove_ifAbsent_'),
  451. smalltalk.method({
  452. selector: unescape('remove%3AifAbsent%3A'),
  453. category: 'adding/removing',
  454. fn: function (anObject, aBlock){
  455. var self=this;
  456. smalltalk.send(self, "_subclassResponsibility", []);
  457. return self;},
  458. args: ["anObject", "aBlock"],
  459. source: unescape('remove%3A%20anObject%20ifAbsent%3A%20aBlock%0A%20%20%20%20self%20subclassResponsibility'),
  460. messageSends: ["subclassResponsibility"],
  461. referencedClasses: []
  462. }),
  463. smalltalk.Collection);
  464. smalltalk.addMethod(
  465. unescape('_streamClass'),
  466. smalltalk.method({
  467. selector: unescape('streamClass'),
  468. category: 'accessing',
  469. fn: function (){
  470. var self=this;
  471. return (smalltalk.Stream || Stream);
  472. return self;},
  473. args: [],
  474. source: unescape('streamClass%0A%09%20%20%20%20%5EStream'),
  475. messageSends: [],
  476. referencedClasses: ["Stream"]
  477. }),
  478. smalltalk.Collection.klass);
  479. smalltalk.addMethod(
  480. unescape('_with_'),
  481. smalltalk.method({
  482. selector: unescape('with%3A'),
  483. category: 'instance creation',
  484. fn: function (anObject){
  485. var self=this;
  486. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  487. return self;},
  488. args: ["anObject"],
  489. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself'),
  490. messageSends: ["add:", "yourself", "new"],
  491. referencedClasses: []
  492. }),
  493. smalltalk.Collection.klass);
  494. smalltalk.addMethod(
  495. unescape('_with_with_'),
  496. smalltalk.method({
  497. selector: unescape('with%3Awith%3A'),
  498. category: 'instance creation',
  499. fn: function (anObject, anotherObject){
  500. var self=this;
  501. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  502. return self;},
  503. args: ["anObject", "anotherObject"],
  504. source: unescape('with%3A%20anObject%20with%3A%20anotherObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09add%3A%20anotherObject%3B%0A%09%09yourself'),
  505. messageSends: ["add:", "yourself", "new"],
  506. referencedClasses: []
  507. }),
  508. smalltalk.Collection.klass);
  509. smalltalk.addMethod(
  510. unescape('_with_with_with_'),
  511. smalltalk.method({
  512. selector: unescape('with%3Awith%3Awith%3A'),
  513. category: 'instance creation',
  514. fn: function (firstObject, secondObject, thirdObject){
  515. var self=this;
  516. return (function($rec){smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  517. return self;},
  518. args: ["firstObject", "secondObject", "thirdObject"],
  519. source: unescape('with%3A%20firstObject%20with%3A%20secondObject%20with%3A%20thirdObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20firstObject%3B%0A%09%09add%3A%20secondObject%3B%0A%09%09add%3A%20thirdObject%3B%0A%09%09yourself'),
  520. messageSends: ["add:", "yourself", "new"],
  521. referencedClasses: []
  522. }),
  523. smalltalk.Collection.klass);
  524. smalltalk.addMethod(
  525. unescape('_withAll_'),
  526. smalltalk.method({
  527. selector: unescape('withAll%3A'),
  528. category: 'instance creation',
  529. fn: function (aCollection){
  530. var self=this;
  531. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  532. return self;},
  533. args: ["aCollection"],
  534. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself'),
  535. messageSends: ["addAll:", "yourself", "new"],
  536. referencedClasses: []
  537. }),
  538. smalltalk.Collection.klass);
  539. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  540. smalltalk.addMethod(
  541. unescape('_at_'),
  542. smalltalk.method({
  543. selector: unescape('at%3A'),
  544. category: 'accessing',
  545. fn: function (anIndex){
  546. var self=this;
  547. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  548. return self;},
  549. args: ["anIndex"],
  550. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D'),
  551. messageSends: ["at:ifAbsent:", "errorNotFound"],
  552. referencedClasses: []
  553. }),
  554. smalltalk.SequenceableCollection);
  555. smalltalk.addMethod(
  556. unescape('_at_ifAbsent_'),
  557. smalltalk.method({
  558. selector: unescape('at%3AifAbsent%3A'),
  559. category: 'accessing',
  560. fn: function (anIndex, aBlock){
  561. var self=this;
  562. smalltalk.send(self, "_subclassResponsibility", []);
  563. return self;},
  564. args: ["anIndex", "aBlock"],
  565. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility'),
  566. messageSends: ["subclassResponsibility"],
  567. referencedClasses: []
  568. }),
  569. smalltalk.SequenceableCollection);
  570. smalltalk.addMethod(
  571. unescape('_at_put_'),
  572. smalltalk.method({
  573. selector: unescape('at%3Aput%3A'),
  574. category: 'accessing',
  575. fn: function (anIndex, anObject){
  576. var self=this;
  577. smalltalk.send(self, "_subclassResponsibility", []);
  578. return self;},
  579. args: ["anIndex", "anObject"],
  580. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility'),
  581. messageSends: ["subclassResponsibility"],
  582. referencedClasses: []
  583. }),
  584. smalltalk.SequenceableCollection);
  585. smalltalk.addMethod(
  586. unescape('_copyFrom_to_'),
  587. smalltalk.method({
  588. selector: unescape('copyFrom%3Ato%3A'),
  589. category: 'copying',
  590. fn: function (anIndex, anotherIndex){
  591. var self=this;
  592. smalltalk.send(self, "_subclassResponsibility", []);
  593. return self;},
  594. args: ["anIndex", "anotherIndex"],
  595. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility'),
  596. messageSends: ["subclassResponsibility"],
  597. referencedClasses: []
  598. }),
  599. smalltalk.SequenceableCollection);
  600. smalltalk.addMethod(
  601. unescape('_first'),
  602. smalltalk.method({
  603. selector: unescape('first'),
  604. category: 'accessing',
  605. fn: function (){
  606. var self=this;
  607. return smalltalk.send(self, "_at_", [(1)]);
  608. return self;},
  609. args: [],
  610. source: unescape('first%0A%09%5Eself%20at%3A%201'),
  611. messageSends: ["at:"],
  612. referencedClasses: []
  613. }),
  614. smalltalk.SequenceableCollection);
  615. smalltalk.addMethod(
  616. unescape('_fourth'),
  617. smalltalk.method({
  618. selector: unescape('fourth'),
  619. category: 'accessing',
  620. fn: function (){
  621. var self=this;
  622. return smalltalk.send(self, "_at_", [(4)]);
  623. return self;},
  624. args: [],
  625. source: unescape('fourth%0A%09%5Eself%20at%3A%204'),
  626. messageSends: ["at:"],
  627. referencedClasses: []
  628. }),
  629. smalltalk.SequenceableCollection);
  630. smalltalk.addMethod(
  631. unescape('_last'),
  632. smalltalk.method({
  633. selector: unescape('last'),
  634. category: 'accessing',
  635. fn: function (){
  636. var self=this;
  637. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  638. return self;},
  639. args: [],
  640. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size'),
  641. messageSends: ["at:", "size"],
  642. referencedClasses: []
  643. }),
  644. smalltalk.SequenceableCollection);
  645. smalltalk.addMethod(
  646. unescape('_second'),
  647. smalltalk.method({
  648. selector: unescape('second'),
  649. category: 'accessing',
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.send(self, "_at_", [(2)]);
  653. return self;},
  654. args: [],
  655. source: unescape('second%0A%09%5Eself%20at%3A%202'),
  656. messageSends: ["at:"],
  657. referencedClasses: []
  658. }),
  659. smalltalk.SequenceableCollection);
  660. smalltalk.addMethod(
  661. unescape('_third'),
  662. smalltalk.method({
  663. selector: unescape('third'),
  664. category: 'accessing',
  665. fn: function (){
  666. var self=this;
  667. return smalltalk.send(self, "_at_", [(3)]);
  668. return self;},
  669. args: [],
  670. source: unescape('third%0A%09%5Eself%20at%3A%203'),
  671. messageSends: ["at:"],
  672. referencedClasses: []
  673. }),
  674. smalltalk.SequenceableCollection);
  675. smalltalk.addMethod(
  676. unescape('_removeLast'),
  677. smalltalk.method({
  678. selector: unescape('removeLast'),
  679. category: 'adding',
  680. fn: function (){
  681. var self=this;
  682. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  683. return self;},
  684. args: [],
  685. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last'),
  686. messageSends: ["remove:", "last"],
  687. referencedClasses: []
  688. }),
  689. smalltalk.SequenceableCollection);
  690. smalltalk.addMethod(
  691. unescape('_addLast_'),
  692. smalltalk.method({
  693. selector: unescape('addLast%3A'),
  694. category: 'adding',
  695. fn: function (anObject){
  696. var self=this;
  697. smalltalk.send(self, "_add_", [anObject]);
  698. return self;},
  699. args: ["anObject"],
  700. source: unescape('addLast%3A%20anObject%0A%09self%20add%3A%20anObject'),
  701. messageSends: ["add:"],
  702. referencedClasses: []
  703. }),
  704. smalltalk.SequenceableCollection);
  705. smalltalk.addMethod(
  706. unescape('_withIndexDo_'),
  707. smalltalk.method({
  708. selector: unescape('withIndexDo%3A'),
  709. category: 'enumerating',
  710. fn: function (aBlock){
  711. var self=this;
  712. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  713. return self;},
  714. args: ["aBlock"],
  715. source: unescape('withIndexDo%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%2C%20i+1%29%3B%7D%3E'),
  716. messageSends: [],
  717. referencedClasses: []
  718. }),
  719. smalltalk.SequenceableCollection);
  720. smalltalk.addMethod(
  721. unescape('_allButFirst'),
  722. smalltalk.method({
  723. selector: unescape('allButFirst'),
  724. category: 'accessing',
  725. fn: function (){
  726. var self=this;
  727. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  728. return self;},
  729. args: [],
  730. source: unescape('allButFirst%0A%09%5Eself%20copyFrom%3A%202%20to%3A%20self%20size'),
  731. messageSends: ["copyFrom:to:", "size"],
  732. referencedClasses: []
  733. }),
  734. smalltalk.SequenceableCollection);
  735. smalltalk.addMethod(
  736. unescape('_allButLast'),
  737. smalltalk.method({
  738. selector: unescape('allButLast'),
  739. category: 'accessing',
  740. fn: function (){
  741. var self=this;
  742. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  743. return self;},
  744. args: [],
  745. source: unescape('allButLast%0A%09%5Eself%20copyFrom%3A%201%20to%3A%20self%20size%20-%201'),
  746. messageSends: ["copyFrom:to:", unescape("-"), "size"],
  747. referencedClasses: []
  748. }),
  749. smalltalk.SequenceableCollection);
  750. smalltalk.addMethod(
  751. unescape('_indexOf_'),
  752. smalltalk.method({
  753. selector: unescape('indexOf%3A'),
  754. category: 'accessing',
  755. fn: function (anObject){
  756. var self=this;
  757. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  758. return self;},
  759. args: ["anObject"],
  760. source: unescape('indexOf%3A%20anObject%0A%09%5Eself%20indexOf%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  761. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  762. referencedClasses: []
  763. }),
  764. smalltalk.SequenceableCollection);
  765. smalltalk.addMethod(
  766. unescape('_indexOf_ifAbsent_'),
  767. smalltalk.method({
  768. selector: unescape('indexOf%3AifAbsent%3A'),
  769. category: 'accessing',
  770. fn: function (anObject, aBlock){
  771. var self=this;
  772. for(var i=0;i<self.length;i++){
  773. if(self[i].__eq(anObject)) {return i+1}
  774. }
  775. return aBlock();
  776. ;
  777. return self;},
  778. args: ["anObject", "aBlock"],
  779. source: unescape('indexOf%3A%20anObject%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%09%7D%0A%09%09return%20aBlock%28%29%3B%0A%09%3E'),
  780. messageSends: [],
  781. referencedClasses: []
  782. }),
  783. smalltalk.SequenceableCollection);
  784. smalltalk.addMethod(
  785. unescape('_indexOf_startingAt_ifAbsent_'),
  786. smalltalk.method({
  787. selector: unescape('indexOf%3AstartingAt%3AifAbsent%3A'),
  788. category: 'accessing',
  789. fn: function (anObject, start, aBlock){
  790. var self=this;
  791. for(var i=start-1;i<self.length;i++){
  792. if(self[i].__eq(anObject)) {return i+1}
  793. }
  794. return aBlock();
  795. ;
  796. return self;},
  797. args: ["anObject", "start", "aBlock"],
  798. source: unescape('indexOf%3A%20anObject%20startingAt%3A%20start%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09for%28var%20i%3Dstart-1%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%09%7D%0A%09%09return%20aBlock%28%29%3B%0A%09%3E'),
  799. messageSends: [],
  800. referencedClasses: []
  801. }),
  802. smalltalk.SequenceableCollection);
  803. smalltalk.addMethod(
  804. unescape('_indexOf_startingAt_'),
  805. smalltalk.method({
  806. selector: unescape('indexOf%3AstartingAt%3A'),
  807. category: 'accessing',
  808. fn: function (anObject, start){
  809. var self=this;
  810. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  811. return self;},
  812. args: ["anObject", "start"],
  813. source: unescape('indexOf%3A%20anObject%20startingAt%3A%20start%0A%09%22Answer%20the%20index%20of%20the%20first%20occurence%20of%20anElement%20after%20start%0A%09within%20the%20receiver.%20If%20the%20receiver%20does%20not%20contain%20anElement%2C%20%0A%09answer%200.%22%0A%09%5Eself%20indexOf%3A%20anObject%20startingAt%3A%20start%20ifAbsent%3A%20%5B0%5D'),
  814. messageSends: ["indexOf:startingAt:ifAbsent:"],
  815. referencedClasses: []
  816. }),
  817. smalltalk.SequenceableCollection);
  818. smalltalk.addMethod(
  819. unescape('_reversed'),
  820. smalltalk.method({
  821. selector: unescape('reversed'),
  822. category: 'converting',
  823. fn: function (){
  824. var self=this;
  825. smalltalk.send(self, "_subclassResponsibility", []);
  826. return self;},
  827. args: [],
  828. source: unescape('reversed%0A%09self%20subclassResponsibility'),
  829. messageSends: ["subclassResponsibility"],
  830. referencedClasses: []
  831. }),
  832. smalltalk.SequenceableCollection);
  833. smalltalk.addMethod(
  834. unescape('_atRandom'),
  835. smalltalk.method({
  836. selector: unescape('atRandom'),
  837. category: 'accessing',
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  841. return self;},
  842. args: [],
  843. source: unescape('atRandom%0A%09%5E%20self%20at%3A%20self%20size%20atRandom'),
  844. messageSends: ["at:", "atRandom", "size"],
  845. referencedClasses: []
  846. }),
  847. smalltalk.SequenceableCollection);
  848. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  849. smalltalk.addMethod(
  850. unescape('__eq'),
  851. smalltalk.method({
  852. selector: unescape('%3D'),
  853. category: 'comparing',
  854. fn: function (aString){
  855. var self=this;
  856. try{((($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  857. return String(self) == aString;
  858. return self;
  859. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  860. args: ["aString"],
  861. source: unescape('%3D%20aString%0A%09aString%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20String%28self%29%20%3D%3D%20aString%3E'),
  862. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  863. referencedClasses: []
  864. }),
  865. smalltalk.String);
  866. smalltalk.addMethod(
  867. unescape('_size'),
  868. smalltalk.method({
  869. selector: unescape('size'),
  870. category: 'accessing',
  871. fn: function (){
  872. var self=this;
  873. return self.length;
  874. return self;},
  875. args: [],
  876. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  877. messageSends: [],
  878. referencedClasses: []
  879. }),
  880. smalltalk.String);
  881. smalltalk.addMethod(
  882. unescape('_at_'),
  883. smalltalk.method({
  884. selector: unescape('at%3A'),
  885. category: 'accessing',
  886. fn: function (anIndex){
  887. var self=this;
  888. return self[anIndex - 1];
  889. return self;},
  890. args: ["anIndex"],
  891. source: unescape('at%3A%20anIndex%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%3E'),
  892. messageSends: [],
  893. referencedClasses: []
  894. }),
  895. smalltalk.String);
  896. smalltalk.addMethod(
  897. unescape('_at_put_'),
  898. smalltalk.method({
  899. selector: unescape('at%3Aput%3A'),
  900. category: 'accessing',
  901. fn: function (anIndex, anObject){
  902. var self=this;
  903. smalltalk.send(self, "_errorReadOnly", []);
  904. return self;},
  905. args: ["anIndex", "anObject"],
  906. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly'),
  907. messageSends: ["errorReadOnly"],
  908. referencedClasses: []
  909. }),
  910. smalltalk.String);
  911. smalltalk.addMethod(
  912. unescape('_at_ifAbsent_'),
  913. smalltalk.method({
  914. selector: unescape('at%3AifAbsent%3A'),
  915. category: 'accessing',
  916. fn: function (anIndex, aBlock){
  917. var self=this;
  918. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  919. return self;},
  920. args: ["anIndex", "aBlock"],
  921. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%20%20%20%20%09%28self%20at%3A%20anIndex%29%20ifNil%3A%20%5BaBlock%5D'),
  922. messageSends: ["ifNil:", "at:"],
  923. referencedClasses: []
  924. }),
  925. smalltalk.String);
  926. smalltalk.addMethod(
  927. unescape('_escaped'),
  928. smalltalk.method({
  929. selector: unescape('escaped'),
  930. category: 'accessing',
  931. fn: function (){
  932. var self=this;
  933. return escape(self);
  934. return self;},
  935. args: [],
  936. source: unescape('escaped%0A%09%3Creturn%20escape%28self%29%3E'),
  937. messageSends: [],
  938. referencedClasses: []
  939. }),
  940. smalltalk.String);
  941. smalltalk.addMethod(
  942. unescape('_unescaped'),
  943. smalltalk.method({
  944. selector: unescape('unescaped'),
  945. category: 'accessing',
  946. fn: function (){
  947. var self=this;
  948. return unescape(self);
  949. return self;},
  950. args: [],
  951. source: unescape('unescaped%0A%09%3Creturn%20unescape%28self%29%3E'),
  952. messageSends: [],
  953. referencedClasses: []
  954. }),
  955. smalltalk.String);
  956. smalltalk.addMethod(
  957. unescape('_add_'),
  958. smalltalk.method({
  959. selector: unescape('add%3A'),
  960. category: 'adding',
  961. fn: function (anObject){
  962. var self=this;
  963. smalltalk.send(self, "_errorReadOnly", []);
  964. return self;},
  965. args: ["anObject"],
  966. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly'),
  967. messageSends: ["errorReadOnly"],
  968. referencedClasses: []
  969. }),
  970. smalltalk.String);
  971. smalltalk.addMethod(
  972. unescape('__comma'),
  973. smalltalk.method({
  974. selector: unescape('%2C'),
  975. category: 'copying',
  976. fn: function (aString){
  977. var self=this;
  978. return self + aString;
  979. return self;},
  980. args: ["aString"],
  981. source: unescape('%2C%20aString%0A%09%3Creturn%20self%20+%20aString%3E'),
  982. messageSends: [],
  983. referencedClasses: []
  984. }),
  985. smalltalk.String);
  986. smalltalk.addMethod(
  987. unescape('_copyFrom_to_'),
  988. smalltalk.method({
  989. selector: unescape('copyFrom%3Ato%3A'),
  990. category: 'copying',
  991. fn: function (anIndex, anotherIndex){
  992. var self=this;
  993. return self.substring(anIndex - 1, anotherIndex);
  994. return self;},
  995. args: ["anIndex", "anotherIndex"],
  996. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%3Creturn%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3E'),
  997. messageSends: [],
  998. referencedClasses: []
  999. }),
  1000. smalltalk.String);
  1001. smalltalk.addMethod(
  1002. unescape('_shallowCopy'),
  1003. smalltalk.method({
  1004. selector: unescape('shallowCopy'),
  1005. category: 'copying',
  1006. fn: function (){
  1007. var self=this;
  1008. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  1009. return self;},
  1010. args: [],
  1011. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self'),
  1012. messageSends: ["fromString:", "class"],
  1013. referencedClasses: []
  1014. }),
  1015. smalltalk.String);
  1016. smalltalk.addMethod(
  1017. unescape('_deepCopy'),
  1018. smalltalk.method({
  1019. selector: unescape('deepCopy'),
  1020. category: 'copying',
  1021. fn: function (){
  1022. var self=this;
  1023. return smalltalk.send(self, "_shallowCopy", []);
  1024. return self;},
  1025. args: [],
  1026. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy'),
  1027. messageSends: ["shallowCopy"],
  1028. referencedClasses: []
  1029. }),
  1030. smalltalk.String);
  1031. smalltalk.addMethod(
  1032. unescape('_asSelector'),
  1033. smalltalk.method({
  1034. selector: unescape('asSelector'),
  1035. category: 'converting',
  1036. fn: function (){
  1037. var self=this;
  1038. var selector=nil;
  1039. selector=smalltalk.send("_", "__comma", [self]);
  1040. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  1041. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  1042. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  1043. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  1044. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  1045. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  1046. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  1047. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  1048. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  1049. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  1050. return selector;
  1051. return self;},
  1052. args: [],
  1053. source: unescape('asSelector%0A%09%22If%20you%20change%20this%20method%2C%20change%20smalltalk.convertSelector%20too%20%28see%20js/boot.js%20file%29%22%0A%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector'),
  1054. messageSends: [unescape("%2C"), "replace:with:"],
  1055. referencedClasses: []
  1056. }),
  1057. smalltalk.String);
  1058. smalltalk.addMethod(
  1059. unescape('_asJavascript'),
  1060. smalltalk.method({
  1061. selector: unescape('asJavascript'),
  1062. category: 'converting',
  1063. fn: function (){
  1064. var self=this;
  1065. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  1066. return "unescape(\"" + escape(self) + "\")";
  1067. else
  1068. return "\"" + self + "\"";
  1069. ;
  1070. return self;},
  1071. args: [],
  1072. source: unescape('asJavascript%0A%09%3C%0A%09%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09%09else%0A%09%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%3E'),
  1073. messageSends: [],
  1074. referencedClasses: []
  1075. }),
  1076. smalltalk.String);
  1077. smalltalk.addMethod(
  1078. unescape('_replace_with_'),
  1079. smalltalk.method({
  1080. selector: unescape('replace%3Awith%3A'),
  1081. category: 'regular expressions',
  1082. fn: function (aString, anotherString){
  1083. var self=this;
  1084. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  1085. return self;},
  1086. args: ["aString", "anotherString"],
  1087. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString'),
  1088. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  1089. referencedClasses: ["RegularExpression"]
  1090. }),
  1091. smalltalk.String);
  1092. smalltalk.addMethod(
  1093. unescape('_replaceRegexp_with_'),
  1094. smalltalk.method({
  1095. selector: unescape('replaceRegexp%3Awith%3A'),
  1096. category: 'regular expressions',
  1097. fn: function (aRegexp, aString){
  1098. var self=this;
  1099. return self.replace(aRegexp, aString);
  1100. return self;},
  1101. args: ["aRegexp", "aString"],
  1102. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%3Creturn%20self.replace%28aRegexp%2C%20aString%29%3E'),
  1103. messageSends: [],
  1104. referencedClasses: []
  1105. }),
  1106. smalltalk.String);
  1107. smalltalk.addMethod(
  1108. unescape('_tokenize_'),
  1109. smalltalk.method({
  1110. selector: unescape('tokenize%3A'),
  1111. category: 'converting',
  1112. fn: function (aString){
  1113. var self=this;
  1114. return self.split(aString);
  1115. return self;},
  1116. args: ["aString"],
  1117. source: unescape('tokenize%3A%20aString%0A%09%3Creturn%20self.split%28aString%29%3E'),
  1118. messageSends: [],
  1119. referencedClasses: []
  1120. }),
  1121. smalltalk.String);
  1122. smalltalk.addMethod(
  1123. unescape('_match_'),
  1124. smalltalk.method({
  1125. selector: unescape('match%3A'),
  1126. category: 'regular expressions',
  1127. fn: function (aRegexp){
  1128. var self=this;
  1129. return self.search(aRegexp) != -1;
  1130. return self;},
  1131. args: ["aRegexp"],
  1132. source: unescape('match%3A%20aRegexp%0A%09%3Creturn%20self.search%28aRegexp%29%20%21%3D%20-1%3E'),
  1133. messageSends: [],
  1134. referencedClasses: []
  1135. }),
  1136. smalltalk.String);
  1137. smalltalk.addMethod(
  1138. unescape('_asString'),
  1139. smalltalk.method({
  1140. selector: unescape('asString'),
  1141. category: 'converting',
  1142. fn: function (){
  1143. var self=this;
  1144. return self;
  1145. return self;},
  1146. args: [],
  1147. source: unescape('asString%0A%20%20%20%20%09%5Eself'),
  1148. messageSends: [],
  1149. referencedClasses: []
  1150. }),
  1151. smalltalk.String);
  1152. smalltalk.addMethod(
  1153. unescape('_asNumber'),
  1154. smalltalk.method({
  1155. selector: unescape('asNumber'),
  1156. category: 'converting',
  1157. fn: function (){
  1158. var self=this;
  1159. return Number(self);
  1160. return self;},
  1161. args: [],
  1162. source: unescape('asNumber%0A%09%3Creturn%20Number%28self%29%3E'),
  1163. messageSends: [],
  1164. referencedClasses: []
  1165. }),
  1166. smalltalk.String);
  1167. smalltalk.addMethod(
  1168. unescape('_errorReadOnly'),
  1169. smalltalk.method({
  1170. selector: unescape('errorReadOnly'),
  1171. category: 'error handling',
  1172. fn: function (){
  1173. var self=this;
  1174. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  1175. return self;},
  1176. args: [],
  1177. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27'),
  1178. messageSends: ["error:"],
  1179. referencedClasses: []
  1180. }),
  1181. smalltalk.String);
  1182. smalltalk.addMethod(
  1183. unescape('_printString'),
  1184. smalltalk.method({
  1185. selector: unescape('printString'),
  1186. category: 'printing',
  1187. fn: function (){
  1188. var self=this;
  1189. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  1190. return self;},
  1191. args: [],
  1192. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27'),
  1193. messageSends: [unescape("%2C")],
  1194. referencedClasses: []
  1195. }),
  1196. smalltalk.String);
  1197. smalltalk.addMethod(
  1198. unescape('_printNl'),
  1199. smalltalk.method({
  1200. selector: unescape('printNl'),
  1201. category: 'printing',
  1202. fn: function (){
  1203. var self=this;
  1204. console.log(self);
  1205. return self;},
  1206. args: [],
  1207. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  1208. messageSends: [],
  1209. referencedClasses: []
  1210. }),
  1211. smalltalk.String);
  1212. smalltalk.addMethod(
  1213. unescape('_isString'),
  1214. smalltalk.method({
  1215. selector: unescape('isString'),
  1216. category: 'testing',
  1217. fn: function (){
  1218. var self=this;
  1219. return true;
  1220. return self;},
  1221. args: [],
  1222. source: unescape('isString%0A%20%20%20%20%09%5Etrue'),
  1223. messageSends: [],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.String);
  1227. smalltalk.addMethod(
  1228. unescape('__gt'),
  1229. smalltalk.method({
  1230. selector: unescape('%3E'),
  1231. category: 'comparing',
  1232. fn: function (aString){
  1233. var self=this;
  1234. return String(self) > aString;
  1235. return self;},
  1236. args: ["aString"],
  1237. source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString%3E'),
  1238. messageSends: [],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.String);
  1242. smalltalk.addMethod(
  1243. unescape('__lt'),
  1244. smalltalk.method({
  1245. selector: unescape('%3C'),
  1246. category: 'comparing',
  1247. fn: function (aString){
  1248. var self=this;
  1249. return String(self) < aString;
  1250. return self;},
  1251. args: ["aString"],
  1252. source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString%3E'),
  1253. messageSends: [],
  1254. referencedClasses: []
  1255. }),
  1256. smalltalk.String);
  1257. smalltalk.addMethod(
  1258. unescape('__gt_eq'),
  1259. smalltalk.method({
  1260. selector: unescape('%3E%3D'),
  1261. category: 'comparing',
  1262. fn: function (aString){
  1263. var self=this;
  1264. return String(self) >= aString;
  1265. return self;},
  1266. args: ["aString"],
  1267. source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString%3E'),
  1268. messageSends: [],
  1269. referencedClasses: []
  1270. }),
  1271. smalltalk.String);
  1272. smalltalk.addMethod(
  1273. unescape('__lt_eq'),
  1274. smalltalk.method({
  1275. selector: unescape('%3C%3D'),
  1276. category: 'comparing',
  1277. fn: function (aString){
  1278. var self=this;
  1279. return String(self) <= aString;
  1280. return self;},
  1281. args: ["aString"],
  1282. source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString%3E'),
  1283. messageSends: [],
  1284. referencedClasses: []
  1285. }),
  1286. smalltalk.String);
  1287. smalltalk.addMethod(
  1288. unescape('_remove_'),
  1289. smalltalk.method({
  1290. selector: unescape('remove%3A'),
  1291. category: 'adding',
  1292. fn: function (anObject){
  1293. var self=this;
  1294. smalltalk.send(self, "_errorReadOnly", []);
  1295. return self;},
  1296. args: ["anObject"],
  1297. source: unescape('remove%3A%20anObject%0A%09self%20errorReadOnly'),
  1298. messageSends: ["errorReadOnly"],
  1299. referencedClasses: []
  1300. }),
  1301. smalltalk.String);
  1302. smalltalk.addMethod(
  1303. unescape('_trimLeft_'),
  1304. smalltalk.method({
  1305. selector: unescape('trimLeft%3A'),
  1306. category: 'regular expressions',
  1307. fn: function (separators){
  1308. var self=this;
  1309. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5E%5B"), "__comma", [separators]), "__comma", [unescape("%5D+")]), "g"]), ""]);
  1310. return self;},
  1311. args: ["separators"],
  1312. source: unescape('trimLeft%3A%20separators%0A%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5E%5B%27%2C%20separators%2C%20%27%5D+%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  1313. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  1314. referencedClasses: ["RegularExpression"]
  1315. }),
  1316. smalltalk.String);
  1317. smalltalk.addMethod(
  1318. unescape('_trimRight_'),
  1319. smalltalk.method({
  1320. selector: unescape('trimRight%3A'),
  1321. category: 'regular expressions',
  1322. fn: function (separators){
  1323. var self=this;
  1324. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [separators]), "__comma", [unescape("%5D+%24")]), "g"]), ""]);
  1325. return self;},
  1326. args: ["separators"],
  1327. source: unescape('trimRight%3A%20separators%0A%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5B%27%2C%20separators%2C%20%27%5D+%24%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  1328. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  1329. referencedClasses: ["RegularExpression"]
  1330. }),
  1331. smalltalk.String);
  1332. smalltalk.addMethod(
  1333. unescape('_trimLeft'),
  1334. smalltalk.method({
  1335. selector: unescape('trimLeft'),
  1336. category: 'regular expressions',
  1337. fn: function (){
  1338. var self=this;
  1339. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  1340. return self;},
  1341. args: [],
  1342. source: unescape('trimLeft%0A%09%5Eself%20trimLeft%3A%20%27%5Cs%27'),
  1343. messageSends: ["trimLeft:"],
  1344. referencedClasses: []
  1345. }),
  1346. smalltalk.String);
  1347. smalltalk.addMethod(
  1348. unescape('_trimRight'),
  1349. smalltalk.method({
  1350. selector: unescape('trimRight'),
  1351. category: 'regular expressions',
  1352. fn: function (){
  1353. var self=this;
  1354. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  1355. return self;},
  1356. args: [],
  1357. source: unescape('trimRight%0A%09%5Eself%20trimRight%3A%20%27%5Cs%27'),
  1358. messageSends: ["trimRight:"],
  1359. referencedClasses: []
  1360. }),
  1361. smalltalk.String);
  1362. smalltalk.addMethod(
  1363. unescape('_trimBoth'),
  1364. smalltalk.method({
  1365. selector: unescape('trimBoth'),
  1366. category: 'regular expressions',
  1367. fn: function (){
  1368. var self=this;
  1369. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  1370. return self;},
  1371. args: [],
  1372. source: unescape('trimBoth%0A%09%5Eself%20trimBoth%3A%20%27%5Cs%27'),
  1373. messageSends: ["trimBoth:"],
  1374. referencedClasses: []
  1375. }),
  1376. smalltalk.String);
  1377. smalltalk.addMethod(
  1378. unescape('_trimBoth_'),
  1379. smalltalk.method({
  1380. selector: unescape('trimBoth%3A'),
  1381. category: 'regular expressions',
  1382. fn: function (separators){
  1383. var self=this;
  1384. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  1385. return self;},
  1386. args: ["separators"],
  1387. source: unescape('trimBoth%3A%20separators%0A%0A%20%20%20%20%09%5E%28self%20trimLeft%3A%20separators%29%20trimRight%3A%20separators'),
  1388. messageSends: ["trimRight:", "trimLeft:"],
  1389. referencedClasses: []
  1390. }),
  1391. smalltalk.String);
  1392. smalltalk.addMethod(
  1393. unescape('_asLowercase'),
  1394. smalltalk.method({
  1395. selector: unescape('asLowercase'),
  1396. category: 'converting',
  1397. fn: function (){
  1398. var self=this;
  1399. return self.toLowerCase();
  1400. return self;},
  1401. args: [],
  1402. source: unescape('asLowercase%0A%09%3Creturn%20self.toLowerCase%28%29%3E'),
  1403. messageSends: [],
  1404. referencedClasses: []
  1405. }),
  1406. smalltalk.String);
  1407. smalltalk.addMethod(
  1408. unescape('_asUppercase'),
  1409. smalltalk.method({
  1410. selector: unescape('asUppercase'),
  1411. category: 'converting',
  1412. fn: function (){
  1413. var self=this;
  1414. return self.toUpperCase();
  1415. return self;},
  1416. args: [],
  1417. source: unescape('asUppercase%0A%09%3Creturn%20self.toUpperCase%28%29%3E'),
  1418. messageSends: [],
  1419. referencedClasses: []
  1420. }),
  1421. smalltalk.String);
  1422. smalltalk.addMethod(
  1423. unescape('_join_'),
  1424. smalltalk.method({
  1425. selector: unescape('join%3A'),
  1426. category: 'split join',
  1427. fn: function (aCollection){
  1428. var self=this;
  1429. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
  1430. return self;},
  1431. args: ["aCollection"],
  1432. source: unescape('join%3A%20aCollection%20%0A%09%5E%20String%0A%09%09streamContents%3A%20%5B%3Astream%20%7C%20aCollection%0A%09%09%09%09do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%20asString%5D%20%0A%09%09%09%09separatedBy%3A%20%5Bstream%20nextPutAll%3A%20self%5D%5D'),
  1433. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  1434. referencedClasses: ["String"]
  1435. }),
  1436. smalltalk.String);
  1437. smalltalk.addMethod(
  1438. unescape('_includesSubString_'),
  1439. smalltalk.method({
  1440. selector: unescape('includesSubString%3A'),
  1441. category: 'testing',
  1442. fn: function (subString){
  1443. var self=this;
  1444. return self.indexOf(subString) != -1 ;
  1445. return self;},
  1446. args: ["subString"],
  1447. source: unescape('includesSubString%3A%20subString%0A%09%3C%20return%20self.indexOf%28subString%29%20%21%3D%20-1%20%3E'),
  1448. messageSends: [],
  1449. referencedClasses: []
  1450. }),
  1451. smalltalk.String);
  1452. smalltalk.addMethod(
  1453. unescape('_asciiValue'),
  1454. smalltalk.method({
  1455. selector: unescape('asciiValue'),
  1456. category: 'accessing',
  1457. fn: function (){
  1458. var self=this;
  1459. return self.charCodeAt(0);;
  1460. return self;},
  1461. args: [],
  1462. source: unescape('asciiValue%0A%09%3Creturn%20self.charCodeAt%280%29%3B%3E'),
  1463. messageSends: [],
  1464. referencedClasses: []
  1465. }),
  1466. smalltalk.String);
  1467. smalltalk.addMethod(
  1468. unescape('_lineIndicesDo_'),
  1469. smalltalk.method({
  1470. selector: unescape('lineIndicesDo%3A'),
  1471. category: 'split join',
  1472. fn: function (aBlock){
  1473. var self=this;
  1474. try{var cr=nil;
  1475. var lf=nil;
  1476. var start=nil;
  1477. var sz=nil;
  1478. var nextLF=nil;
  1479. var nextCR=nil;
  1480. start=(1);
  1481. sz=smalltalk.send(self, "_size", []);
  1482. cr=smalltalk.send((smalltalk.String || String), "_cr", []);
  1483. nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]);
  1484. lf=smalltalk.send((smalltalk.String || String), "_lf", []);
  1485. nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]);
  1486. (function(){while((function(){return ((($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]));})()) {(function(){((($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})]));return ((($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]));})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})]));})]));})()}})();
  1487. return self;
  1488. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}},
  1489. args: ["aBlock"],
  1490. source: unescape('lineIndicesDo%3A%20aBlock%0A%09%22execute%20aBlock%20with%203%20arguments%20for%20each%20line%3A%0A%09-%20start%20index%20of%20line%0A%09-%20end%20index%20of%20line%20without%20line%20delimiter%0A%09-%20end%20index%20of%20line%20including%20line%20delimiter%28s%29%20CR%2C%20LF%20or%20CRLF%22%0A%09%0A%09%7C%20cr%20lf%20start%20sz%20nextLF%20nextCR%20%7C%0A%09start%20%3A%3D%201.%0A%09sz%20%3A%3D%20self%20size.%0A%09cr%20%3A%3D%20String%20cr.%0A%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%201.%0A%09lf%20%3A%3D%20String%20lf.%0A%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%201.%0A%09%5B%20start%20%3C%3D%20sz%20%5D%20whileTrue%3A%20%5B%0A%09%09%28nextLF%20%3D%200%20and%3A%20%5B%20nextCR%20%3D%200%20%5D%29%0A%09%09%09ifTrue%3A%20%5B%20%22No%20more%20CR%2C%20nor%20LF%2C%20the%20string%20is%20over%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20sz%20value%3A%20sz.%0A%09%09%09%09%09%5Eself%20%5D.%0A%09%09%28nextCR%20%3D%200%20or%3A%20%5B%200%20%3C%20nextLF%20and%3A%20%5B%20nextLF%20%3C%20nextCR%20%5D%20%5D%29%0A%09%09%09ifTrue%3A%20%5B%20%22Found%20a%20LF%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextLF%20-%201%20value%3A%20nextLF.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextLF.%0A%09%09%09%09%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%20start%20%5D%0A%09%09%09ifFalse%3A%20%5B%201%20+%20nextCR%20%3D%20nextLF%0A%09%09%09%09ifTrue%3A%20%5B%20%22Found%20a%20CR-LF%20pair%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextCR%20-%201%20value%3A%20nextLF.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextLF.%0A%09%09%09%09%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%20start.%0A%09%09%09%09%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%20start%20%5D%0A%09%09%09%09ifFalse%3A%20%5B%20%22Found%20a%20CR%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextCR%20-%201%20value%3A%20nextCR.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextCR.%0A%09%09%09%09%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%20start%20%5D%5D%5D'),
  1491. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", unescape("%3C%3D"), "ifTrue:", "and:", unescape("%3D"), "value:value:value:", "ifTrue:ifFalse:", "or:", unescape("%3C"), unescape("-"), unescape("+")],
  1492. referencedClasses: ["String"]
  1493. }),
  1494. smalltalk.String);
  1495. smalltalk.addMethod(
  1496. unescape('_linesDo_'),
  1497. smalltalk.method({
  1498. selector: unescape('linesDo%3A'),
  1499. category: 'split join',
  1500. fn: function (aBlock){
  1501. var self=this;
  1502. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  1503. return self;},
  1504. args: ["aBlock"],
  1505. source: unescape('linesDo%3A%20aBlock%0A%09%22Execute%20aBlock%20with%20each%20line%20in%20this%20string.%20The%20terminating%20line%0A%09delimiters%20CR%2C%20LF%20or%20CRLF%20pairs%20are%20not%20included%20in%20what%20is%20passed%20to%20aBlock%22%0A%0A%09self%20lineIndicesDo%3A%20%5B%3Astart%20%3AendWithoutDelimiters%20%3Aend%20%7C%0A%09%09aBlock%20value%3A%20%28self%20copyFrom%3A%20start%20to%3A%20endWithoutDelimiters%29%5D'),
  1506. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"],
  1507. referencedClasses: []
  1508. }),
  1509. smalltalk.String);
  1510. smalltalk.addMethod(
  1511. unescape('_lines'),
  1512. smalltalk.method({
  1513. selector: unescape('lines'),
  1514. category: 'split join',
  1515. fn: function (){
  1516. var self=this;
  1517. var lines=nil;
  1518. lines=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1519. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  1520. return lines;
  1521. return self;},
  1522. args: [],
  1523. source: unescape('lines%0A%09%22Answer%20an%20array%20of%20lines%20composing%20this%20receiver%20without%20the%20line%20ending%20delimiters.%22%0A%0A%09%7C%20lines%20%7C%0A%09lines%20%3A%3D%20Array%20new.%0A%09self%20linesDo%3A%20%5B%3AaLine%20%7C%20lines%20add%3A%20aLine%5D.%0A%09%5Elines'),
  1524. messageSends: ["new", "linesDo:", "add:"],
  1525. referencedClasses: ["Array"]
  1526. }),
  1527. smalltalk.String);
  1528. smalltalk.addMethod(
  1529. unescape('_lineNumber_'),
  1530. smalltalk.method({
  1531. selector: unescape('lineNumber%3A'),
  1532. category: 'split join',
  1533. fn: function (anIndex){
  1534. var self=this;
  1535. try{var lineCount=nil;
  1536. lineCount=(0);
  1537. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return ((($receiver = smalltalk.send(lineCount=((($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})]));})]);
  1538. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  1539. return self;
  1540. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}},
  1541. args: ["anIndex"],
  1542. source: unescape('lineNumber%3A%20anIndex%0A%09%22Answer%20a%20string%20containing%20the%20characters%20in%20the%20given%20line%20number.%22%0A%0A%09%7C%20lineCount%20%7C%0A%09lineCount%20%3A%3D%200.%0A%09self%20lineIndicesDo%3A%20%5B%3Astart%20%3AendWithoutDelimiters%20%3Aend%20%7C%0A%09%09%28lineCount%20%3A%3D%20lineCount%20+%201%29%20%3D%20anIndex%20ifTrue%3A%20%5B%5Eself%20copyFrom%3A%20start%20to%3A%20endWithoutDelimiters%5D%5D.%0A%09%5Enil'),
  1543. messageSends: ["lineIndicesDo:", "ifTrue:", unescape("%3D"), unescape("+"), "copyFrom:to:"],
  1544. referencedClasses: []
  1545. }),
  1546. smalltalk.String);
  1547. smalltalk.addMethod(
  1548. unescape('_reversed'),
  1549. smalltalk.method({
  1550. selector: unescape('reversed'),
  1551. category: 'converting',
  1552. fn: function (){
  1553. var self=this;
  1554. return self.split("").reverse().join("");
  1555. return self;},
  1556. args: [],
  1557. source: unescape('reversed%0A%09%3Creturn%20self.split%28%22%22%29.reverse%28%29.join%28%22%22%29%3E'),
  1558. messageSends: [],
  1559. referencedClasses: []
  1560. }),
  1561. smalltalk.String);
  1562. smalltalk.addMethod(
  1563. unescape('__eq_eq'),
  1564. smalltalk.method({
  1565. selector: unescape('%3D%3D'),
  1566. category: 'comparing',
  1567. fn: function (aString){
  1568. var self=this;
  1569. try{((($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]));
  1570. return String(self) === String(aString);
  1571. return self;
  1572. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}},
  1573. args: ["aString"],
  1574. source: unescape('%3D%3D%20aString%0A%09aString%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20String%28self%29%20%3D%3D%3D%20String%28aString%29%3E'),
  1575. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.String);
  1579. smalltalk.addMethod(
  1580. unescape('_asJavaScriptSelector'),
  1581. smalltalk.method({
  1582. selector: unescape('asJavaScriptSelector'),
  1583. category: 'converting',
  1584. fn: function (){
  1585. var self=this;
  1586. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  1587. return self;},
  1588. args: [],
  1589. source: unescape('asJavaScriptSelector%0A%09%5E%28self%20asSelector%20replace%3A%20%27%5E_%27%20with%3A%20%27%27%29%20replace%3A%20%27_.*%27%20with%3A%20%27%27.'),
  1590. messageSends: ["replace:with:", "asSelector"],
  1591. referencedClasses: []
  1592. }),
  1593. smalltalk.String);
  1594. smalltalk.addMethod(
  1595. unescape('_streamClass'),
  1596. smalltalk.method({
  1597. selector: unescape('streamClass'),
  1598. category: 'accessing',
  1599. fn: function (){
  1600. var self=this;
  1601. return (smalltalk.StringStream || StringStream);
  1602. return self;},
  1603. args: [],
  1604. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream'),
  1605. messageSends: [],
  1606. referencedClasses: ["StringStream"]
  1607. }),
  1608. smalltalk.String.klass);
  1609. smalltalk.addMethod(
  1610. unescape('_fromString_'),
  1611. smalltalk.method({
  1612. selector: unescape('fromString%3A'),
  1613. category: 'instance creation',
  1614. fn: function (aString){
  1615. var self=this;
  1616. return new self.fn(aString);
  1617. return self;},
  1618. args: ["aString"],
  1619. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%3Creturn%20new%20self.fn%28aString%29%3E'),
  1620. messageSends: [],
  1621. referencedClasses: []
  1622. }),
  1623. smalltalk.String.klass);
  1624. smalltalk.addMethod(
  1625. unescape('_cr'),
  1626. smalltalk.method({
  1627. selector: unescape('cr'),
  1628. category: 'accessing',
  1629. fn: function (){
  1630. var self=this;
  1631. return '\r';
  1632. return self;},
  1633. args: [],
  1634. source: unescape('cr%0A%09%3Creturn%20%27%5Cr%27%3E'),
  1635. messageSends: [],
  1636. referencedClasses: []
  1637. }),
  1638. smalltalk.String.klass);
  1639. smalltalk.addMethod(
  1640. unescape('_lf'),
  1641. smalltalk.method({
  1642. selector: unescape('lf'),
  1643. category: 'accessing',
  1644. fn: function (){
  1645. var self=this;
  1646. return '\n';
  1647. return self;},
  1648. args: [],
  1649. source: unescape('lf%0A%09%3Creturn%20%27%5Cn%27%3E'),
  1650. messageSends: [],
  1651. referencedClasses: []
  1652. }),
  1653. smalltalk.String.klass);
  1654. smalltalk.addMethod(
  1655. unescape('_space'),
  1656. smalltalk.method({
  1657. selector: unescape('space'),
  1658. category: 'accessing',
  1659. fn: function (){
  1660. var self=this;
  1661. return ' ';
  1662. return self;},
  1663. args: [],
  1664. source: unescape('space%0A%09%3Creturn%20%27%20%27%3E'),
  1665. messageSends: [],
  1666. referencedClasses: []
  1667. }),
  1668. smalltalk.String.klass);
  1669. smalltalk.addMethod(
  1670. unescape('_tab'),
  1671. smalltalk.method({
  1672. selector: unescape('tab'),
  1673. category: 'accessing',
  1674. fn: function (){
  1675. var self=this;
  1676. return '\t';
  1677. return self;},
  1678. args: [],
  1679. source: unescape('tab%0A%09%3Creturn%20%27%5Ct%27%3E'),
  1680. messageSends: [],
  1681. referencedClasses: []
  1682. }),
  1683. smalltalk.String.klass);
  1684. smalltalk.addMethod(
  1685. unescape('_crlf'),
  1686. smalltalk.method({
  1687. selector: unescape('crlf'),
  1688. category: 'accessing',
  1689. fn: function (){
  1690. var self=this;
  1691. return '\r\n';
  1692. return self;},
  1693. args: [],
  1694. source: unescape('crlf%0A%09%3Creturn%20%27%5Cr%5Cn%27%3E'),
  1695. messageSends: [],
  1696. referencedClasses: []
  1697. }),
  1698. smalltalk.String.klass);
  1699. smalltalk.addMethod(
  1700. unescape('_streamContents_'),
  1701. smalltalk.method({
  1702. selector: unescape('streamContents%3A'),
  1703. category: 'instance creation',
  1704. fn: function (blockWithArg){
  1705. var self=this;
  1706. var stream=nil;
  1707. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  1708. smalltalk.send(blockWithArg, "_value_", [stream]);
  1709. return smalltalk.send(stream, "_contents", []);
  1710. return self;},
  1711. args: ["blockWithArg"],
  1712. source: unescape('streamContents%3A%20blockWithArg%0A%09%7Cstream%7C%0A%09stream%20%3A%3D%20%28self%20streamClass%20on%3A%20String%20new%29.%0A%09blockWithArg%20value%3A%20stream.%0A%09%5E%20stream%20contents'),
  1713. messageSends: ["on:", "streamClass", "new", "value:", "contents"],
  1714. referencedClasses: ["String"]
  1715. }),
  1716. smalltalk.String.klass);
  1717. smalltalk.addMethod(
  1718. unescape('_value_'),
  1719. smalltalk.method({
  1720. selector: unescape('value%3A'),
  1721. category: 'instance creation',
  1722. fn: function (aUTFCharCode){
  1723. var self=this;
  1724. return String.fromCharCode(aUTFCharCode);;
  1725. return self;},
  1726. args: ["aUTFCharCode"],
  1727. source: unescape('value%3A%20aUTFCharCode%0A%0A%09%3Creturn%20String.fromCharCode%28aUTFCharCode%29%3B%3E'),
  1728. messageSends: [],
  1729. referencedClasses: []
  1730. }),
  1731. smalltalk.String.klass);
  1732. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1733. smalltalk.addMethod(
  1734. unescape('_size'),
  1735. smalltalk.method({
  1736. selector: unescape('size'),
  1737. category: 'accessing',
  1738. fn: function (){
  1739. var self=this;
  1740. return self.length;
  1741. return self;},
  1742. args: [],
  1743. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  1744. messageSends: [],
  1745. referencedClasses: []
  1746. }),
  1747. smalltalk.Array);
  1748. smalltalk.addMethod(
  1749. unescape('_at_put_'),
  1750. smalltalk.method({
  1751. selector: unescape('at%3Aput%3A'),
  1752. category: 'accessing',
  1753. fn: function (anIndex, anObject){
  1754. var self=this;
  1755. return self[anIndex - 1] = anObject;
  1756. return self;},
  1757. args: ["anIndex", "anObject"],
  1758. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  1759. messageSends: [],
  1760. referencedClasses: []
  1761. }),
  1762. smalltalk.Array);
  1763. smalltalk.addMethod(
  1764. unescape('_at_ifAbsent_'),
  1765. smalltalk.method({
  1766. selector: unescape('at%3AifAbsent%3A'),
  1767. category: 'accessing',
  1768. fn: function (anIndex, aBlock){
  1769. var self=this;
  1770. var value = self[anIndex - 1];
  1771. if(value === undefined) {
  1772. return aBlock();
  1773. } else {
  1774. return value;
  1775. }
  1776. ;
  1777. return self;},
  1778. args: ["anIndex", "aBlock"],
  1779. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  1780. messageSends: [],
  1781. referencedClasses: []
  1782. }),
  1783. smalltalk.Array);
  1784. smalltalk.addMethod(
  1785. unescape('_add_'),
  1786. smalltalk.method({
  1787. selector: unescape('add%3A'),
  1788. category: 'adding/removing',
  1789. fn: function (anObject){
  1790. var self=this;
  1791. self.push(anObject); return anObject;;
  1792. return self;},
  1793. args: ["anObject"],
  1794. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  1795. messageSends: [],
  1796. referencedClasses: []
  1797. }),
  1798. smalltalk.Array);
  1799. smalltalk.addMethod(
  1800. unescape('_shallowCopy'),
  1801. smalltalk.method({
  1802. selector: unescape('shallowCopy'),
  1803. category: 'copying',
  1804. fn: function (){
  1805. var self=this;
  1806. var newCollection=nil;
  1807. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  1808. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  1809. return newCollection;
  1810. return self;},
  1811. args: [],
  1812. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%5D.%0A%09%5EnewCollection'),
  1813. messageSends: ["new", "class", "do:", "add:"],
  1814. referencedClasses: []
  1815. }),
  1816. smalltalk.Array);
  1817. smalltalk.addMethod(
  1818. unescape('_deepCopy'),
  1819. smalltalk.method({
  1820. selector: unescape('deepCopy'),
  1821. category: 'copying',
  1822. fn: function (){
  1823. var self=this;
  1824. var newCollection=nil;
  1825. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  1826. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  1827. return newCollection;
  1828. return self;},
  1829. args: [],
  1830. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection'),
  1831. messageSends: ["new", "class", "do:", "add:", "deepCopy"],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.Array);
  1835. smalltalk.addMethod(
  1836. unescape('_copyFrom_to_'),
  1837. smalltalk.method({
  1838. selector: unescape('copyFrom%3Ato%3A'),
  1839. category: 'copying',
  1840. fn: function (anIndex, anotherIndex){
  1841. var self=this;
  1842. var array=nil;
  1843. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  1844. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  1845. return array;
  1846. return self;},
  1847. args: ["anIndex", "anotherIndex"],
  1848. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20array%20%7C%0A%09array%20%3A%3D%20self%20class%20new.%0A%09anIndex%20to%3A%20anotherIndex%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20array%20add%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5Earray'),
  1849. messageSends: ["new", "class", "to:do:", "add:", "at:"],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.Array);
  1853. smalltalk.addMethod(
  1854. unescape('_join_'),
  1855. smalltalk.method({
  1856. selector: unescape('join%3A'),
  1857. category: 'enumerating',
  1858. fn: function (aString){
  1859. var self=this;
  1860. return self.join(aString);
  1861. return self;},
  1862. args: ["aString"],
  1863. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  1864. messageSends: [],
  1865. referencedClasses: []
  1866. }),
  1867. smalltalk.Array);
  1868. smalltalk.addMethod(
  1869. unescape('_asJavascript'),
  1870. smalltalk.method({
  1871. selector: unescape('asJavascript'),
  1872. category: 'converting',
  1873. fn: function (){
  1874. var self=this;
  1875. return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
  1876. return self;},
  1877. args: [],
  1878. source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27'),
  1879. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  1880. referencedClasses: []
  1881. }),
  1882. smalltalk.Array);
  1883. smalltalk.addMethod(
  1884. unescape('_sort'),
  1885. smalltalk.method({
  1886. selector: unescape('sort'),
  1887. category: 'enumerating',
  1888. fn: function (){
  1889. var self=this;
  1890. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  1891. return self;},
  1892. args: [],
  1893. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  1894. messageSends: ["basicPerform:"],
  1895. referencedClasses: []
  1896. }),
  1897. smalltalk.Array);
  1898. smalltalk.addMethod(
  1899. unescape('_sort_'),
  1900. smalltalk.method({
  1901. selector: unescape('sort%3A'),
  1902. category: 'enumerating',
  1903. fn: function (aBlock){
  1904. var self=this;
  1905. return self.sort(function(a, b) {
  1906. if(aBlock(a,b)) {return -1} else {return 1}
  1907. })
  1908. ;
  1909. return self;},
  1910. args: ["aBlock"],
  1911. source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
  1912. messageSends: [],
  1913. referencedClasses: []
  1914. }),
  1915. smalltalk.Array);
  1916. smalltalk.addMethod(
  1917. unescape('_remove_'),
  1918. smalltalk.method({
  1919. selector: unescape('remove%3A'),
  1920. category: 'adding/removing',
  1921. fn: function (anObject){
  1922. var self=this;
  1923. for(var i=0;i<self.length;i++) {
  1924. if(self[i] == anObject) {
  1925. self.splice(i,1);
  1926. break;
  1927. }
  1928. }
  1929. ;
  1930. return self;},
  1931. args: ["anObject"],
  1932. source: unescape('remove%3A%20anObject%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%3E'),
  1933. messageSends: [],
  1934. referencedClasses: []
  1935. }),
  1936. smalltalk.Array);
  1937. smalltalk.addMethod(
  1938. unescape('_sorted'),
  1939. smalltalk.method({
  1940. selector: unescape('sorted'),
  1941. category: 'enumerating',
  1942. fn: function (){
  1943. var self=this;
  1944. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  1945. return self;},
  1946. args: [],
  1947. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  1948. messageSends: ["sort", "copy"],
  1949. referencedClasses: []
  1950. }),
  1951. smalltalk.Array);
  1952. smalltalk.addMethod(
  1953. unescape('_sorted_'),
  1954. smalltalk.method({
  1955. selector: unescape('sorted%3A'),
  1956. category: 'enumerating',
  1957. fn: function (aBlock){
  1958. var self=this;
  1959. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  1960. return self;},
  1961. args: ["aBlock"],
  1962. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  1963. messageSends: ["sort:", "copy"],
  1964. referencedClasses: []
  1965. }),
  1966. smalltalk.Array);
  1967. smalltalk.addMethod(
  1968. unescape('_removeFrom_to_'),
  1969. smalltalk.method({
  1970. selector: unescape('removeFrom%3Ato%3A'),
  1971. category: 'adding/removing',
  1972. fn: function (aNumber, anotherNumber){
  1973. var self=this;
  1974. self.splice(aNumber - 1,anotherNumber - 1);
  1975. return self;},
  1976. args: ["aNumber", "anotherNumber"],
  1977. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  1978. messageSends: [],
  1979. referencedClasses: []
  1980. }),
  1981. smalltalk.Array);
  1982. smalltalk.addMethod(
  1983. unescape('_printString'),
  1984. smalltalk.method({
  1985. selector: unescape('printString'),
  1986. category: 'enumerating',
  1987. fn: function (){
  1988. var self=this;
  1989. var str=nil;
  1990. str=smalltalk.send("", "_writeStream", []);
  1991. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  1992. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  1993. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  1994. return smalltalk.send(str, "_contents", []);
  1995. return self;},
  1996. args: [],
  1997. source: unescape('printString%0A%09%7C%20str%20%7C%0A%09str%20%3A%3D%20%27%27%20writeStream.%0A%09str%20nextPutAll%3A%20super%20printString%2C%20%27%20%28%27.%0A%09self%20%0A%09%09do%3A%20%5B%3Aeach%20%7C%20str%20nextPutAll%3A%20each%20printString%5D%0A%09%09separatedBy%3A%20%5Bstr%20nextPutAll%3A%20%27%20%27%5D.%0A%09str%20nextPutAll%3A%20%27%29%27.%0A%09%5Estr%20contents'),
  1998. messageSends: ["writeStream", "nextPutAll:", unescape("%2C"), "printString", "do:separatedBy:", "contents"],
  1999. referencedClasses: []
  2000. }),
  2001. smalltalk.Array);
  2002. smalltalk.addMethod(
  2003. unescape('_reversed'),
  2004. smalltalk.method({
  2005. selector: unescape('reversed'),
  2006. category: 'converting',
  2007. fn: function (){
  2008. var self=this;
  2009. return self._copy().reverse();
  2010. return self;},
  2011. args: [],
  2012. source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
  2013. messageSends: [],
  2014. referencedClasses: []
  2015. }),
  2016. smalltalk.Array);
  2017. smalltalk.addMethod(
  2018. unescape('__eq'),
  2019. smalltalk.method({
  2020. selector: unescape('%3D'),
  2021. category: 'comparing',
  2022. fn: function (aCollection){
  2023. var self=this;
  2024. try{((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  2025. smalltalk.send(self, "_withIndexDo_", [(function(each, i){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));})]);
  2026. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  2027. return self;
  2028. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2029. args: ["aCollection"],
  2030. source: unescape('%3D%20aCollection%0A%09%28self%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%20%20%20%20%20%20%20%20%09self%20size%20%3D%20aCollection%20size%5D%29%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28aCollection%20at%3A%20i%29%20%3D%20each%20ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue'),
  2031. messageSends: ["ifFalse:", "and:", unescape("%3D"), "class", "size", "withIndexDo:", "at:"],
  2032. referencedClasses: []
  2033. }),
  2034. smalltalk.Array);
  2035. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  2036. smalltalk.addMethod(
  2037. unescape('_compile_'),
  2038. smalltalk.method({
  2039. selector: unescape('compile%3A'),
  2040. category: 'evaluating',
  2041. fn: function (aString){
  2042. var self=this;
  2043. return self.compile(aString);
  2044. return self;},
  2045. args: ["aString"],
  2046. source: unescape('compile%3A%20aString%0A%09%3Creturn%20self.compile%28aString%29%3E'),
  2047. messageSends: [],
  2048. referencedClasses: []
  2049. }),
  2050. smalltalk.RegularExpression);
  2051. smalltalk.addMethod(
  2052. unescape('_exec_'),
  2053. smalltalk.method({
  2054. selector: unescape('exec%3A'),
  2055. category: 'evaluating',
  2056. fn: function (aString){
  2057. var self=this;
  2058. return self.exec(aString) || nil;
  2059. return self;},
  2060. args: ["aString"],
  2061. source: unescape('exec%3A%20aString%0A%09%3Creturn%20self.exec%28aString%29%20%7C%7C%20nil%3E'),
  2062. messageSends: [],
  2063. referencedClasses: []
  2064. }),
  2065. smalltalk.RegularExpression);
  2066. smalltalk.addMethod(
  2067. unescape('_test_'),
  2068. smalltalk.method({
  2069. selector: unescape('test%3A'),
  2070. category: 'evaluating',
  2071. fn: function (aString){
  2072. var self=this;
  2073. return self.test(aString);
  2074. return self;},
  2075. args: ["aString"],
  2076. source: unescape('test%3A%20aString%0A%09%3Creturn%20self.test%28aString%29%3E'),
  2077. messageSends: [],
  2078. referencedClasses: []
  2079. }),
  2080. smalltalk.RegularExpression);
  2081. smalltalk.addMethod(
  2082. unescape('_fromString_flag_'),
  2083. smalltalk.method({
  2084. selector: unescape('fromString%3Aflag%3A'),
  2085. category: 'instance creation',
  2086. fn: function (aString, anotherString){
  2087. var self=this;
  2088. return new RegExp(aString, anotherString);
  2089. return self;},
  2090. args: ["aString", "anotherString"],
  2091. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%3Creturn%20new%20RegExp%28aString%2C%20anotherString%29%3E'),
  2092. messageSends: [],
  2093. referencedClasses: []
  2094. }),
  2095. smalltalk.RegularExpression.klass);
  2096. smalltalk.addMethod(
  2097. unescape('_fromString_'),
  2098. smalltalk.method({
  2099. selector: unescape('fromString%3A'),
  2100. category: 'instance creation',
  2101. fn: function (aString){
  2102. var self=this;
  2103. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  2104. return self;},
  2105. args: ["aString"],
  2106. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27'),
  2107. messageSends: ["fromString:flag:"],
  2108. referencedClasses: []
  2109. }),
  2110. smalltalk.RegularExpression.klass);
  2111. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  2112. smalltalk.addMethod(
  2113. unescape('__eq'),
  2114. smalltalk.method({
  2115. selector: unescape('%3D'),
  2116. category: 'comparing',
  2117. fn: function (anAssociation){
  2118. var self=this;
  2119. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
  2120. return self;},
  2121. args: ["anAssociation"],
  2122. source: unescape('%3D%20anAssociation%0A%09%5Eself%20class%20%3D%20anAssociation%20class%20and%3A%20%5B%0A%09%20%20%20%20self%20key%20%3D%20anAssociation%20key%20and%3A%20%5B%0A%09%09self%20value%20%3D%20anAssociation%20value%5D%5D'),
  2123. messageSends: ["and:", unescape("%3D"), "class", "key", "value"],
  2124. referencedClasses: []
  2125. }),
  2126. smalltalk.Association);
  2127. smalltalk.addMethod(
  2128. unescape('_key_'),
  2129. smalltalk.method({
  2130. selector: unescape('key%3A'),
  2131. category: 'accessing',
  2132. fn: function (aKey){
  2133. var self=this;
  2134. self['@key']=aKey;
  2135. return self;},
  2136. args: ["aKey"],
  2137. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey'),
  2138. messageSends: [],
  2139. referencedClasses: []
  2140. }),
  2141. smalltalk.Association);
  2142. smalltalk.addMethod(
  2143. unescape('_key'),
  2144. smalltalk.method({
  2145. selector: unescape('key'),
  2146. category: 'accessing',
  2147. fn: function (){
  2148. var self=this;
  2149. return self['@key'];
  2150. return self;},
  2151. args: [],
  2152. source: unescape('key%0A%09%5Ekey'),
  2153. messageSends: [],
  2154. referencedClasses: []
  2155. }),
  2156. smalltalk.Association);
  2157. smalltalk.addMethod(
  2158. unescape('_value_'),
  2159. smalltalk.method({
  2160. selector: unescape('value%3A'),
  2161. category: 'accessing',
  2162. fn: function (aValue){
  2163. var self=this;
  2164. self['@value']=aValue;
  2165. return self;},
  2166. args: ["aValue"],
  2167. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue'),
  2168. messageSends: [],
  2169. referencedClasses: []
  2170. }),
  2171. smalltalk.Association);
  2172. smalltalk.addMethod(
  2173. unescape('_value'),
  2174. smalltalk.method({
  2175. selector: unescape('value'),
  2176. category: 'accessing',
  2177. fn: function (){
  2178. var self=this;
  2179. return self['@value'];
  2180. return self;},
  2181. args: [],
  2182. source: unescape('value%0A%09%5Evalue'),
  2183. messageSends: [],
  2184. referencedClasses: []
  2185. }),
  2186. smalltalk.Association);
  2187. smalltalk.addMethod(
  2188. unescape('_storeOn_'),
  2189. smalltalk.method({
  2190. selector: unescape('storeOn%3A'),
  2191. category: 'comparing',
  2192. fn: function (aStream){
  2193. var self=this;
  2194. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  2195. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  2196. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  2197. return self;},
  2198. args: ["aStream"],
  2199. source: unescape('storeOn%3A%20aStream%0A%09%22Store%20in%20the%20format%20%28key-%3Evalue%29%22%0A%0A%09%22aStream%20nextPutAll%3A%20%27%28%27.%22%0A%09key%20storeOn%3A%20aStream.%0A%09aStream%20nextPutAll%3A%20%27-%3E%27.%0A%09value%20storeOn%3A%20aStream.%0A%09%22aStream%20nextPutAll%3A%20%27%29%27%22'),
  2200. messageSends: ["storeOn:", "nextPutAll:"],
  2201. referencedClasses: []
  2202. }),
  2203. smalltalk.Association);
  2204. smalltalk.addMethod(
  2205. unescape('_key_value_'),
  2206. smalltalk.method({
  2207. selector: unescape('key%3Avalue%3A'),
  2208. category: 'instance creation',
  2209. fn: function (aKey, aValue){
  2210. var self=this;
  2211. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2212. return self;},
  2213. args: ["aKey", "aValue"],
  2214. source: unescape('key%3A%20aKey%20value%3A%20aValue%0A%09%20%20%20%20%5Eself%20new%0A%09%09key%3A%20aKey%3B%0A%09%09value%3A%20aValue%3B%0A%09%09yourself'),
  2215. messageSends: ["key:", "value:", "yourself", "new"],
  2216. referencedClasses: []
  2217. }),
  2218. smalltalk.Association.klass);
  2219. smalltalk.addClass('Dictionary', smalltalk.Collection, [], 'Kernel-Collections');
  2220. smalltalk.addMethod(
  2221. unescape('__eq'),
  2222. smalltalk.method({
  2223. selector: unescape('%3D'),
  2224. category: 'comparing',
  2225. fn: function (aDictionary){
  2226. var self=this;
  2227. try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  2228. ((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aDictionary, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  2229. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  2230. return self;
  2231. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2232. args: ["aDictionary"],
  2233. source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20size%20%3D%20aDictionary%20size%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20associations%20%3D%20aDictionary%20associations'),
  2234. messageSends: ["ifFalse:", unescape("%3D"), "class", "size", "associations"],
  2235. referencedClasses: []
  2236. }),
  2237. smalltalk.Dictionary);
  2238. smalltalk.addMethod(
  2239. unescape('_shallowCopy'),
  2240. smalltalk.method({
  2241. selector: unescape('shallowCopy'),
  2242. category: 'copying',
  2243. fn: function (){
  2244. var self=this;
  2245. var copy=nil;
  2246. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2247. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  2248. return copy;
  2249. return self;},
  2250. args: [],
  2251. source: unescape('shallowCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%5D.%0A%09%5Ecopy'),
  2252. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  2253. referencedClasses: []
  2254. }),
  2255. smalltalk.Dictionary);
  2256. smalltalk.addMethod(
  2257. unescape('_size'),
  2258. smalltalk.method({
  2259. selector: unescape('size'),
  2260. category: 'accessing',
  2261. fn: function (){
  2262. var self=this;
  2263. return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
  2264. return self;},
  2265. args: [],
  2266. source: unescape('size%0A%09%5Eself%20keys%20size'),
  2267. messageSends: ["size", "keys"],
  2268. referencedClasses: []
  2269. }),
  2270. smalltalk.Dictionary);
  2271. smalltalk.addMethod(
  2272. unescape('_associations'),
  2273. smalltalk.method({
  2274. selector: unescape('associations'),
  2275. category: 'accessing',
  2276. fn: function (){
  2277. var self=this;
  2278. var associations=nil;
  2279. associations=[];
  2280. smalltalk.send(smalltalk.send(self, "_keys", []), "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  2281. return associations;
  2282. return self;},
  2283. args: [],
  2284. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09self%20keys%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20associations%20add%3A%20%28Association%20key%3A%20each%20value%3A%20%28self%20at%3A%20each%29%29%5D.%0A%09%5Eassociations'),
  2285. messageSends: ["do:", "keys", "add:", "key:value:", "at:"],
  2286. referencedClasses: ["Association"]
  2287. }),
  2288. smalltalk.Dictionary);
  2289. smalltalk.addMethod(
  2290. unescape('_keys'),
  2291. smalltalk.method({
  2292. selector: unescape('keys'),
  2293. category: 'accessing',
  2294. fn: function (){
  2295. var self=this;
  2296. var keys = [];
  2297. for(var i in self) {
  2298. if(self.hasOwnProperty(i)) {
  2299. keys.push(i);
  2300. }
  2301. };
  2302. return keys;
  2303. ;
  2304. return self;},
  2305. args: [],
  2306. source: unescape('keys%0A%09%3C%0A%09%09var%20keys%20%3D%20%5B%5D%3B%0A%09%09for%28var%20i%20in%20self%29%20%7B%0A%09%09%09if%28self.hasOwnProperty%28i%29%29%20%7B%0A%09%09%09%09keys.push%28i%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09return%20keys%3B%0A%09%3E'),
  2307. messageSends: [],
  2308. referencedClasses: []
  2309. }),
  2310. smalltalk.Dictionary);
  2311. smalltalk.addMethod(
  2312. unescape('_values'),
  2313. smalltalk.method({
  2314. selector: unescape('values'),
  2315. category: 'accessing',
  2316. fn: function (){
  2317. var self=this;
  2318. return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  2319. return self;},
  2320. args: [],
  2321. source: unescape('values%0A%20%20%20%20%09%5Eself%20keys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D'),
  2322. messageSends: ["collect:", "keys", "at:"],
  2323. referencedClasses: []
  2324. }),
  2325. smalltalk.Dictionary);
  2326. smalltalk.addMethod(
  2327. unescape('_at_put_'),
  2328. smalltalk.method({
  2329. selector: unescape('at%3Aput%3A'),
  2330. category: 'accessing',
  2331. fn: function (aKey, aValue){
  2332. var self=this;
  2333. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  2334. return self;},
  2335. args: ["aKey", "aValue"],
  2336. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue'),
  2337. messageSends: ["basicAt:put:"],
  2338. referencedClasses: []
  2339. }),
  2340. smalltalk.Dictionary);
  2341. smalltalk.addMethod(
  2342. unescape('_at_ifAbsent_'),
  2343. smalltalk.method({
  2344. selector: unescape('at%3AifAbsent%3A'),
  2345. category: 'accessing',
  2346. fn: function (aKey, aBlock){
  2347. var self=this;
  2348. return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  2349. return self;},
  2350. args: ["aKey", "aBlock"],
  2351. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20includesKey%3A%20aKey%29%0A%09%09ifTrue%3A%20%5Bself%20basicAt%3A%20aKey%5D%0A%09%09ifFalse%3A%20aBlock'),
  2352. messageSends: ["ifTrue:ifFalse:", "includesKey:", "basicAt:"],
  2353. referencedClasses: []
  2354. }),
  2355. smalltalk.Dictionary);
  2356. smalltalk.addMethod(
  2357. unescape('_at_ifAbsentPut_'),
  2358. smalltalk.method({
  2359. selector: unescape('at%3AifAbsentPut%3A'),
  2360. category: 'accessing',
  2361. fn: function (aKey, aBlock){
  2362. var self=this;
  2363. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  2364. return self;},
  2365. args: ["aKey", "aBlock"],
  2366. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%20%20%20%20%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%20%20%20%20%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D'),
  2367. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  2368. referencedClasses: []
  2369. }),
  2370. smalltalk.Dictionary);
  2371. smalltalk.addMethod(
  2372. unescape('_at_ifPresent_'),
  2373. smalltalk.method({
  2374. selector: unescape('at%3AifPresent%3A'),
  2375. category: 'accessing',
  2376. fn: function (aKey, aBlock){
  2377. var self=this;
  2378. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  2379. return self;},
  2380. args: ["aKey", "aBlock"],
  2381. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D'),
  2382. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  2383. referencedClasses: []
  2384. }),
  2385. smalltalk.Dictionary);
  2386. smalltalk.addMethod(
  2387. unescape('_at_ifPresent_ifAbsent_'),
  2388. smalltalk.method({
  2389. selector: unescape('at%3AifPresent%3AifAbsent%3A'),
  2390. category: 'accessing',
  2391. fn: function (aKey, aBlock, anotherBlock){
  2392. var self=this;
  2393. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  2394. return self;},
  2395. args: ["aKey", "aBlock", "anotherBlock"],
  2396. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%20ifAbsent%3A%20anotherBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%0A%09%20%20%20%20ifNil%3A%20anotherBlock%0A%09%20%20%20%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D'),
  2397. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  2398. referencedClasses: []
  2399. }),
  2400. smalltalk.Dictionary);
  2401. smalltalk.addMethod(
  2402. unescape('_add_'),
  2403. smalltalk.method({
  2404. selector: unescape('add%3A'),
  2405. category: 'adding/removing',
  2406. fn: function (anAssociation){
  2407. var self=this;
  2408. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  2409. return self;},
  2410. args: ["anAssociation"],
  2411. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value'),
  2412. messageSends: ["at:put:", "key", "value"],
  2413. referencedClasses: []
  2414. }),
  2415. smalltalk.Dictionary);
  2416. smalltalk.addMethod(
  2417. unescape('_addAll_'),
  2418. smalltalk.method({
  2419. selector: unescape('addAll%3A'),
  2420. category: 'adding/removing',
  2421. fn: function (aDictionary){
  2422. var self=this;
  2423. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  2424. return aDictionary;
  2425. return self;},
  2426. args: ["aDictionary"],
  2427. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary'),
  2428. messageSends: ["addAll:", "associations"],
  2429. referencedClasses: []
  2430. }),
  2431. smalltalk.Dictionary);
  2432. smalltalk.addMethod(
  2433. unescape('__comma'),
  2434. smalltalk.method({
  2435. selector: unescape('%2C'),
  2436. category: 'copying',
  2437. fn: function (aCollection){
  2438. var self=this;
  2439. smalltalk.send(self, "_shouldNotImplement", []);
  2440. return self;},
  2441. args: ["aCollection"],
  2442. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement'),
  2443. messageSends: ["shouldNotImplement"],
  2444. referencedClasses: []
  2445. }),
  2446. smalltalk.Dictionary);
  2447. smalltalk.addMethod(
  2448. unescape('_copyFrom_to_'),
  2449. smalltalk.method({
  2450. selector: unescape('copyFrom%3Ato%3A'),
  2451. category: 'copying',
  2452. fn: function (anIndex, anotherIndex){
  2453. var self=this;
  2454. smalltalk.send(self, "_shouldNotImplement", []);
  2455. return self;},
  2456. args: ["anIndex", "anotherIndex"],
  2457. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement'),
  2458. messageSends: ["shouldNotImplement"],
  2459. referencedClasses: []
  2460. }),
  2461. smalltalk.Dictionary);
  2462. smalltalk.addMethod(
  2463. unescape('_associationsDo_'),
  2464. smalltalk.method({
  2465. selector: unescape('associationsDo%3A'),
  2466. category: 'enumerating',
  2467. fn: function (aBlock){
  2468. var self=this;
  2469. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  2470. return self;},
  2471. args: ["aBlock"],
  2472. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock'),
  2473. messageSends: ["do:", "associations"],
  2474. referencedClasses: []
  2475. }),
  2476. smalltalk.Dictionary);
  2477. smalltalk.addMethod(
  2478. unescape('_keysAndValuesDo_'),
  2479. smalltalk.method({
  2480. selector: unescape('keysAndValuesDo%3A'),
  2481. category: 'enumerating',
  2482. fn: function (aBlock){
  2483. var self=this;
  2484. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  2485. return self;},
  2486. args: ["aBlock"],
  2487. source: unescape('keysAndValuesDo%3A%20aBlock%0A%20%20%20%20%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D'),
  2488. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  2489. referencedClasses: []
  2490. }),
  2491. smalltalk.Dictionary);
  2492. smalltalk.addMethod(
  2493. unescape('_do_'),
  2494. smalltalk.method({
  2495. selector: unescape('do%3A'),
  2496. category: 'enumerating',
  2497. fn: function (aBlock){
  2498. var self=this;
  2499. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  2500. return self;},
  2501. args: ["aBlock"],
  2502. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock'),
  2503. messageSends: ["do:", "values"],
  2504. referencedClasses: []
  2505. }),
  2506. smalltalk.Dictionary);
  2507. smalltalk.addMethod(
  2508. unescape('_select_'),
  2509. smalltalk.method({
  2510. selector: unescape('select%3A'),
  2511. category: 'enumerating',
  2512. fn: function (aBlock){
  2513. var self=this;
  2514. var newDict=nil;
  2515. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2516. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return ((($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]));})]);
  2517. return newDict;
  2518. return self;},
  2519. args: ["aBlock"],
  2520. source: unescape('select%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict'),
  2521. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  2522. referencedClasses: []
  2523. }),
  2524. smalltalk.Dictionary);
  2525. smalltalk.addMethod(
  2526. unescape('_collect_'),
  2527. smalltalk.method({
  2528. selector: unescape('collect%3A'),
  2529. category: 'enumerating',
  2530. fn: function (aBlock){
  2531. var self=this;
  2532. var newDict=nil;
  2533. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2534. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  2535. return newDict;
  2536. return self;},
  2537. args: ["aBlock"],
  2538. source: unescape('collect%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20newDict%20at%3A%20key%20put%3A%20%28aBlock%20value%3A%20value%29%5D.%0A%20%20%20%20%09%5EnewDict'),
  2539. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  2540. referencedClasses: []
  2541. }),
  2542. smalltalk.Dictionary);
  2543. smalltalk.addMethod(
  2544. unescape('_detect_ifNone_'),
  2545. smalltalk.method({
  2546. selector: unescape('detect%3AifNone%3A'),
  2547. category: 'enumerating',
  2548. fn: function (aBlock, anotherBlock){
  2549. var self=this;
  2550. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  2551. return self;},
  2552. args: ["aBlock", "anotherBlock"],
  2553. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  2554. messageSends: ["detect:ifNone:", "values"],
  2555. referencedClasses: []
  2556. }),
  2557. smalltalk.Dictionary);
  2558. smalltalk.addMethod(
  2559. unescape('_includes_'),
  2560. smalltalk.method({
  2561. selector: unescape('includes%3A'),
  2562. category: 'enumerating',
  2563. fn: function (anObject){
  2564. var self=this;
  2565. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  2566. return self;},
  2567. args: ["anObject"],
  2568. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject'),
  2569. messageSends: ["includes:", "values"],
  2570. referencedClasses: []
  2571. }),
  2572. smalltalk.Dictionary);
  2573. smalltalk.addMethod(
  2574. unescape('_removeKey_'),
  2575. smalltalk.method({
  2576. selector: unescape('removeKey%3A'),
  2577. category: 'adding/removing',
  2578. fn: function (aKey){
  2579. var self=this;
  2580. smalltalk.send(self, "_remove_", [aKey]);
  2581. return self;},
  2582. args: ["aKey"],
  2583. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20self%20remove%3A%20aKey'),
  2584. messageSends: ["remove:"],
  2585. referencedClasses: []
  2586. }),
  2587. smalltalk.Dictionary);
  2588. smalltalk.addMethod(
  2589. unescape('_at_'),
  2590. smalltalk.method({
  2591. selector: unescape('at%3A'),
  2592. category: 'accessing',
  2593. fn: function (aKey){
  2594. var self=this;
  2595. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2596. return self;},
  2597. args: ["aKey"],
  2598. source: unescape('at%3A%20aKey%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  2599. messageSends: ["at:ifAbsent:", "errorNotFound"],
  2600. referencedClasses: []
  2601. }),
  2602. smalltalk.Dictionary);
  2603. smalltalk.addMethod(
  2604. unescape('_printString'),
  2605. smalltalk.method({
  2606. selector: unescape('printString'),
  2607. category: 'printing',
  2608. fn: function (){
  2609. var self=this;
  2610. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Collection)]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20-%3E%20")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%20%2C%20")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [unescape("%29")]);})]);
  2611. return self;},
  2612. args: [],
  2613. source: unescape('printString%0A%09%5EString%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%09%09aStream%20%0A%09%09%09nextPutAll%3A%20super%20printString%3B%0A%09%09%09nextPutAll%3A%20%27%28%27.%0A%09%09%09%09self%20associations%20%0A%09%09%09%09%09do%3A%20%5B%3AanAssociation%7C%20%20%0A%09%09%09%09%09%09aStream%20%0A%09%09%09%09%09%09%09nextPutAll%3A%20anAssociation%20key%20printString%3B%0A%09%09%09%09%09%09%09%09nextPutAll%3A%20%27%20-%3E%20%27%3B%0A%09%09%09%09%09%09%09%09nextPutAll%3A%20anAssociation%20value%20printString%5D%0A%09%09%09%09%09%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%20%2C%20%27%5D.%0A%09%09%09%09%09%09aStream%20nextPutAll%3A%20%27%29%27%5D'),
  2614. messageSends: ["streamContents:", "nextPutAll:", "printString", "do:separatedBy:", "associations", "key", "value"],
  2615. referencedClasses: ["String"]
  2616. }),
  2617. smalltalk.Dictionary);
  2618. smalltalk.addMethod(
  2619. unescape('_storeOn_'),
  2620. smalltalk.method({
  2621. selector: unescape('storeOn%3A'),
  2622. category: 'printing',
  2623. fn: function (aStream){
  2624. var self=this;
  2625. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  2626. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  2627. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  2628. return self;},
  2629. args: ["aStream"],
  2630. source: unescape('storeOn%3A%20aStream%0A%09aStream%20nextPutAll%3A%20%27%23%7B%27.%0A%09self%20associations%0A%09%09do%3A%20%5B%3Aeach%20%7C%20each%20storeOn%3A%20aStream%5D%0A%09%09separatedBy%3A%20%5B%20aStream%20nextPutAll%3A%20%27.%20%27%5D.%0A%09aStream%20nextPutAll%3A%20%27%7D%27'),
  2631. messageSends: ["nextPutAll:", "do:separatedBy:", "associations", "storeOn:"],
  2632. referencedClasses: []
  2633. }),
  2634. smalltalk.Dictionary);
  2635. smalltalk.addMethod(
  2636. unescape('_includesKey_'),
  2637. smalltalk.method({
  2638. selector: unescape('includesKey%3A'),
  2639. category: 'testing',
  2640. fn: function (aKey){
  2641. var self=this;
  2642. return self.hasOwnProperty(aKey);
  2643. return self;},
  2644. args: ["aKey"],
  2645. source: unescape('includesKey%3A%20aKey%0A%09%3Creturn%20self.hasOwnProperty%28aKey%29%3E'),
  2646. messageSends: [],
  2647. referencedClasses: []
  2648. }),
  2649. smalltalk.Dictionary);
  2650. smalltalk.addMethod(
  2651. unescape('_remove_ifAbsent_'),
  2652. smalltalk.method({
  2653. selector: unescape('remove%3AifAbsent%3A'),
  2654. category: 'adding/removing',
  2655. fn: function (aKey, aBlock){
  2656. var self=this;
  2657. return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
  2658. return self;},
  2659. args: ["aKey", "aBlock"],
  2660. source: unescape('remove%3A%20aKey%20ifAbsent%3A%20aBlock%0A%20%20%20%20%5Eself%20removeKey%3A%20aKey%20ifAbsent%3A%20aBlock'),
  2661. messageSends: ["removeKey:ifAbsent:"],
  2662. referencedClasses: []
  2663. }),
  2664. smalltalk.Dictionary);
  2665. smalltalk.addMethod(
  2666. unescape('_removeKey_ifAbsent_'),
  2667. smalltalk.method({
  2668. selector: unescape('removeKey%3AifAbsent%3A'),
  2669. category: 'adding/removing',
  2670. fn: function (aKey, aBlock){
  2671. var self=this;
  2672. return ((($receiver = smalltalk.send(self, "_includesKey_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})]));
  2673. return self;},
  2674. args: ["aKey", "aBlock"],
  2675. source: unescape('removeKey%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20includesKey%3A%20aKey%29%20%0A%09%09ifFalse%3A%20%5BaBlock%20value%5D%0A%09%09ifTrue%3A%20%5Bself%20basicDelete%3A%20aKey%5D'),
  2676. messageSends: ["ifFalse:ifTrue:", "includesKey:", "value", "basicDelete:"],
  2677. referencedClasses: []
  2678. }),
  2679. smalltalk.Dictionary);
  2680. smalltalk.addMethod(
  2681. unescape('_deepCopy'),
  2682. smalltalk.method({
  2683. selector: unescape('deepCopy'),
  2684. category: 'copying',
  2685. fn: function (){
  2686. var self=this;
  2687. var copy=nil;
  2688. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2689. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(smalltalk.send(each, "_value", []), "_deepCopy", [])]);})]);
  2690. return copy;
  2691. return self;},
  2692. args: [],
  2693. source: unescape('deepCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%20deepCopy%5D.%0A%09%5Ecopy'),
  2694. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "deepCopy", "value"],
  2695. referencedClasses: []
  2696. }),
  2697. smalltalk.Dictionary);
  2698. smalltalk.addMethod(
  2699. unescape('_fromPairs_'),
  2700. smalltalk.method({
  2701. selector: unescape('fromPairs%3A'),
  2702. category: 'instance creation',
  2703. fn: function (aCollection){
  2704. var self=this;
  2705. var dict=nil;
  2706. dict=smalltalk.send(self, "_new", []);
  2707. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  2708. return dict;
  2709. return self;},
  2710. args: ["aCollection"],
  2711. source: unescape('fromPairs%3A%20aCollection%0A%09%7C%20dict%20%7C%0A%09dict%20%3A%3D%20self%20new.%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%20dict%20add%3A%20each%5D.%0A%09%5Edict'),
  2712. messageSends: ["new", "do:", "add:"],
  2713. referencedClasses: []
  2714. }),
  2715. smalltalk.Dictionary.klass);
  2716. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  2717. smalltalk.addMethod(
  2718. unescape('_collection'),
  2719. smalltalk.method({
  2720. selector: unescape('collection'),
  2721. category: 'accessing',
  2722. fn: function (){
  2723. var self=this;
  2724. return self['@collection'];
  2725. return self;},
  2726. args: [],
  2727. source: unescape('collection%0A%09%5Ecollection'),
  2728. messageSends: [],
  2729. referencedClasses: []
  2730. }),
  2731. smalltalk.Stream);
  2732. smalltalk.addMethod(
  2733. unescape('_setCollection_'),
  2734. smalltalk.method({
  2735. selector: unescape('setCollection%3A'),
  2736. category: 'accessing',
  2737. fn: function (aCollection){
  2738. var self=this;
  2739. self['@collection']=aCollection;
  2740. return self;},
  2741. args: ["aCollection"],
  2742. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection'),
  2743. messageSends: [],
  2744. referencedClasses: []
  2745. }),
  2746. smalltalk.Stream);
  2747. smalltalk.addMethod(
  2748. unescape('_position'),
  2749. smalltalk.method({
  2750. selector: unescape('position'),
  2751. category: 'accessing',
  2752. fn: function (){
  2753. var self=this;
  2754. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  2755. return self;},
  2756. args: [],
  2757. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D'),
  2758. messageSends: ["ifNil:"],
  2759. referencedClasses: []
  2760. }),
  2761. smalltalk.Stream);
  2762. smalltalk.addMethod(
  2763. unescape('_position_'),
  2764. smalltalk.method({
  2765. selector: unescape('position%3A'),
  2766. category: 'accessing',
  2767. fn: function (anInteger){
  2768. var self=this;
  2769. self['@position']=anInteger;
  2770. return self;},
  2771. args: ["anInteger"],
  2772. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger'),
  2773. messageSends: [],
  2774. referencedClasses: []
  2775. }),
  2776. smalltalk.Stream);
  2777. smalltalk.addMethod(
  2778. unescape('_streamSize'),
  2779. smalltalk.method({
  2780. selector: unescape('streamSize'),
  2781. category: 'accessing',
  2782. fn: function (){
  2783. var self=this;
  2784. return self['@streamSize'];
  2785. return self;},
  2786. args: [],
  2787. source: unescape('streamSize%0A%09%5EstreamSize'),
  2788. messageSends: [],
  2789. referencedClasses: []
  2790. }),
  2791. smalltalk.Stream);
  2792. smalltalk.addMethod(
  2793. unescape('_setStreamSize_'),
  2794. smalltalk.method({
  2795. selector: unescape('setStreamSize%3A'),
  2796. category: 'accessing',
  2797. fn: function (anInteger){
  2798. var self=this;
  2799. self['@streamSize']=anInteger;
  2800. return self;},
  2801. args: ["anInteger"],
  2802. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger'),
  2803. messageSends: [],
  2804. referencedClasses: []
  2805. }),
  2806. smalltalk.Stream);
  2807. smalltalk.addMethod(
  2808. unescape('_contents'),
  2809. smalltalk.method({
  2810. selector: unescape('contents'),
  2811. category: 'accessing',
  2812. fn: function (){
  2813. var self=this;
  2814. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  2815. return self;},
  2816. args: [],
  2817. source: unescape('contents%0A%09%5Eself%20collection%0A%09%20%20%20%20copyFrom%3A%201%20%0A%09%20%20%20%20to%3A%20self%20streamSize'),
  2818. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  2819. referencedClasses: []
  2820. }),
  2821. smalltalk.Stream);
  2822. smalltalk.addMethod(
  2823. unescape('_size'),
  2824. smalltalk.method({
  2825. selector: unescape('size'),
  2826. category: 'accessing',
  2827. fn: function (){
  2828. var self=this;
  2829. return smalltalk.send(self, "_streamSize", []);
  2830. return self;},
  2831. args: [],
  2832. source: unescape('size%0A%09%5Eself%20streamSize'),
  2833. messageSends: ["streamSize"],
  2834. referencedClasses: []
  2835. }),
  2836. smalltalk.Stream);
  2837. smalltalk.addMethod(
  2838. unescape('_reset'),
  2839. smalltalk.method({
  2840. selector: unescape('reset'),
  2841. category: 'actions',
  2842. fn: function (){
  2843. var self=this;
  2844. smalltalk.send(self, "_position_", [(0)]);
  2845. return self;},
  2846. args: [],
  2847. source: unescape('reset%0A%09self%20position%3A%200'),
  2848. messageSends: ["position:"],
  2849. referencedClasses: []
  2850. }),
  2851. smalltalk.Stream);
  2852. smalltalk.addMethod(
  2853. unescape('_close'),
  2854. smalltalk.method({
  2855. selector: unescape('close'),
  2856. category: 'actions',
  2857. fn: function (){
  2858. var self=this;
  2859. return self;},
  2860. args: [],
  2861. source: unescape('close'),
  2862. messageSends: [],
  2863. referencedClasses: []
  2864. }),
  2865. smalltalk.Stream);
  2866. smalltalk.addMethod(
  2867. unescape('_flush'),
  2868. smalltalk.method({
  2869. selector: unescape('flush'),
  2870. category: 'actions',
  2871. fn: function (){
  2872. var self=this;
  2873. return self;},
  2874. args: [],
  2875. source: unescape('flush'),
  2876. messageSends: [],
  2877. referencedClasses: []
  2878. }),
  2879. smalltalk.Stream);
  2880. smalltalk.addMethod(
  2881. unescape('_resetContents'),
  2882. smalltalk.method({
  2883. selector: unescape('resetContents'),
  2884. category: 'actions',
  2885. fn: function (){
  2886. var self=this;
  2887. smalltalk.send(self, "_reset", []);
  2888. smalltalk.send(self, "_setStreamSize_", [(0)]);
  2889. return self;},
  2890. args: [],
  2891. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200'),
  2892. messageSends: ["reset", "setStreamSize:"],
  2893. referencedClasses: []
  2894. }),
  2895. smalltalk.Stream);
  2896. smalltalk.addMethod(
  2897. unescape('_do_'),
  2898. smalltalk.method({
  2899. selector: unescape('do%3A'),
  2900. category: 'enumerating',
  2901. fn: function (aBlock){
  2902. var self=this;
  2903. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  2904. return self;},
  2905. args: ["aBlock"],
  2906. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D'),
  2907. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  2908. referencedClasses: []
  2909. }),
  2910. smalltalk.Stream);
  2911. smalltalk.addMethod(
  2912. unescape('_setToEnd'),
  2913. smalltalk.method({
  2914. selector: unescape('setToEnd'),
  2915. category: 'positioning',
  2916. fn: function (){
  2917. var self=this;
  2918. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  2919. return self;},
  2920. args: [],
  2921. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size'),
  2922. messageSends: ["position:", "size"],
  2923. referencedClasses: []
  2924. }),
  2925. smalltalk.Stream);
  2926. smalltalk.addMethod(
  2927. unescape('_skip_'),
  2928. smalltalk.method({
  2929. selector: unescape('skip%3A'),
  2930. category: 'positioning',
  2931. fn: function (anInteger){
  2932. var self=this;
  2933. smalltalk.send(self, "_position_", [smalltalk.send(((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +anInteger : smalltalk.send($receiver, "__plus", [anInteger])), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  2934. return self;},
  2935. args: ["anInteger"],
  2936. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29'),
  2937. messageSends: ["position:", "min:max:", unescape("+"), "position", "size"],
  2938. referencedClasses: []
  2939. }),
  2940. smalltalk.Stream);
  2941. smalltalk.addMethod(
  2942. unescape('_next'),
  2943. smalltalk.method({
  2944. selector: unescape('next'),
  2945. category: 'reading',
  2946. fn: function (){
  2947. var self=this;
  2948. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  2949. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  2950. return self;},
  2951. args: [],
  2952. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position'),
  2953. messageSends: ["position:", unescape("+"), "position", "at:"],
  2954. referencedClasses: []
  2955. }),
  2956. smalltalk.Stream);
  2957. smalltalk.addMethod(
  2958. unescape('_next_'),
  2959. smalltalk.method({
  2960. selector: unescape('next%3A'),
  2961. category: 'reading',
  2962. fn: function (anInteger){
  2963. var self=this;
  2964. var tempCollection=nil;
  2965. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  2966. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]));})]);
  2967. return tempCollection;
  2968. return self;},
  2969. args: ["anInteger"],
  2970. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20add%3A%20self%20next%5D%5D.%0A%09%5EtempCollection'),
  2971. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  2972. referencedClasses: []
  2973. }),
  2974. smalltalk.Stream);
  2975. smalltalk.addMethod(
  2976. unescape('_nextPut_'),
  2977. smalltalk.method({
  2978. selector: unescape('nextPut%3A'),
  2979. category: 'writing',
  2980. fn: function (anObject){
  2981. var self=this;
  2982. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  2983. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  2984. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  2985. return self;},
  2986. args: ["anObject"],
  2987. source: unescape('nextPut%3A%20anObject%0A%09self%20position%3A%20self%20position%20+%201.%0A%09self%20collection%20at%3A%20self%20position%20put%3A%20anObject.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29'),
  2988. messageSends: ["position:", unescape("+"), "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  2989. referencedClasses: []
  2990. }),
  2991. smalltalk.Stream);
  2992. smalltalk.addMethod(
  2993. unescape('_nextPutAll_'),
  2994. smalltalk.method({
  2995. selector: unescape('nextPutAll%3A'),
  2996. category: 'writing',
  2997. fn: function (aCollection){
  2998. var self=this;
  2999. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  3000. return self;},
  3001. args: ["aCollection"],
  3002. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D'),
  3003. messageSends: ["do:", "nextPut:"],
  3004. referencedClasses: []
  3005. }),
  3006. smalltalk.Stream);
  3007. smalltalk.addMethod(
  3008. unescape('_peek'),
  3009. smalltalk.method({
  3010. selector: unescape('peek'),
  3011. category: 'reading',
  3012. fn: function (){
  3013. var self=this;
  3014. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
  3015. return self;},
  3016. args: [],
  3017. source: unescape('peek%0A%09%5Eself%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20collection%20at%3A%20self%20position%20+%201%5D'),
  3018. messageSends: ["ifFalse:", "atEnd", "at:", "collection", unescape("+"), "position"],
  3019. referencedClasses: []
  3020. }),
  3021. smalltalk.Stream);
  3022. smalltalk.addMethod(
  3023. unescape('_atEnd'),
  3024. smalltalk.method({
  3025. selector: unescape('atEnd'),
  3026. category: 'testing',
  3027. fn: function (){
  3028. var self=this;
  3029. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  3030. return self;},
  3031. args: [],
  3032. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size'),
  3033. messageSends: [unescape("%3D"), "position", "size"],
  3034. referencedClasses: []
  3035. }),
  3036. smalltalk.Stream);
  3037. smalltalk.addMethod(
  3038. unescape('_atStart'),
  3039. smalltalk.method({
  3040. selector: unescape('atStart'),
  3041. category: 'testing',
  3042. fn: function (){
  3043. var self=this;
  3044. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  3045. return self;},
  3046. args: [],
  3047. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200'),
  3048. messageSends: [unescape("%3D"), "position"],
  3049. referencedClasses: []
  3050. }),
  3051. smalltalk.Stream);
  3052. smalltalk.addMethod(
  3053. unescape('_isEmpty'),
  3054. smalltalk.method({
  3055. selector: unescape('isEmpty'),
  3056. category: 'testing',
  3057. fn: function (){
  3058. var self=this;
  3059. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3060. return self;},
  3061. args: [],
  3062. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  3063. messageSends: [unescape("%3D"), "size"],
  3064. referencedClasses: []
  3065. }),
  3066. smalltalk.Stream);
  3067. smalltalk.addMethod(
  3068. unescape('_on_'),
  3069. smalltalk.method({
  3070. selector: unescape('on%3A'),
  3071. category: 'instance creation',
  3072. fn: function (aCollection){
  3073. var self=this;
  3074. return (function($rec){smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3075. return self;},
  3076. args: ["aCollection"],
  3077. source: unescape('on%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%20%0A%09%09setCollection%3A%20aCollection%3B%0A%09%09setStreamSize%3A%20aCollection%20size%3B%0A%09%09yourself'),
  3078. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  3079. referencedClasses: []
  3080. }),
  3081. smalltalk.Stream.klass);
  3082. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3083. smalltalk.addMethod(
  3084. unescape('_next_'),
  3085. smalltalk.method({
  3086. selector: unescape('next%3A'),
  3087. category: 'reading',
  3088. fn: function (anInteger){
  3089. var self=this;
  3090. var tempCollection=nil;
  3091. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  3092. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]));})]);
  3093. return tempCollection;
  3094. return self;},
  3095. args: ["anInteger"],
  3096. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20%3A%3D%20tempCollection%2C%20self%20next%5D%5D.%0A%09%5EtempCollection'),
  3097. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", unescape("%2C"), "next"],
  3098. referencedClasses: []
  3099. }),
  3100. smalltalk.StringStream);
  3101. smalltalk.addMethod(
  3102. unescape('_nextPut_'),
  3103. smalltalk.method({
  3104. selector: unescape('nextPut%3A'),
  3105. category: 'writing',
  3106. fn: function (aString){
  3107. var self=this;
  3108. smalltalk.send(self, "_nextPutAll_", [aString]);
  3109. return self;},
  3110. args: ["aString"],
  3111. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString'),
  3112. messageSends: ["nextPutAll:"],
  3113. referencedClasses: []
  3114. }),
  3115. smalltalk.StringStream);
  3116. smalltalk.addMethod(
  3117. unescape('_nextPutAll_'),
  3118. smalltalk.method({
  3119. selector: unescape('nextPutAll%3A'),
  3120. category: 'writing',
  3121. fn: function (aString){
  3122. var self=this;
  3123. smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [((($receiver = ((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])])), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  3124. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]))]);
  3125. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  3126. return self;},
  3127. args: ["aString"],
  3128. source: unescape('nextPutAll%3A%20aString%0A%09self%20setCollection%3A%20%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%201%20to%3A%20self%20position%29%2C%0A%09%20%20%20%20aString%2C%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%20%28self%20position%20+%201%20+%20aString%20size%29%20to%3A%20self%20collection%20size%29.%0A%09self%20position%3A%20self%20position%20+%20aString%20size.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29'),
  3129. messageSends: ["setCollection:", unescape("%2C"), "copyFrom:to:", "collection", "position", unescape("+"), "size", "position:", "setStreamSize:", "max:", "streamSize"],
  3130. referencedClasses: []
  3131. }),
  3132. smalltalk.StringStream);
  3133. smalltalk.addMethod(
  3134. unescape('_cr'),
  3135. smalltalk.method({
  3136. selector: unescape('cr'),
  3137. category: 'writing',
  3138. fn: function (){
  3139. var self=this;
  3140. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  3141. return self;},
  3142. args: [],
  3143. source: unescape('cr%0A%09%5Eself%20nextPutAll%3A%20String%20cr'),
  3144. messageSends: ["nextPutAll:", "cr"],
  3145. referencedClasses: ["String"]
  3146. }),
  3147. smalltalk.StringStream);
  3148. smalltalk.addMethod(
  3149. unescape('_crlf'),
  3150. smalltalk.method({
  3151. selector: unescape('crlf'),
  3152. category: 'writing',
  3153. fn: function (){
  3154. var self=this;
  3155. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  3156. return self;},
  3157. args: [],
  3158. source: unescape('crlf%0A%09%5Eself%20nextPutAll%3A%20String%20crlf'),
  3159. messageSends: ["nextPutAll:", "crlf"],
  3160. referencedClasses: ["String"]
  3161. }),
  3162. smalltalk.StringStream);
  3163. smalltalk.addMethod(
  3164. unescape('_lf'),
  3165. smalltalk.method({
  3166. selector: unescape('lf'),
  3167. category: 'writing',
  3168. fn: function (){
  3169. var self=this;
  3170. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  3171. return self;},
  3172. args: [],
  3173. source: unescape('lf%0A%09%5Eself%20nextPutAll%3A%20String%20lf'),
  3174. messageSends: ["nextPutAll:", "lf"],
  3175. referencedClasses: ["String"]
  3176. }),
  3177. smalltalk.StringStream);
  3178. smalltalk.addMethod(
  3179. unescape('_space'),
  3180. smalltalk.method({
  3181. selector: unescape('space'),
  3182. category: 'writing',
  3183. fn: function (){
  3184. var self=this;
  3185. smalltalk.send(self, "_nextPut_", [" "]);
  3186. return self;},
  3187. args: [],
  3188. source: unescape('space%0A%09self%20nextPut%3A%20%27%20%27'),
  3189. messageSends: ["nextPut:"],
  3190. referencedClasses: []
  3191. }),
  3192. smalltalk.StringStream);
  3193. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3194. smalltalk.addMethod(
  3195. unescape('_add_'),
  3196. smalltalk.method({
  3197. selector: unescape('add%3A'),
  3198. category: 'adding/removing',
  3199. fn: function (anObject){
  3200. var self=this;
  3201. var found;
  3202. for(var i in self['@elements']) {
  3203. if(anObject == self['@elements'][i]) {
  3204. found = true;
  3205. break;
  3206. }
  3207. }
  3208. if(!found) {self['@elements'].push(anObject)}
  3209. ;
  3210. return self;},
  3211. args: ["anObject"],
  3212. source: unescape('add%3A%20anObject%0A%09%3C%0A%09%09var%20found%3B%0A%09%09for%28var%20i%20in%20self%5B%27@elements%27%5D%29%20%7B%0A%09%09%09if%28anObject%20%3D%3D%20self%5B%27@elements%27%5D%5Bi%5D%29%20%7B%0A%09%09%09%09found%20%3D%20true%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09if%28%21found%29%20%7Bself%5B%27@elements%27%5D.push%28anObject%29%7D%0A%09%3E'),
  3213. messageSends: [],
  3214. referencedClasses: []
  3215. }),
  3216. smalltalk.Set);
  3217. smalltalk.addMethod(
  3218. unescape('_remove_'),
  3219. smalltalk.method({
  3220. selector: unescape('remove%3A'),
  3221. category: 'adding/removing',
  3222. fn: function (anObject){
  3223. var self=this;
  3224. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  3225. return self;},
  3226. args: ["anObject"],
  3227. source: unescape('remove%3A%20anObject%0A%09elements%20remove%3A%20anObject'),
  3228. messageSends: ["remove:"],
  3229. referencedClasses: []
  3230. }),
  3231. smalltalk.Set);
  3232. smalltalk.addMethod(
  3233. unescape('_initialize'),
  3234. smalltalk.method({
  3235. selector: unescape('initialize'),
  3236. category: 'initialization',
  3237. fn: function (){
  3238. var self=this;
  3239. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3240. self['@elements']=[];
  3241. return self;},
  3242. args: [],
  3243. source: unescape('initialize%0A%09super%20initialize.%0A%09elements%20%3A%3D%20%23%28%29'),
  3244. messageSends: ["initialize"],
  3245. referencedClasses: []
  3246. }),
  3247. smalltalk.Set);
  3248. smalltalk.addMethod(
  3249. unescape('_size'),
  3250. smalltalk.method({
  3251. selector: unescape('size'),
  3252. category: 'accessing',
  3253. fn: function (){
  3254. var self=this;
  3255. return smalltalk.send(self['@elements'], "_size", []);
  3256. return self;},
  3257. args: [],
  3258. source: unescape('size%0A%09%5Eelements%20size'),
  3259. messageSends: ["size"],
  3260. referencedClasses: []
  3261. }),
  3262. smalltalk.Set);
  3263. smalltalk.addMethod(
  3264. unescape('_asArray'),
  3265. smalltalk.method({
  3266. selector: unescape('asArray'),
  3267. category: 'converting',
  3268. fn: function (){
  3269. var self=this;
  3270. return smalltalk.send(self['@elements'], "_copy", []);
  3271. return self;},
  3272. args: [],
  3273. source: unescape('asArray%0A%09%5Eelements%20copy'),
  3274. messageSends: ["copy"],
  3275. referencedClasses: []
  3276. }),
  3277. smalltalk.Set);
  3278. smalltalk.addMethod(
  3279. unescape('_detect_ifNone_'),
  3280. smalltalk.method({
  3281. selector: unescape('detect%3AifNone%3A'),
  3282. category: 'enumerating',
  3283. fn: function (aBlock, anotherBlock){
  3284. var self=this;
  3285. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  3286. return self;},
  3287. args: ["aBlock", "anotherBlock"],
  3288. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eelements%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  3289. messageSends: ["detect:ifNone:"],
  3290. referencedClasses: []
  3291. }),
  3292. smalltalk.Set);
  3293. smalltalk.addMethod(
  3294. unescape('_do_'),
  3295. smalltalk.method({
  3296. selector: unescape('do%3A'),
  3297. category: 'enumerating',
  3298. fn: function (aBlock){
  3299. var self=this;
  3300. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  3301. return self;},
  3302. args: ["aBlock"],
  3303. source: unescape('do%3A%20aBlock%0A%09elements%20do%3A%20aBlock'),
  3304. messageSends: ["do:"],
  3305. referencedClasses: []
  3306. }),
  3307. smalltalk.Set);
  3308. smalltalk.addMethod(
  3309. unescape('_includes_'),
  3310. smalltalk.method({
  3311. selector: unescape('includes%3A'),
  3312. category: 'testing',
  3313. fn: function (anObject){
  3314. var self=this;
  3315. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  3316. return self;},
  3317. args: ["anObject"],
  3318. source: unescape('includes%3A%20anObject%0A%09%5Eelements%20includes%3A%20anObject'),
  3319. messageSends: ["includes:"],
  3320. referencedClasses: []
  3321. }),
  3322. smalltalk.Set);
  3323. smalltalk.addMethod(
  3324. unescape('__eq'),
  3325. smalltalk.method({
  3326. selector: unescape('%3D'),
  3327. category: 'comparing',
  3328. fn: function (aCollection){
  3329. var self=this;
  3330. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
  3331. return self;},
  3332. args: ["aCollection"],
  3333. source: unescape('%3D%20aCollection%0A%09%5Eself%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%20%20%20%20%20%20%20%20%09elements%20%3D%20aCollection%20asArray%5D'),
  3334. messageSends: ["and:", unescape("%3D"), "class", "asArray"],
  3335. referencedClasses: []
  3336. }),
  3337. smalltalk.Set);