Kernel-Collections.js 163 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707
  1. smalltalk.addPackage('Kernel-Collections', {});
  2. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  3. smalltalk.addMethod(
  4. unescape('__eq'),
  5. smalltalk.method({
  6. selector: unescape('%3D'),
  7. category: 'comparing',
  8. fn: function (anAssociation) {
  9. var self=this;
  10. 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", [])]);})]);})]);
  11. return self;},
  12. args: ["anAssociation"],
  13. 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'),
  14. messageSends: ["and:", unescape("%3D"), "class", "key", "value"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Association);
  18. smalltalk.addMethod(
  19. unescape('_key'),
  20. smalltalk.method({
  21. selector: unescape('key'),
  22. category: 'accessing',
  23. fn: function () {
  24. var self=this;
  25. return self['@key'];
  26. return self;},
  27. args: [],
  28. source: unescape('key%0A%09%5Ekey'),
  29. messageSends: [],
  30. referencedClasses: []
  31. }),
  32. smalltalk.Association);
  33. smalltalk.addMethod(
  34. unescape('_key_'),
  35. smalltalk.method({
  36. selector: unescape('key%3A'),
  37. category: 'accessing',
  38. fn: function (aKey) {
  39. var self=this;
  40. (self['@key']=aKey);
  41. return self;},
  42. args: ["aKey"],
  43. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey'),
  44. messageSends: [],
  45. referencedClasses: []
  46. }),
  47. smalltalk.Association);
  48. smalltalk.addMethod(
  49. unescape('_storeOn_'),
  50. smalltalk.method({
  51. selector: unescape('storeOn%3A'),
  52. category: 'comparing',
  53. fn: function (aStream) {
  54. var self=this;
  55. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  56. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  57. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  58. return self;},
  59. args: ["aStream"],
  60. 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'),
  61. messageSends: ["storeOn:", "nextPutAll:"],
  62. referencedClasses: []
  63. }),
  64. smalltalk.Association);
  65. smalltalk.addMethod(
  66. unescape('_value'),
  67. smalltalk.method({
  68. selector: unescape('value'),
  69. category: 'accessing',
  70. fn: function () {
  71. var self=this;
  72. return self['@value'];
  73. return self;},
  74. args: [],
  75. source: unescape('value%0A%09%5Evalue'),
  76. messageSends: [],
  77. referencedClasses: []
  78. }),
  79. smalltalk.Association);
  80. smalltalk.addMethod(
  81. unescape('_value_'),
  82. smalltalk.method({
  83. selector: unescape('value%3A'),
  84. category: 'accessing',
  85. fn: function (aValue) {
  86. var self=this;
  87. (self['@value']=aValue);
  88. return self;},
  89. args: ["aValue"],
  90. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue'),
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.Association);
  95. smalltalk.addMethod(
  96. unescape('_key_value_'),
  97. smalltalk.method({
  98. selector: unescape('key%3Avalue%3A'),
  99. category: 'instance creation',
  100. fn: function (aKey, aValue) {
  101. var self=this;
  102. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  103. return self;},
  104. args: ["aKey", "aValue"],
  105. 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'),
  106. messageSends: ["key:", "value:", "yourself", "new"],
  107. referencedClasses: []
  108. }),
  109. smalltalk.Association.klass);
  110. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  111. smalltalk.addMethod(
  112. unescape('__comma'),
  113. smalltalk.method({
  114. selector: unescape('%2C'),
  115. category: 'copying',
  116. fn: function (aCollection) {
  117. var self=this;
  118. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  119. return self;},
  120. args: ["aCollection"],
  121. 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'),
  122. messageSends: ["addAll:", "yourself", "copy"],
  123. referencedClasses: []
  124. }),
  125. smalltalk.Collection);
  126. smalltalk.addMethod(
  127. unescape('_add_'),
  128. smalltalk.method({
  129. selector: unescape('add%3A'),
  130. category: 'adding/removing',
  131. fn: function (anObject) {
  132. var self=this;
  133. smalltalk.send(self, "_subclassResponsibility", []);
  134. return self;},
  135. args: ["anObject"],
  136. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility'),
  137. messageSends: ["subclassResponsibility"],
  138. referencedClasses: []
  139. }),
  140. smalltalk.Collection);
  141. smalltalk.addMethod(
  142. unescape('_addAll_'),
  143. smalltalk.method({
  144. selector: unescape('addAll%3A'),
  145. category: 'adding/removing',
  146. fn: function (aCollection) {
  147. var self=this;
  148. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  149. return aCollection;
  150. return self;},
  151. args: ["aCollection"],
  152. 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'),
  153. messageSends: ["do:", "add:"],
  154. referencedClasses: []
  155. }),
  156. smalltalk.Collection);
  157. smalltalk.addMethod(
  158. unescape('_asArray'),
  159. smalltalk.method({
  160. selector: unescape('asArray'),
  161. category: 'converting',
  162. fn: function () {
  163. var self=this;
  164. return smalltalk.send((smalltalk.Array || Array), "_withAll_", [self]);
  165. return self;},
  166. args: [],
  167. source: unescape('asArray%0A%09%5EArray%20withAll%3A%20self'),
  168. messageSends: ["withAll:"],
  169. referencedClasses: ["Array"]
  170. }),
  171. smalltalk.Collection);
  172. smalltalk.addMethod(
  173. unescape('_asJSON'),
  174. smalltalk.method({
  175. selector: unescape('asJSON'),
  176. category: 'converting',
  177. fn: function (){
  178. var self=this;
  179. return smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asJSON", []);})]);
  180. return self;},
  181. args: [],
  182. source: unescape('asJSON%0A%09%5Eself%20asArray%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJSON%5D'),
  183. messageSends: ["collect:", "asArray", "asJSON"],
  184. referencedClasses: []
  185. }),
  186. smalltalk.Collection);
  187. smalltalk.addMethod(
  188. unescape('_asOrderedCollection'),
  189. smalltalk.method({
  190. selector: unescape('asOrderedCollection'),
  191. category: 'converting',
  192. fn: function () {
  193. var self=this;
  194. return smalltalk.send(self, "_asArray", []);
  195. return self;},
  196. args: [],
  197. source: unescape('asOrderedCollection%0A%09%5Eself%20asArray'),
  198. messageSends: ["asArray"],
  199. referencedClasses: []
  200. }),
  201. smalltalk.Collection);
  202. smalltalk.addMethod(
  203. unescape('_asSet'),
  204. smalltalk.method({
  205. selector: unescape('asSet'),
  206. category: 'converting',
  207. fn: function () {
  208. var self=this;
  209. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  210. return self;},
  211. args: [],
  212. source: unescape('asSet%0A%09%5ESet%20withAll%3A%20self'),
  213. messageSends: ["withAll:"],
  214. referencedClasses: ["Set"]
  215. }),
  216. smalltalk.Collection);
  217. smalltalk.addMethod(
  218. unescape('_collect_'),
  219. smalltalk.method({
  220. selector: unescape('collect%3A'),
  221. category: 'enumerating',
  222. fn: function (aBlock) {
  223. var self=this;
  224. var newCollection=nil;
  225. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  226. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  227. return newCollection;
  228. return self;},
  229. args: ["aBlock"],
  230. 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'),
  231. messageSends: ["new", "class", "do:", "add:", "value:"],
  232. referencedClasses: []
  233. }),
  234. smalltalk.Collection);
  235. smalltalk.addMethod(
  236. unescape('_copyWith_'),
  237. smalltalk.method({
  238. selector: unescape('copyWith%3A'),
  239. category: 'copying',
  240. fn: function (anObject) {
  241. var self=this;
  242. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  243. return self;},
  244. args: ["anObject"],
  245. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself'),
  246. messageSends: ["add:", "yourself", "copy"],
  247. referencedClasses: []
  248. }),
  249. smalltalk.Collection);
  250. smalltalk.addMethod(
  251. unescape('_copyWithAll_'),
  252. smalltalk.method({
  253. selector: unescape('copyWithAll%3A'),
  254. category: 'copying',
  255. fn: function (aCollection) {
  256. var self=this;
  257. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  258. return self;},
  259. args: ["aCollection"],
  260. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself'),
  261. messageSends: ["addAll:", "yourself", "copy"],
  262. referencedClasses: []
  263. }),
  264. smalltalk.Collection);
  265. smalltalk.addMethod(
  266. unescape('_copyWithoutAll_'),
  267. smalltalk.method({
  268. selector: unescape('copyWithoutAll%3A'),
  269. category: 'copying',
  270. fn: function (aCollection) {
  271. var self=this;
  272. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  273. return self;},
  274. args: ["aCollection"],
  275. 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'),
  276. messageSends: ["reject:", "includes:"],
  277. referencedClasses: []
  278. }),
  279. smalltalk.Collection);
  280. smalltalk.addMethod(
  281. unescape('_detect_'),
  282. smalltalk.method({
  283. selector: unescape('detect%3A'),
  284. category: 'enumerating',
  285. fn: function (aBlock) {
  286. var self=this;
  287. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  288. return self;},
  289. args: ["aBlock"],
  290. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D'),
  291. messageSends: ["detect:ifNone:", "errorNotFound"],
  292. referencedClasses: []
  293. }),
  294. smalltalk.Collection);
  295. smalltalk.addMethod(
  296. unescape('_detect_ifNone_'),
  297. smalltalk.method({
  298. selector: unescape('detect%3AifNone%3A'),
  299. category: 'enumerating',
  300. fn: function (aBlock, anotherBlock) {
  301. var self=this;
  302. for(var i = 0; i < self.length; i++)
  303. if(aBlock(self[i]))
  304. return self[i];
  305. return anotherBlock();
  306. ;
  307. return self;},
  308. args: ["aBlock", "anotherBlock"],
  309. 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'),
  310. messageSends: [],
  311. referencedClasses: []
  312. }),
  313. smalltalk.Collection);
  314. smalltalk.addMethod(
  315. unescape('_do_'),
  316. smalltalk.method({
  317. selector: unescape('do%3A'),
  318. category: 'enumerating',
  319. fn: function (aBlock) {
  320. var self=this;
  321. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  322. return self;},
  323. args: ["aBlock"],
  324. source: unescape('do%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%3E'),
  325. messageSends: [],
  326. referencedClasses: []
  327. }),
  328. smalltalk.Collection);
  329. smalltalk.addMethod(
  330. unescape('_do_separatedBy_'),
  331. smalltalk.method({
  332. selector: unescape('do%3AseparatedBy%3A'),
  333. category: 'enumerating',
  334. fn: function (aBlock, anotherBlock) {
  335. var self=this;
  336. var first=nil;
  337. (first=true);
  338. 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]);})]);
  339. return self;},
  340. args: ["aBlock", "anotherBlock"],
  341. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%09%7C%20first%20%7C%0A%09first%20%3A%3D%20true.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20first%0A%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%09%20%20%20%20aBlock%20value%3A%20each%5D'),
  342. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  343. referencedClasses: []
  344. }),
  345. smalltalk.Collection);
  346. smalltalk.addMethod(
  347. unescape('_errorNotFound'),
  348. smalltalk.method({
  349. selector: unescape('errorNotFound'),
  350. category: 'error handling',
  351. fn: function () {
  352. var self=this;
  353. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  354. return self;},
  355. args: [],
  356. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27'),
  357. messageSends: ["error:"],
  358. referencedClasses: []
  359. }),
  360. smalltalk.Collection);
  361. smalltalk.addMethod(
  362. unescape('_ifEmpty_'),
  363. smalltalk.method({
  364. selector: unescape('ifEmpty%3A'),
  365. category: 'testing',
  366. fn: function (aBlock){
  367. var self=this;
  368. return ((($receiver = smalltalk.send(self, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return self;})]));
  369. return self;},
  370. args: ["aBlock"],
  371. source: unescape('ifEmpty%3A%20aBlock%0A%09%22Evaluate%20the%20given%20block%20with%20the%20receiver%20as%20argument%2C%20answering%20its%20value%20if%20the%20receiver%20is%20empty%2C%20otherwise%20answer%20the%20receiver.%20Note%20that%20the%20fact%20that%20this%20method%20returns%20its%20argument%20in%20case%20the%20receiver%20is%20not%20empty%20allows%20one%20to%20write%20expressions%20like%20the%20following%20ones%3A%20self%20classifyMethodAs%3A%20%0A%09%09%28myProtocol%20ifEmpty%3A%20%5B%27As%20yet%20unclassified%27%5D%29%22%0A%09%5E%20self%20isEmpty%20%0A%09%09ifTrue%3A%20%5B%20aBlock%20value%20%5D%0A%09%09ifFalse%3A%20%5B%20self%20%5D'),
  372. messageSends: ["ifTrue:ifFalse:", "isEmpty", "value"],
  373. referencedClasses: []
  374. }),
  375. smalltalk.Collection);
  376. smalltalk.addMethod(
  377. unescape('_ifNotEmpty_'),
  378. smalltalk.method({
  379. selector: unescape('ifNotEmpty%3A'),
  380. category: 'testing',
  381. fn: function (aBlock) {
  382. var self=this;
  383. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  384. return self;},
  385. args: ["aBlock"],
  386. source: unescape('ifNotEmpty%3A%20aBlock%0A%09self%20notEmpty%20ifTrue%3A%20aBlock.'),
  387. messageSends: ["ifTrue:", "notEmpty"],
  388. referencedClasses: []
  389. }),
  390. smalltalk.Collection);
  391. smalltalk.addMethod(
  392. unescape('_includes_'),
  393. smalltalk.method({
  394. selector: unescape('includes%3A'),
  395. category: 'testing',
  396. fn: function (anObject) {
  397. var self=this;
  398. var i = self.length;
  399. while (i--) {
  400. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  401. }
  402. return false
  403. ;
  404. return self;},
  405. args: ["anObject"],
  406. 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'),
  407. messageSends: [],
  408. referencedClasses: []
  409. }),
  410. smalltalk.Collection);
  411. smalltalk.addMethod(
  412. unescape('_inject_into_'),
  413. smalltalk.method({
  414. selector: unescape('inject%3Ainto%3A'),
  415. category: 'enumerating',
  416. fn: function (anObject, aBlock) {
  417. var self=this;
  418. var result=nil;
  419. (result=anObject);
  420. smalltalk.send(self, "_do_", [(function(each){return (result=smalltalk.send(aBlock, "_value_value_", [result, each]));})]);
  421. return result;
  422. return self;},
  423. args: ["anObject", "aBlock"],
  424. 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'),
  425. messageSends: ["do:", "value:value:"],
  426. referencedClasses: []
  427. }),
  428. smalltalk.Collection);
  429. smalltalk.addMethod(
  430. unescape('_isEmpty'),
  431. smalltalk.method({
  432. selector: unescape('isEmpty'),
  433. category: 'testing',
  434. fn: function () {
  435. var self=this;
  436. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  437. return self;},
  438. args: [],
  439. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  440. messageSends: [unescape("%3D"), "size"],
  441. referencedClasses: []
  442. }),
  443. smalltalk.Collection);
  444. smalltalk.addMethod(
  445. unescape('_notEmpty'),
  446. smalltalk.method({
  447. selector: unescape('notEmpty'),
  448. category: 'testing',
  449. fn: function () {
  450. var self=this;
  451. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  452. return self;},
  453. args: [],
  454. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not'),
  455. messageSends: ["not", "isEmpty"],
  456. referencedClasses: []
  457. }),
  458. smalltalk.Collection);
  459. smalltalk.addMethod(
  460. unescape('_readStream'),
  461. smalltalk.method({
  462. selector: unescape('readStream'),
  463. category: 'accessing',
  464. fn: function () {
  465. var self=this;
  466. return smalltalk.send(self, "_stream", []);
  467. return self;},
  468. args: [],
  469. source: unescape('readStream%0A%09%5Eself%20stream'),
  470. messageSends: ["stream"],
  471. referencedClasses: []
  472. }),
  473. smalltalk.Collection);
  474. smalltalk.addMethod(
  475. unescape('_reject_'),
  476. smalltalk.method({
  477. selector: unescape('reject%3A'),
  478. category: 'enumerating',
  479. fn: function (aBlock) {
  480. var self=this;
  481. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  482. return self;},
  483. args: ["aBlock"],
  484. 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'),
  485. messageSends: ["select:", unescape("%3D"), "value:"],
  486. referencedClasses: []
  487. }),
  488. smalltalk.Collection);
  489. smalltalk.addMethod(
  490. unescape('_remove_'),
  491. smalltalk.method({
  492. selector: unescape('remove%3A'),
  493. category: 'adding/removing',
  494. fn: function (anObject) {
  495. var self=this;
  496. return smalltalk.send(self, "_remove_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  497. return self;},
  498. args: ["anObject"],
  499. source: unescape('remove%3A%20anObject%0A%20%20%20%20%5Eself%20remove%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  500. messageSends: ["remove:ifAbsent:", "errorNotFound"],
  501. referencedClasses: []
  502. }),
  503. smalltalk.Collection);
  504. smalltalk.addMethod(
  505. unescape('_remove_ifAbsent_'),
  506. smalltalk.method({
  507. selector: unescape('remove%3AifAbsent%3A'),
  508. category: 'adding/removing',
  509. fn: function (anObject, aBlock) {
  510. var self=this;
  511. smalltalk.send(self, "_subclassResponsibility", []);
  512. return self;},
  513. args: ["anObject", "aBlock"],
  514. source: unescape('remove%3A%20anObject%20ifAbsent%3A%20aBlock%0A%20%20%20%20self%20subclassResponsibility'),
  515. messageSends: ["subclassResponsibility"],
  516. referencedClasses: []
  517. }),
  518. smalltalk.Collection);
  519. smalltalk.addMethod(
  520. unescape('_select_'),
  521. smalltalk.method({
  522. selector: unescape('select%3A'),
  523. category: 'enumerating',
  524. fn: function (aBlock) {
  525. var self=this;
  526. var stream=nil;
  527. (stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []));
  528. 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]);})]));})]);
  529. return smalltalk.send(stream, "_contents", []);
  530. return self;},
  531. args: ["aBlock"],
  532. 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'),
  533. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  534. referencedClasses: []
  535. }),
  536. smalltalk.Collection);
  537. smalltalk.addMethod(
  538. unescape('_size'),
  539. smalltalk.method({
  540. selector: unescape('size'),
  541. category: 'accessing',
  542. fn: function () {
  543. var self=this;
  544. smalltalk.send(self, "_subclassResponsibility", []);
  545. return self;},
  546. args: [],
  547. source: unescape('size%0A%09self%20subclassResponsibility'),
  548. messageSends: ["subclassResponsibility"],
  549. referencedClasses: []
  550. }),
  551. smalltalk.Collection);
  552. smalltalk.addMethod(
  553. unescape('_stream'),
  554. smalltalk.method({
  555. selector: unescape('stream'),
  556. category: 'accessing',
  557. fn: function () {
  558. var self=this;
  559. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  560. return self;},
  561. args: [],
  562. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self'),
  563. messageSends: ["on:", "streamClass"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.Collection);
  567. smalltalk.addMethod(
  568. unescape('_streamClass'),
  569. smalltalk.method({
  570. selector: unescape('streamClass'),
  571. category: 'accessing',
  572. fn: function () {
  573. var self=this;
  574. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  575. return self;},
  576. args: [],
  577. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass'),
  578. messageSends: ["streamClass", "class"],
  579. referencedClasses: []
  580. }),
  581. smalltalk.Collection);
  582. smalltalk.addMethod(
  583. unescape('_writeStream'),
  584. smalltalk.method({
  585. selector: unescape('writeStream'),
  586. category: 'accessing',
  587. fn: function () {
  588. var self=this;
  589. return smalltalk.send(self, "_stream", []);
  590. return self;},
  591. args: [],
  592. source: unescape('writeStream%0A%09%5Eself%20stream'),
  593. messageSends: ["stream"],
  594. referencedClasses: []
  595. }),
  596. smalltalk.Collection);
  597. smalltalk.addMethod(
  598. unescape('_new_'),
  599. smalltalk.method({
  600. selector: unescape('new%3A'),
  601. category: 'instance creation',
  602. fn: function (anInteger) {
  603. var self=this;
  604. return smalltalk.send(self, "_new", []);
  605. return self;},
  606. args: ["anInteger"],
  607. source: unescape('new%3A%20anInteger%0A%09%5Eself%20new'),
  608. messageSends: ["new"],
  609. referencedClasses: []
  610. }),
  611. smalltalk.Collection.klass);
  612. smalltalk.addMethod(
  613. unescape('_streamClass'),
  614. smalltalk.method({
  615. selector: unescape('streamClass'),
  616. category: 'accessing',
  617. fn: function () {
  618. var self=this;
  619. return (smalltalk.Stream || Stream);
  620. return self;},
  621. args: [],
  622. source: unescape('streamClass%0A%09%20%20%20%20%5EStream'),
  623. messageSends: [],
  624. referencedClasses: ["Stream"]
  625. }),
  626. smalltalk.Collection.klass);
  627. smalltalk.addMethod(
  628. unescape('_with_'),
  629. smalltalk.method({
  630. selector: unescape('with%3A'),
  631. category: 'instance creation',
  632. fn: function (anObject) {
  633. var self=this;
  634. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  635. return self;},
  636. args: ["anObject"],
  637. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself'),
  638. messageSends: ["add:", "yourself", "new"],
  639. referencedClasses: []
  640. }),
  641. smalltalk.Collection.klass);
  642. smalltalk.addMethod(
  643. unescape('_with_with_'),
  644. smalltalk.method({
  645. selector: unescape('with%3Awith%3A'),
  646. category: 'instance creation',
  647. fn: function (anObject, anotherObject) {
  648. var self=this;
  649. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  650. return self;},
  651. args: ["anObject", "anotherObject"],
  652. 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'),
  653. messageSends: ["add:", "yourself", "new"],
  654. referencedClasses: []
  655. }),
  656. smalltalk.Collection.klass);
  657. smalltalk.addMethod(
  658. unescape('_with_with_with_'),
  659. smalltalk.method({
  660. selector: unescape('with%3Awith%3Awith%3A'),
  661. category: 'instance creation',
  662. fn: function (firstObject, secondObject, thirdObject) {
  663. var self=this;
  664. 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", []));
  665. return self;},
  666. args: ["firstObject", "secondObject", "thirdObject"],
  667. 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'),
  668. messageSends: ["add:", "yourself", "new"],
  669. referencedClasses: []
  670. }),
  671. smalltalk.Collection.klass);
  672. smalltalk.addMethod(
  673. unescape('_withAll_'),
  674. smalltalk.method({
  675. selector: unescape('withAll%3A'),
  676. category: 'instance creation',
  677. fn: function (aCollection) {
  678. var self=this;
  679. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  680. return self;},
  681. args: ["aCollection"],
  682. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself'),
  683. messageSends: ["addAll:", "yourself", "new"],
  684. referencedClasses: []
  685. }),
  686. smalltalk.Collection.klass);
  687. smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
  688. smalltalk.HashedCollection.comment=unescape('A%20HashedCollection%20is%20a%20traditional%20JavaScript%20object%2C%20or%20a%20Smalltalk%20Dictionary.%0A%0AUnlike%20a%20Dictionary%2C%20it%20can%20only%20have%20strings%20as%20keys.')
  689. smalltalk.addMethod(
  690. unescape('__comma'),
  691. smalltalk.method({
  692. selector: unescape('%2C'),
  693. category: 'copying',
  694. fn: function (aCollection) {
  695. var self=this;
  696. smalltalk.send(self, "_shouldNotImplement", []);
  697. return self;},
  698. args: ["aCollection"],
  699. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement'),
  700. messageSends: ["shouldNotImplement"],
  701. referencedClasses: []
  702. }),
  703. smalltalk.HashedCollection);
  704. smalltalk.addMethod(
  705. unescape('__eq'),
  706. smalltalk.method({
  707. selector: unescape('%3D'),
  708. category: 'comparing',
  709. fn: function (aHashedCollection) {
  710. var self=this;
  711. try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aHashedCollection, "_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}})})();})]));
  712. ((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aHashedCollection, "_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}})})();})]));
  713. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aHashedCollection, "_associations", [])])}})})();
  714. return self;
  715. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  716. args: ["aHashedCollection"],
  717. source: unescape('%3D%20aHashedCollection%0A%09self%20class%20%3D%20aHashedCollection%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20size%20%3D%20aHashedCollection%20size%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20associations%20%3D%20aHashedCollection%20associations'),
  718. messageSends: ["ifFalse:", unescape("%3D"), "class", "size", "associations"],
  719. referencedClasses: []
  720. }),
  721. smalltalk.HashedCollection);
  722. smalltalk.addMethod(
  723. unescape('_add_'),
  724. smalltalk.method({
  725. selector: unescape('add%3A'),
  726. category: 'adding/removing',
  727. fn: function (anAssociation) {
  728. var self=this;
  729. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  730. return self;},
  731. args: ["anAssociation"],
  732. source: unescape('add%3A%20anAssociation%0A%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value'),
  733. messageSends: ["at:put:", "key", "value"],
  734. referencedClasses: []
  735. }),
  736. smalltalk.HashedCollection);
  737. smalltalk.addMethod(
  738. unescape('_addAll_'),
  739. smalltalk.method({
  740. selector: unescape('addAll%3A'),
  741. category: 'adding/removing',
  742. fn: function (aHashedCollection) {
  743. var self=this;
  744. smalltalk.send(self, "_addAll_", [smalltalk.send(aHashedCollection, "_associations", [])], smalltalk.Collection);
  745. return aHashedCollection;
  746. return self;},
  747. args: ["aHashedCollection"],
  748. source: unescape('addAll%3A%20aHashedCollection%0A%09super%20addAll%3A%20aHashedCollection%20associations.%0A%09%5EaHashedCollection'),
  749. messageSends: ["addAll:", "associations"],
  750. referencedClasses: []
  751. }),
  752. smalltalk.HashedCollection);
  753. smalltalk.addMethod(
  754. unescape('_asDictionary'),
  755. smalltalk.method({
  756. selector: unescape('asDictionary'),
  757. category: 'converting',
  758. fn: function () {
  759. var self=this;
  760. return smalltalk.send((smalltalk.Dictionary || Dictionary), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  761. return self;},
  762. args: [],
  763. source: unescape('asDictionary%0A%09%5EDictionary%20fromPairs%3A%20self%20associations'),
  764. messageSends: ["fromPairs:", "associations"],
  765. referencedClasses: ["Dictionary"]
  766. }),
  767. smalltalk.HashedCollection);
  768. smalltalk.addMethod(
  769. unescape('_asJSON'),
  770. smalltalk.method({
  771. selector: unescape('asJSON'),
  772. category: 'converting',
  773. fn: function (){
  774. var self=this;
  775. var c=nil;
  776. (c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  777. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(c, "_at_put_", [key, smalltalk.send(value, "_asJSON", [])]);})]);
  778. return c;
  779. return self;},
  780. args: [],
  781. source: unescape('asJSON%0A%09%7C%20c%20%7C%0A%09c%20%3A%3D%20self%20class%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09c%20at%3A%20key%20put%3A%20value%20asJSON%5D.%0A%09%5Ec'),
  782. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "asJSON"],
  783. referencedClasses: []
  784. }),
  785. smalltalk.HashedCollection);
  786. smalltalk.addMethod(
  787. unescape('_associations'),
  788. smalltalk.method({
  789. selector: unescape('associations'),
  790. category: 'accessing',
  791. fn: function () {
  792. var self=this;
  793. var associations=nil;
  794. (associations=[]);
  795. 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])])]);})]);
  796. return associations;
  797. return self;},
  798. args: [],
  799. 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'),
  800. messageSends: ["do:", "keys", "add:", "key:value:", "at:"],
  801. referencedClasses: ["Association"]
  802. }),
  803. smalltalk.HashedCollection);
  804. smalltalk.addMethod(
  805. unescape('_associationsDo_'),
  806. smalltalk.method({
  807. selector: unescape('associationsDo%3A'),
  808. category: 'enumerating',
  809. fn: function (aBlock) {
  810. var self=this;
  811. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  812. return self;},
  813. args: ["aBlock"],
  814. source: unescape('associationsDo%3A%20aBlock%0A%09self%20associations%20do%3A%20aBlock'),
  815. messageSends: ["do:", "associations"],
  816. referencedClasses: []
  817. }),
  818. smalltalk.HashedCollection);
  819. smalltalk.addMethod(
  820. unescape('_at_'),
  821. smalltalk.method({
  822. selector: unescape('at%3A'),
  823. category: 'accessing',
  824. fn: function (aKey) {
  825. var self=this;
  826. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  827. return self;},
  828. args: ["aKey"],
  829. source: unescape('at%3A%20aKey%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  830. messageSends: ["at:ifAbsent:", "errorNotFound"],
  831. referencedClasses: []
  832. }),
  833. smalltalk.HashedCollection);
  834. smalltalk.addMethod(
  835. unescape('_at_ifAbsent_'),
  836. smalltalk.method({
  837. selector: unescape('at%3AifAbsent%3A'),
  838. category: 'accessing',
  839. fn: function (aKey, aBlock) {
  840. var self=this;
  841. return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  842. return self;},
  843. args: ["aKey", "aBlock"],
  844. 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'),
  845. messageSends: ["ifTrue:ifFalse:", "includesKey:", "basicAt:"],
  846. referencedClasses: []
  847. }),
  848. smalltalk.HashedCollection);
  849. smalltalk.addMethod(
  850. unescape('_at_ifAbsentPut_'),
  851. smalltalk.method({
  852. selector: unescape('at%3AifAbsentPut%3A'),
  853. category: 'accessing',
  854. fn: function (aKey, aBlock) {
  855. var self=this;
  856. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  857. return self;},
  858. args: ["aKey", "aBlock"],
  859. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D'),
  860. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  861. referencedClasses: []
  862. }),
  863. smalltalk.HashedCollection);
  864. smalltalk.addMethod(
  865. unescape('_at_ifPresent_'),
  866. smalltalk.method({
  867. selector: unescape('at%3AifPresent%3A'),
  868. category: 'accessing',
  869. fn: function (aKey, aBlock) {
  870. var self=this;
  871. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  872. return self;},
  873. args: ["aKey", "aBlock"],
  874. 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'),
  875. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  876. referencedClasses: []
  877. }),
  878. smalltalk.HashedCollection);
  879. smalltalk.addMethod(
  880. unescape('_at_ifPresent_ifAbsent_'),
  881. smalltalk.method({
  882. selector: unescape('at%3AifPresent%3AifAbsent%3A'),
  883. category: 'accessing',
  884. fn: function (aKey, aBlock, anotherBlock) {
  885. var self=this;
  886. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  887. return self;},
  888. args: ["aKey", "aBlock", "anotherBlock"],
  889. 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'),
  890. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  891. referencedClasses: []
  892. }),
  893. smalltalk.HashedCollection);
  894. smalltalk.addMethod(
  895. unescape('_at_put_'),
  896. smalltalk.method({
  897. selector: unescape('at%3Aput%3A'),
  898. category: 'accessing',
  899. fn: function (aKey, aValue) {
  900. var self=this;
  901. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  902. return self;},
  903. args: ["aKey", "aValue"],
  904. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue'),
  905. messageSends: ["basicAt:put:"],
  906. referencedClasses: []
  907. }),
  908. smalltalk.HashedCollection);
  909. smalltalk.addMethod(
  910. unescape('_collect_'),
  911. smalltalk.method({
  912. selector: unescape('collect%3A'),
  913. category: 'enumerating',
  914. fn: function (aBlock) {
  915. var self=this;
  916. var newDict=nil;
  917. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  918. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  919. return newDict;
  920. return self;},
  921. args: ["aBlock"],
  922. source: unescape('collect%3A%20aBlock%0A%09%7C%20newDict%20%7C%0A%09newDict%20%3A%3D%20self%20class%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%20%20%20%20newDict%20at%3A%20key%20put%3A%20%28aBlock%20value%3A%20value%29%5D.%0A%09%5EnewDict'),
  923. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  924. referencedClasses: []
  925. }),
  926. smalltalk.HashedCollection);
  927. smalltalk.addMethod(
  928. unescape('_copyFrom_to_'),
  929. smalltalk.method({
  930. selector: unescape('copyFrom%3Ato%3A'),
  931. category: 'copying',
  932. fn: function (anIndex, anotherIndex) {
  933. var self=this;
  934. smalltalk.send(self, "_shouldNotImplement", []);
  935. return self;},
  936. args: ["anIndex", "anotherIndex"],
  937. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement'),
  938. messageSends: ["shouldNotImplement"],
  939. referencedClasses: []
  940. }),
  941. smalltalk.HashedCollection);
  942. smalltalk.addMethod(
  943. unescape('_deepCopy'),
  944. smalltalk.method({
  945. selector: unescape('deepCopy'),
  946. category: 'copying',
  947. fn: function () {
  948. var self=this;
  949. var copy=nil;
  950. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  951. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(smalltalk.send(each, "_value", []), "_deepCopy", [])]);})]);
  952. return copy;
  953. return self;},
  954. args: [],
  955. 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'),
  956. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "deepCopy", "value"],
  957. referencedClasses: []
  958. }),
  959. smalltalk.HashedCollection);
  960. smalltalk.addMethod(
  961. unescape('_detect_ifNone_'),
  962. smalltalk.method({
  963. selector: unescape('detect%3AifNone%3A'),
  964. category: 'enumerating',
  965. fn: function (aBlock, anotherBlock) {
  966. var self=this;
  967. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  968. return self;},
  969. args: ["aBlock", "anotherBlock"],
  970. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  971. messageSends: ["detect:ifNone:", "values"],
  972. referencedClasses: []
  973. }),
  974. smalltalk.HashedCollection);
  975. smalltalk.addMethod(
  976. unescape('_do_'),
  977. smalltalk.method({
  978. selector: unescape('do%3A'),
  979. category: 'enumerating',
  980. fn: function (aBlock) {
  981. var self=this;
  982. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  983. return self;},
  984. args: ["aBlock"],
  985. source: unescape('do%3A%20aBlock%0A%09self%20values%20do%3A%20aBlock'),
  986. messageSends: ["do:", "values"],
  987. referencedClasses: []
  988. }),
  989. smalltalk.HashedCollection);
  990. smalltalk.addMethod(
  991. unescape('_includes_'),
  992. smalltalk.method({
  993. selector: unescape('includes%3A'),
  994. category: 'enumerating',
  995. fn: function (anObject) {
  996. var self=this;
  997. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  998. return self;},
  999. args: ["anObject"],
  1000. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject'),
  1001. messageSends: ["includes:", "values"],
  1002. referencedClasses: []
  1003. }),
  1004. smalltalk.HashedCollection);
  1005. smalltalk.addMethod(
  1006. unescape('_includesKey_'),
  1007. smalltalk.method({
  1008. selector: unescape('includesKey%3A'),
  1009. category: 'testing',
  1010. fn: function (aKey) {
  1011. var self=this;
  1012. return self.hasOwnProperty(aKey);
  1013. return self;},
  1014. args: ["aKey"],
  1015. source: unescape('includesKey%3A%20aKey%0A%09%3Creturn%20self.hasOwnProperty%28aKey%29%3E'),
  1016. messageSends: [],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.HashedCollection);
  1020. smalltalk.addMethod(
  1021. unescape('_keys'),
  1022. smalltalk.method({
  1023. selector: unescape('keys'),
  1024. category: 'accessing',
  1025. fn: function () {
  1026. var self=this;
  1027. var keys = [];
  1028. for(var i in self) {
  1029. if(self.hasOwnProperty(i)) {
  1030. keys.push(i);
  1031. }
  1032. };
  1033. return keys;
  1034. ;
  1035. return self;},
  1036. args: [],
  1037. 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'),
  1038. messageSends: [],
  1039. referencedClasses: []
  1040. }),
  1041. smalltalk.HashedCollection);
  1042. smalltalk.addMethod(
  1043. unescape('_keysAndValuesDo_'),
  1044. smalltalk.method({
  1045. selector: unescape('keysAndValuesDo%3A'),
  1046. category: 'enumerating',
  1047. fn: function (aBlock) {
  1048. var self=this;
  1049. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  1050. return self;},
  1051. args: ["aBlock"],
  1052. source: unescape('keysAndValuesDo%3A%20aBlock%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D'),
  1053. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  1054. referencedClasses: []
  1055. }),
  1056. smalltalk.HashedCollection);
  1057. smalltalk.addMethod(
  1058. unescape('_printString'),
  1059. smalltalk.method({
  1060. selector: unescape('printString'),
  1061. category: 'printing',
  1062. fn: function () {
  1063. var self=this;
  1064. 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")]);})]);
  1065. return self;},
  1066. args: [],
  1067. 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'),
  1068. messageSends: ["streamContents:", "nextPutAll:", "printString", "do:separatedBy:", "associations", "key", "value"],
  1069. referencedClasses: ["String"]
  1070. }),
  1071. smalltalk.HashedCollection);
  1072. smalltalk.addMethod(
  1073. unescape('_remove_ifAbsent_'),
  1074. smalltalk.method({
  1075. selector: unescape('remove%3AifAbsent%3A'),
  1076. category: 'adding/removing',
  1077. fn: function (aKey, aBlock) {
  1078. var self=this;
  1079. return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
  1080. return self;},
  1081. args: ["aKey", "aBlock"],
  1082. source: unescape('remove%3A%20aKey%20ifAbsent%3A%20aBlock%0A%20%20%20%20%5Eself%20removeKey%3A%20aKey%20ifAbsent%3A%20aBlock'),
  1083. messageSends: ["removeKey:ifAbsent:"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.HashedCollection);
  1087. smalltalk.addMethod(
  1088. unescape('_removeKey_'),
  1089. smalltalk.method({
  1090. selector: unescape('removeKey%3A'),
  1091. category: 'adding/removing',
  1092. fn: function (aKey){
  1093. var self=this;
  1094. return smalltalk.send(self, "_remove_", [aKey]);
  1095. return self;},
  1096. args: ["aKey"],
  1097. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20%5Eself%20remove%3A%20aKey'),
  1098. messageSends: ["remove:"],
  1099. referencedClasses: []
  1100. }),
  1101. smalltalk.HashedCollection);
  1102. smalltalk.addMethod(
  1103. unescape('_removeKey_ifAbsent_'),
  1104. smalltalk.method({
  1105. selector: unescape('removeKey%3AifAbsent%3A'),
  1106. category: 'adding/removing',
  1107. fn: function (aKey, aBlock) {
  1108. var self=this;
  1109. 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]);})]));
  1110. return self;},
  1111. args: ["aKey", "aBlock"],
  1112. 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'),
  1113. messageSends: ["ifFalse:ifTrue:", "includesKey:", "value", "basicDelete:"],
  1114. referencedClasses: []
  1115. }),
  1116. smalltalk.HashedCollection);
  1117. smalltalk.addMethod(
  1118. unescape('_select_'),
  1119. smalltalk.method({
  1120. selector: unescape('select%3A'),
  1121. category: 'enumerating',
  1122. fn: function (aBlock) {
  1123. var self=this;
  1124. var newDict=nil;
  1125. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  1126. 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]);})]));})]);
  1127. return newDict;
  1128. return self;},
  1129. args: ["aBlock"],
  1130. source: unescape('select%3A%20aBlock%0A%09%7C%20newDict%20%7C%0A%09newDict%20%3A%3D%20self%20class%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%09%5EnewDict'),
  1131. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  1132. referencedClasses: []
  1133. }),
  1134. smalltalk.HashedCollection);
  1135. smalltalk.addMethod(
  1136. unescape('_shallowCopy'),
  1137. smalltalk.method({
  1138. selector: unescape('shallowCopy'),
  1139. category: 'copying',
  1140. fn: function () {
  1141. var self=this;
  1142. var copy=nil;
  1143. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  1144. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  1145. return copy;
  1146. return self;},
  1147. args: [],
  1148. 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'),
  1149. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  1150. referencedClasses: []
  1151. }),
  1152. smalltalk.HashedCollection);
  1153. smalltalk.addMethod(
  1154. unescape('_size'),
  1155. smalltalk.method({
  1156. selector: unescape('size'),
  1157. category: 'accessing',
  1158. fn: function () {
  1159. var self=this;
  1160. return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
  1161. return self;},
  1162. args: [],
  1163. source: unescape('size%0A%09%5Eself%20keys%20size'),
  1164. messageSends: ["size", "keys"],
  1165. referencedClasses: []
  1166. }),
  1167. smalltalk.HashedCollection);
  1168. smalltalk.addMethod(
  1169. unescape('_storeOn_'),
  1170. smalltalk.method({
  1171. selector: unescape('storeOn%3A'),
  1172. category: 'printing',
  1173. fn: function (aStream) {
  1174. var self=this;
  1175. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  1176. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  1177. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  1178. return self;},
  1179. args: ["aStream"],
  1180. 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'),
  1181. messageSends: ["nextPutAll:", "do:separatedBy:", "associations", "storeOn:"],
  1182. referencedClasses: []
  1183. }),
  1184. smalltalk.HashedCollection);
  1185. smalltalk.addMethod(
  1186. unescape('_values'),
  1187. smalltalk.method({
  1188. selector: unescape('values'),
  1189. category: 'accessing',
  1190. fn: function () {
  1191. var self=this;
  1192. return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  1193. return self;},
  1194. args: [],
  1195. source: unescape('values%0A%09%5Eself%20keys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D'),
  1196. messageSends: ["collect:", "keys", "at:"],
  1197. referencedClasses: []
  1198. }),
  1199. smalltalk.HashedCollection);
  1200. smalltalk.addMethod(
  1201. unescape('_fromPairs_'),
  1202. smalltalk.method({
  1203. selector: unescape('fromPairs%3A'),
  1204. category: 'instance creation',
  1205. fn: function (aCollection) {
  1206. var self=this;
  1207. var dict=nil;
  1208. (dict=smalltalk.send(self, "_new", []));
  1209. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  1210. return dict;
  1211. return self;},
  1212. args: ["aCollection"],
  1213. 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'),
  1214. messageSends: ["new", "do:", "add:"],
  1215. referencedClasses: []
  1216. }),
  1217. smalltalk.HashedCollection.klass);
  1218. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  1219. smalltalk.addMethod(
  1220. unescape('_asHashedCollection'),
  1221. smalltalk.method({
  1222. selector: unescape('asHashedCollection'),
  1223. category: 'converting',
  1224. fn: function () {
  1225. var self=this;
  1226. return smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  1227. return self;},
  1228. args: [],
  1229. source: unescape('asHashedCollection%0A%09%5EHashedCollection%20fromPairs%3A%20self%20associations'),
  1230. messageSends: ["fromPairs:", "associations"],
  1231. referencedClasses: ["HashedCollection"]
  1232. }),
  1233. smalltalk.Dictionary);
  1234. smalltalk.addMethod(
  1235. unescape('_asJSON'),
  1236. smalltalk.method({
  1237. selector: unescape('asJSON'),
  1238. category: 'converting',
  1239. fn: function (){
  1240. var self=this;
  1241. return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
  1242. return self;},
  1243. args: [],
  1244. source: unescape('asJSON%0A%09%5Eself%20asHashedCollection%20asJSON'),
  1245. messageSends: ["asJSON", "asHashedCollection"],
  1246. referencedClasses: []
  1247. }),
  1248. smalltalk.Dictionary);
  1249. smalltalk.addMethod(
  1250. unescape('_at_ifAbsent_'),
  1251. smalltalk.method({
  1252. selector: unescape('at%3AifAbsent%3A'),
  1253. category: 'accessing',
  1254. fn: function (aKey, aBlock) {
  1255. var self=this;
  1256. var index;
  1257. for(var i=0;i<self['@keys'].length;i++){
  1258. if(self['@keys'][i].__eq(aKey)) {index = i;}
  1259. };
  1260. if(typeof index === 'undefined') {
  1261. return aBlock();
  1262. } else {
  1263. return self['@values'][index];
  1264. }
  1265. ;
  1266. return self;},
  1267. args: ["aKey", "aBlock"],
  1268. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09var%20index%3B%0A%09%09for%28var%20i%3D0%3Bi%3Cself%5B%27@keys%27%5D.length%3Bi++%29%7B%0A%09%09%09if%28self%5B%27@keys%27%5D%5Bi%5D.__eq%28aKey%29%29%20%7Bindex%20%3D%20i%3B%7D%0A%09%09%7D%3B%0A%09%09if%28typeof%20index%20%3D%3D%3D%20%27undefined%27%29%20%7B%0A%09%09%09return%20aBlock%28%29%3B%0A%09%09%7D%20else%20%7B%0A%09%09%09return%20self%5B%27@values%27%5D%5Bindex%5D%3B%0A%09%09%7D%0A%09%3E'),
  1269. messageSends: [],
  1270. referencedClasses: []
  1271. }),
  1272. smalltalk.Dictionary);
  1273. smalltalk.addMethod(
  1274. unescape('_at_put_'),
  1275. smalltalk.method({
  1276. selector: unescape('at%3Aput%3A'),
  1277. category: 'accessing',
  1278. fn: function (aKey, aValue) {
  1279. var self=this;
  1280. var index = self['@keys'].indexOf(aKey);
  1281. if(index === -1) {
  1282. self['@values'].push(aValue);
  1283. self['@keys'].push(aKey);
  1284. } else {
  1285. self['@values'][index] = aValue;
  1286. };
  1287. return aValue;
  1288. ;
  1289. return self;},
  1290. args: ["aKey", "aValue"],
  1291. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%3C%0A%09%09var%20index%20%3D%20self%5B%27@keys%27%5D.indexOf%28aKey%29%3B%0A%09%09if%28index%20%3D%3D%3D%20-1%29%20%7B%0A%09%09%09self%5B%27@values%27%5D.push%28aValue%29%3B%0A%09%09%09self%5B%27@keys%27%5D.push%28aKey%29%3B%0A%09%09%7D%20else%20%7B%0A%09%09%09self%5B%27@values%27%5D%5Bindex%5D%20%3D%20aValue%3B%0A%09%09%7D%3B%0A%0A%09%09return%20aValue%3B%0A%09%3E'),
  1292. messageSends: [],
  1293. referencedClasses: []
  1294. }),
  1295. smalltalk.Dictionary);
  1296. smalltalk.addMethod(
  1297. unescape('_includesKey_'),
  1298. smalltalk.method({
  1299. selector: unescape('includesKey%3A'),
  1300. category: 'testing',
  1301. fn: function (aKey) {
  1302. var self=this;
  1303. return smalltalk.send(self['@keys'], "_includes_", [aKey]);
  1304. return self;},
  1305. args: ["aKey"],
  1306. source: unescape('includesKey%3A%20aKey%0A%09%5Ekeys%20includes%3A%20aKey'),
  1307. messageSends: ["includes:"],
  1308. referencedClasses: []
  1309. }),
  1310. smalltalk.Dictionary);
  1311. smalltalk.addMethod(
  1312. unescape('_initialize'),
  1313. smalltalk.method({
  1314. selector: unescape('initialize'),
  1315. category: 'initialization',
  1316. fn: function () {
  1317. var self=this;
  1318. smalltalk.send(self, "_initialize", [], smalltalk.HashedCollection);
  1319. (self['@keys']=[]);
  1320. (self['@values']=[]);
  1321. return self;},
  1322. args: [],
  1323. source: unescape('initialize%0A%09super%20initialize.%0A%09keys%20%3A%3D%20%23%28%29.%0A%09values%20%3A%3D%20%23%28%29'),
  1324. messageSends: ["initialize"],
  1325. referencedClasses: []
  1326. }),
  1327. smalltalk.Dictionary);
  1328. smalltalk.addMethod(
  1329. unescape('_keys'),
  1330. smalltalk.method({
  1331. selector: unescape('keys'),
  1332. category: 'accessing',
  1333. fn: function () {
  1334. var self=this;
  1335. return smalltalk.send(self['@keys'], "_copy", []);
  1336. return self;},
  1337. args: [],
  1338. source: unescape('keys%0A%09%5Ekeys%20copy'),
  1339. messageSends: ["copy"],
  1340. referencedClasses: []
  1341. }),
  1342. smalltalk.Dictionary);
  1343. smalltalk.addMethod(
  1344. unescape('_removeKey_ifAbsent_'),
  1345. smalltalk.method({
  1346. selector: unescape('removeKey%3AifAbsent%3A'),
  1347. category: 'adding/removing',
  1348. fn: function (aKey, aBlock){
  1349. var self=this;
  1350. var index = self['@keys'].indexOf(aKey);
  1351. if(index === -1) {
  1352. return aBlock()
  1353. } else {
  1354. var value;
  1355. self['@keys'].splice(index, 1);
  1356. value = self['@values'].splice(index, 1);
  1357. return value[0];
  1358. };
  1359. ;
  1360. return self;},
  1361. args: ["aKey", "aBlock"],
  1362. source: unescape('removeKey%3A%20aKey%20ifAbsent%3A%20aBlock%0A%20%20%20%20%3C%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20index%20%3D%20self%5B%27@keys%27%5D.indexOf%28aKey%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%28index%20%3D%3D%3D%20-1%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20aBlock%28%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20value%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%5B%27@keys%27%5D.splice%28index%2C%201%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%20%3D%20self%5B%27@values%27%5D.splice%28index%2C%201%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20value%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%3E'),
  1363. messageSends: [],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.Dictionary);
  1367. smalltalk.addMethod(
  1368. unescape('_values'),
  1369. smalltalk.method({
  1370. selector: unescape('values'),
  1371. category: 'accessing',
  1372. fn: function () {
  1373. var self=this;
  1374. return smalltalk.send(self['@values'], "_copy", []);
  1375. return self;},
  1376. args: [],
  1377. source: unescape('values%0A%09%5Evalues%20copy'),
  1378. messageSends: ["copy"],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.Dictionary);
  1382. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  1383. smalltalk.addMethod(
  1384. unescape('__eq'),
  1385. smalltalk.method({
  1386. selector: unescape('%3D'),
  1387. category: 'comparing',
  1388. fn: function (aCollection) {
  1389. var self=this;
  1390. 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}})})();})]));
  1391. 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}})})();})]));})]);
  1392. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  1393. return self;
  1394. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  1395. args: ["aCollection"],
  1396. source: unescape('%3D%20aCollection%0A%09%28self%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%09%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'),
  1397. messageSends: ["ifFalse:", "and:", unescape("%3D"), "class", "size", "withIndexDo:", "at:"],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.SequenceableCollection);
  1401. smalltalk.addMethod(
  1402. unescape('_addLast_'),
  1403. smalltalk.method({
  1404. selector: unescape('addLast%3A'),
  1405. category: 'adding',
  1406. fn: function (anObject) {
  1407. var self=this;
  1408. smalltalk.send(self, "_add_", [anObject]);
  1409. return self;},
  1410. args: ["anObject"],
  1411. source: unescape('addLast%3A%20anObject%0A%09self%20add%3A%20anObject'),
  1412. messageSends: ["add:"],
  1413. referencedClasses: []
  1414. }),
  1415. smalltalk.SequenceableCollection);
  1416. smalltalk.addMethod(
  1417. unescape('_allButFirst'),
  1418. smalltalk.method({
  1419. selector: unescape('allButFirst'),
  1420. category: 'accessing',
  1421. fn: function () {
  1422. var self=this;
  1423. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  1424. return self;},
  1425. args: [],
  1426. source: unescape('allButFirst%0A%09%5Eself%20copyFrom%3A%202%20to%3A%20self%20size'),
  1427. messageSends: ["copyFrom:to:", "size"],
  1428. referencedClasses: []
  1429. }),
  1430. smalltalk.SequenceableCollection);
  1431. smalltalk.addMethod(
  1432. unescape('_allButLast'),
  1433. smalltalk.method({
  1434. selector: unescape('allButLast'),
  1435. category: 'accessing',
  1436. fn: function () {
  1437. var self=this;
  1438. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  1439. return self;},
  1440. args: [],
  1441. source: unescape('allButLast%0A%09%5Eself%20copyFrom%3A%201%20to%3A%20self%20size%20-%201'),
  1442. messageSends: ["copyFrom:to:", unescape("-"), "size"],
  1443. referencedClasses: []
  1444. }),
  1445. smalltalk.SequenceableCollection);
  1446. smalltalk.addMethod(
  1447. unescape('_at_'),
  1448. smalltalk.method({
  1449. selector: unescape('at%3A'),
  1450. category: 'accessing',
  1451. fn: function (anIndex) {
  1452. var self=this;
  1453. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1454. return self;},
  1455. args: ["anIndex"],
  1456. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D'),
  1457. messageSends: ["at:ifAbsent:", "errorNotFound"],
  1458. referencedClasses: []
  1459. }),
  1460. smalltalk.SequenceableCollection);
  1461. smalltalk.addMethod(
  1462. unescape('_at_ifAbsent_'),
  1463. smalltalk.method({
  1464. selector: unescape('at%3AifAbsent%3A'),
  1465. category: 'accessing',
  1466. fn: function (anIndex, aBlock) {
  1467. var self=this;
  1468. smalltalk.send(self, "_subclassResponsibility", []);
  1469. return self;},
  1470. args: ["anIndex", "aBlock"],
  1471. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility'),
  1472. messageSends: ["subclassResponsibility"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.SequenceableCollection);
  1476. smalltalk.addMethod(
  1477. unescape('_at_put_'),
  1478. smalltalk.method({
  1479. selector: unescape('at%3Aput%3A'),
  1480. category: 'accessing',
  1481. fn: function (anIndex, anObject) {
  1482. var self=this;
  1483. smalltalk.send(self, "_subclassResponsibility", []);
  1484. return self;},
  1485. args: ["anIndex", "anObject"],
  1486. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility'),
  1487. messageSends: ["subclassResponsibility"],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.SequenceableCollection);
  1491. smalltalk.addMethod(
  1492. unescape('_atRandom'),
  1493. smalltalk.method({
  1494. selector: unescape('atRandom'),
  1495. category: 'accessing',
  1496. fn: function () {
  1497. var self=this;
  1498. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  1499. return self;},
  1500. args: [],
  1501. source: unescape('atRandom%0A%09%5E%20self%20at%3A%20self%20size%20atRandom'),
  1502. messageSends: ["at:", "atRandom", "size"],
  1503. referencedClasses: []
  1504. }),
  1505. smalltalk.SequenceableCollection);
  1506. smalltalk.addMethod(
  1507. unescape('_copyFrom_to_'),
  1508. smalltalk.method({
  1509. selector: unescape('copyFrom%3Ato%3A'),
  1510. category: 'copying',
  1511. fn: function (anIndex, anotherIndex) {
  1512. var self=this;
  1513. var range=nil;
  1514. var newCollection=nil;
  1515. (range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
  1516. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
  1517. smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
  1518. return newCollection;
  1519. return self;},
  1520. args: ["anIndex", "anotherIndex"],
  1521. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20range%20newCollection%20%7C%0A%09range%20%3A%3D%20anIndex%20to%3A%20anotherIndex.%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20range%20size.%0A%09range%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%09%20%20%20%20newCollection%20at%3A%20i%20put%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5EnewCollection'),
  1522. messageSends: ["to:", "new:", "class", "size", "withIndexDo:", "at:put:", "at:"],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.SequenceableCollection);
  1526. smalltalk.addMethod(
  1527. unescape('_deepCopy'),
  1528. smalltalk.method({
  1529. selector: unescape('deepCopy'),
  1530. category: 'copying',
  1531. fn: function () {
  1532. var self=this;
  1533. var newCollection=nil;
  1534. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1535. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, smalltalk.send(each, "_deepCopy", [])]);})]);
  1536. return newCollection;
  1537. return self;},
  1538. args: [],
  1539. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20self%20size.%0A%09self%20withIndexDo%3A%20%5B%3Aeach%20%3Aindex%20%7C%20%0A%09%09newCollection%20at%3A%20index%20put%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection'),
  1540. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:", "deepCopy"],
  1541. referencedClasses: []
  1542. }),
  1543. smalltalk.SequenceableCollection);
  1544. smalltalk.addMethod(
  1545. unescape('_first'),
  1546. smalltalk.method({
  1547. selector: unescape('first'),
  1548. category: 'accessing',
  1549. fn: function () {
  1550. var self=this;
  1551. return smalltalk.send(self, "_at_", [(1)]);
  1552. return self;},
  1553. args: [],
  1554. source: unescape('first%0A%09%5Eself%20at%3A%201'),
  1555. messageSends: ["at:"],
  1556. referencedClasses: []
  1557. }),
  1558. smalltalk.SequenceableCollection);
  1559. smalltalk.addMethod(
  1560. unescape('_first_'),
  1561. smalltalk.method({
  1562. selector: unescape('first%3A'),
  1563. category: 'accessing',
  1564. fn: function (n){
  1565. var self=this;
  1566. return smalltalk.send(self, "_copyFrom_to_", [(1), n]);
  1567. return self;},
  1568. args: ["n"],
  1569. source: unescape('first%3A%20n%0A%09%22Answer%20the%20first%20n%20elements%20of%20the%20receiver.%0A%09Raise%20an%20error%20if%20there%20are%20not%20enough%20elements.%22%0A%0A%09%5E%20self%20copyFrom%3A%201%20to%3A%20n'),
  1570. messageSends: ["copyFrom:to:"],
  1571. referencedClasses: []
  1572. }),
  1573. smalltalk.SequenceableCollection);
  1574. smalltalk.addMethod(
  1575. unescape('_fourth'),
  1576. smalltalk.method({
  1577. selector: unescape('fourth'),
  1578. category: 'accessing',
  1579. fn: function () {
  1580. var self=this;
  1581. return smalltalk.send(self, "_at_", [(4)]);
  1582. return self;},
  1583. args: [],
  1584. source: unescape('fourth%0A%09%5Eself%20at%3A%204'),
  1585. messageSends: ["at:"],
  1586. referencedClasses: []
  1587. }),
  1588. smalltalk.SequenceableCollection);
  1589. smalltalk.addMethod(
  1590. unescape('_indexOf_'),
  1591. smalltalk.method({
  1592. selector: unescape('indexOf%3A'),
  1593. category: 'accessing',
  1594. fn: function (anObject) {
  1595. var self=this;
  1596. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1597. return self;},
  1598. args: ["anObject"],
  1599. source: unescape('indexOf%3A%20anObject%0A%09%5Eself%20indexOf%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  1600. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  1601. referencedClasses: []
  1602. }),
  1603. smalltalk.SequenceableCollection);
  1604. smalltalk.addMethod(
  1605. unescape('_indexOf_ifAbsent_'),
  1606. smalltalk.method({
  1607. selector: unescape('indexOf%3AifAbsent%3A'),
  1608. category: 'accessing',
  1609. fn: function (anObject, aBlock) {
  1610. var self=this;
  1611. for(var i=0;i<self.length;i++){
  1612. if(self[i].__eq(anObject)) {return i+1}
  1613. }
  1614. return aBlock();
  1615. ;
  1616. return self;},
  1617. args: ["anObject", "aBlock"],
  1618. 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'),
  1619. messageSends: [],
  1620. referencedClasses: []
  1621. }),
  1622. smalltalk.SequenceableCollection);
  1623. smalltalk.addMethod(
  1624. unescape('_indexOf_startingAt_'),
  1625. smalltalk.method({
  1626. selector: unescape('indexOf%3AstartingAt%3A'),
  1627. category: 'accessing',
  1628. fn: function (anObject, start) {
  1629. var self=this;
  1630. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  1631. return self;},
  1632. args: ["anObject", "start"],
  1633. 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'),
  1634. messageSends: ["indexOf:startingAt:ifAbsent:"],
  1635. referencedClasses: []
  1636. }),
  1637. smalltalk.SequenceableCollection);
  1638. smalltalk.addMethod(
  1639. unescape('_indexOf_startingAt_ifAbsent_'),
  1640. smalltalk.method({
  1641. selector: unescape('indexOf%3AstartingAt%3AifAbsent%3A'),
  1642. category: 'accessing',
  1643. fn: function (anObject, start, aBlock) {
  1644. var self=this;
  1645. for(var i=start-1;i<self.length;i++){
  1646. if(self[i].__eq(anObject)) {return i+1}
  1647. }
  1648. return aBlock();
  1649. ;
  1650. return self;},
  1651. args: ["anObject", "start", "aBlock"],
  1652. 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'),
  1653. messageSends: [],
  1654. referencedClasses: []
  1655. }),
  1656. smalltalk.SequenceableCollection);
  1657. smalltalk.addMethod(
  1658. unescape('_last'),
  1659. smalltalk.method({
  1660. selector: unescape('last'),
  1661. category: 'accessing',
  1662. fn: function () {
  1663. var self=this;
  1664. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  1665. return self;},
  1666. args: [],
  1667. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size'),
  1668. messageSends: ["at:", "size"],
  1669. referencedClasses: []
  1670. }),
  1671. smalltalk.SequenceableCollection);
  1672. smalltalk.addMethod(
  1673. unescape('_printString'),
  1674. smalltalk.method({
  1675. selector: unescape('printString'),
  1676. category: 'printing',
  1677. fn: function () {
  1678. var self=this;
  1679. var str=nil;
  1680. (str=smalltalk.send("", "_writeStream", []));
  1681. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Collection), "__comma", [unescape("%20%28")])]);
  1682. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  1683. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  1684. return smalltalk.send(str, "_contents", []);
  1685. return self;},
  1686. args: [],
  1687. 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'),
  1688. messageSends: ["writeStream", "nextPutAll:", unescape("%2C"), "printString", "do:separatedBy:", "contents"],
  1689. referencedClasses: []
  1690. }),
  1691. smalltalk.SequenceableCollection);
  1692. smalltalk.addMethod(
  1693. unescape('_removeLast'),
  1694. smalltalk.method({
  1695. selector: unescape('removeLast'),
  1696. category: 'adding',
  1697. fn: function () {
  1698. var self=this;
  1699. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  1700. return self;},
  1701. args: [],
  1702. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last'),
  1703. messageSends: ["remove:", "last"],
  1704. referencedClasses: []
  1705. }),
  1706. smalltalk.SequenceableCollection);
  1707. smalltalk.addMethod(
  1708. unescape('_reversed'),
  1709. smalltalk.method({
  1710. selector: unescape('reversed'),
  1711. category: 'converting',
  1712. fn: function () {
  1713. var self=this;
  1714. smalltalk.send(self, "_subclassResponsibility", []);
  1715. return self;},
  1716. args: [],
  1717. source: unescape('reversed%0A%09self%20subclassResponsibility'),
  1718. messageSends: ["subclassResponsibility"],
  1719. referencedClasses: []
  1720. }),
  1721. smalltalk.SequenceableCollection);
  1722. smalltalk.addMethod(
  1723. unescape('_second'),
  1724. smalltalk.method({
  1725. selector: unescape('second'),
  1726. category: 'accessing',
  1727. fn: function () {
  1728. var self=this;
  1729. return smalltalk.send(self, "_at_", [(2)]);
  1730. return self;},
  1731. args: [],
  1732. source: unescape('second%0A%09%5Eself%20at%3A%202'),
  1733. messageSends: ["at:"],
  1734. referencedClasses: []
  1735. }),
  1736. smalltalk.SequenceableCollection);
  1737. smalltalk.addMethod(
  1738. unescape('_shallowCopy'),
  1739. smalltalk.method({
  1740. selector: unescape('shallowCopy'),
  1741. category: 'copying',
  1742. fn: function () {
  1743. var self=this;
  1744. var newCollection=nil;
  1745. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1746. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, each]);})]);
  1747. return newCollection;
  1748. return self;},
  1749. args: [],
  1750. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20self%20size.%0A%09self%20withIndexDo%3A%20%5B%20%3Aeach%20%3Aindex%20%7C%20%0A%09%09newCollection%20at%3A%20index%20put%3A%20each%5D.%0A%09%5EnewCollection'),
  1751. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:"],
  1752. referencedClasses: []
  1753. }),
  1754. smalltalk.SequenceableCollection);
  1755. smalltalk.addMethod(
  1756. unescape('_third'),
  1757. smalltalk.method({
  1758. selector: unescape('third'),
  1759. category: 'accessing',
  1760. fn: function () {
  1761. var self=this;
  1762. return smalltalk.send(self, "_at_", [(3)]);
  1763. return self;},
  1764. args: [],
  1765. source: unescape('third%0A%09%5Eself%20at%3A%203'),
  1766. messageSends: ["at:"],
  1767. referencedClasses: []
  1768. }),
  1769. smalltalk.SequenceableCollection);
  1770. smalltalk.addMethod(
  1771. unescape('_withIndexDo_'),
  1772. smalltalk.method({
  1773. selector: unescape('withIndexDo%3A'),
  1774. category: 'enumerating',
  1775. fn: function (aBlock) {
  1776. var self=this;
  1777. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  1778. return self;},
  1779. args: ["aBlock"],
  1780. 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'),
  1781. messageSends: [],
  1782. referencedClasses: []
  1783. }),
  1784. smalltalk.SequenceableCollection);
  1785. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1786. smalltalk.addMethod(
  1787. unescape('_add_'),
  1788. smalltalk.method({
  1789. selector: unescape('add%3A'),
  1790. category: 'adding/removing',
  1791. fn: function (anObject) {
  1792. var self=this;
  1793. self.push(anObject); return anObject;;
  1794. return self;},
  1795. args: ["anObject"],
  1796. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  1797. messageSends: [],
  1798. referencedClasses: []
  1799. }),
  1800. smalltalk.Array);
  1801. smalltalk.addMethod(
  1802. unescape('_asJavascript'),
  1803. smalltalk.method({
  1804. selector: unescape('asJavascript'),
  1805. category: 'converting',
  1806. fn: function () {
  1807. var self=this;
  1808. 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")]);
  1809. return self;},
  1810. args: [],
  1811. 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'),
  1812. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  1813. referencedClasses: []
  1814. }),
  1815. smalltalk.Array);
  1816. smalltalk.addMethod(
  1817. unescape('_at_ifAbsent_'),
  1818. smalltalk.method({
  1819. selector: unescape('at%3AifAbsent%3A'),
  1820. category: 'accessing',
  1821. fn: function (anIndex, aBlock) {
  1822. var self=this;
  1823. var value = self[anIndex - 1];
  1824. if(value === undefined) {
  1825. return aBlock();
  1826. } else {
  1827. return value;
  1828. }
  1829. ;
  1830. return self;},
  1831. args: ["anIndex", "aBlock"],
  1832. 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'),
  1833. messageSends: [],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.Array);
  1837. smalltalk.addMethod(
  1838. unescape('_at_put_'),
  1839. smalltalk.method({
  1840. selector: unescape('at%3Aput%3A'),
  1841. category: 'accessing',
  1842. fn: function (anIndex, anObject) {
  1843. var self=this;
  1844. return self[anIndex - 1] = anObject;
  1845. return self;},
  1846. args: ["anIndex", "anObject"],
  1847. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  1848. messageSends: [],
  1849. referencedClasses: []
  1850. }),
  1851. smalltalk.Array);
  1852. smalltalk.addMethod(
  1853. unescape('_join_'),
  1854. smalltalk.method({
  1855. selector: unescape('join%3A'),
  1856. category: 'enumerating',
  1857. fn: function (aString) {
  1858. var self=this;
  1859. return self.join(aString);
  1860. return self;},
  1861. args: ["aString"],
  1862. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  1863. messageSends: [],
  1864. referencedClasses: []
  1865. }),
  1866. smalltalk.Array);
  1867. smalltalk.addMethod(
  1868. unescape('_remove_'),
  1869. smalltalk.method({
  1870. selector: unescape('remove%3A'),
  1871. category: 'adding/removing',
  1872. fn: function (anObject) {
  1873. var self=this;
  1874. for(var i=0;i<self.length;i++) {
  1875. if(self[i] == anObject) {
  1876. self.splice(i,1);
  1877. break;
  1878. }
  1879. }
  1880. ;
  1881. return self;},
  1882. args: ["anObject"],
  1883. 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'),
  1884. messageSends: [],
  1885. referencedClasses: []
  1886. }),
  1887. smalltalk.Array);
  1888. smalltalk.addMethod(
  1889. unescape('_removeFrom_to_'),
  1890. smalltalk.method({
  1891. selector: unescape('removeFrom%3Ato%3A'),
  1892. category: 'adding/removing',
  1893. fn: function (aNumber, anotherNumber) {
  1894. var self=this;
  1895. self.splice(aNumber - 1,anotherNumber - 1);
  1896. return self;},
  1897. args: ["aNumber", "anotherNumber"],
  1898. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  1899. messageSends: [],
  1900. referencedClasses: []
  1901. }),
  1902. smalltalk.Array);
  1903. smalltalk.addMethod(
  1904. unescape('_reversed'),
  1905. smalltalk.method({
  1906. selector: unescape('reversed'),
  1907. category: 'converting',
  1908. fn: function () {
  1909. var self=this;
  1910. return self._copy().reverse();
  1911. return self;},
  1912. args: [],
  1913. source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
  1914. messageSends: [],
  1915. referencedClasses: []
  1916. }),
  1917. smalltalk.Array);
  1918. smalltalk.addMethod(
  1919. unescape('_size'),
  1920. smalltalk.method({
  1921. selector: unescape('size'),
  1922. category: 'accessing',
  1923. fn: function () {
  1924. var self=this;
  1925. return self.length;
  1926. return self;},
  1927. args: [],
  1928. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  1929. messageSends: [],
  1930. referencedClasses: []
  1931. }),
  1932. smalltalk.Array);
  1933. smalltalk.addMethod(
  1934. unescape('_sort'),
  1935. smalltalk.method({
  1936. selector: unescape('sort'),
  1937. category: 'enumerating',
  1938. fn: function () {
  1939. var self=this;
  1940. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  1941. return self;},
  1942. args: [],
  1943. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  1944. messageSends: ["basicPerform:"],
  1945. referencedClasses: []
  1946. }),
  1947. smalltalk.Array);
  1948. smalltalk.addMethod(
  1949. unescape('_sort_'),
  1950. smalltalk.method({
  1951. selector: unescape('sort%3A'),
  1952. category: 'enumerating',
  1953. fn: function (aBlock) {
  1954. var self=this;
  1955. return self.sort(function(a, b) {
  1956. if(aBlock(a,b)) {return -1} else {return 1}
  1957. })
  1958. ;
  1959. return self;},
  1960. args: ["aBlock"],
  1961. 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'),
  1962. messageSends: [],
  1963. referencedClasses: []
  1964. }),
  1965. smalltalk.Array);
  1966. smalltalk.addMethod(
  1967. unescape('_sorted'),
  1968. smalltalk.method({
  1969. selector: unescape('sorted'),
  1970. category: 'enumerating',
  1971. fn: function () {
  1972. var self=this;
  1973. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  1974. return self;},
  1975. args: [],
  1976. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  1977. messageSends: ["sort", "copy"],
  1978. referencedClasses: []
  1979. }),
  1980. smalltalk.Array);
  1981. smalltalk.addMethod(
  1982. unescape('_sorted_'),
  1983. smalltalk.method({
  1984. selector: unescape('sorted%3A'),
  1985. category: 'enumerating',
  1986. fn: function (aBlock) {
  1987. var self=this;
  1988. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  1989. return self;},
  1990. args: ["aBlock"],
  1991. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  1992. messageSends: ["sort:", "copy"],
  1993. referencedClasses: []
  1994. }),
  1995. smalltalk.Array);
  1996. smalltalk.addMethod(
  1997. unescape('_new_'),
  1998. smalltalk.method({
  1999. selector: unescape('new%3A'),
  2000. category: 'instance creation',
  2001. fn: function (anInteger) {
  2002. var self=this;
  2003. return new Array(anInteger);
  2004. return self;},
  2005. args: ["anInteger"],
  2006. source: unescape('new%3A%20anInteger%0A%09%3Creturn%20new%20Array%28anInteger%29%3E'),
  2007. messageSends: [],
  2008. referencedClasses: []
  2009. }),
  2010. smalltalk.Array.klass);
  2011. smalltalk.addMethod(
  2012. unescape('_with_'),
  2013. smalltalk.method({
  2014. selector: unescape('with%3A'),
  2015. category: 'instance creation',
  2016. fn: function (anObject) {
  2017. var self=this;
  2018. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  2019. return self;},
  2020. args: ["anObject"],
  2021. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5E%28self%20new%3A%201%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09yourself'),
  2022. messageSends: ["at:put:", "yourself", "new:"],
  2023. referencedClasses: []
  2024. }),
  2025. smalltalk.Array.klass);
  2026. smalltalk.addMethod(
  2027. unescape('_with_with_'),
  2028. smalltalk.method({
  2029. selector: unescape('with%3Awith%3A'),
  2030. category: 'instance creation',
  2031. fn: function (anObject, anObject2) {
  2032. var self=this;
  2033. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
  2034. return self;},
  2035. args: ["anObject", "anObject2"],
  2036. source: unescape('with%3A%20anObject%20with%3A%20anObject2%0A%09%20%20%20%20%5E%28self%20new%3A%202%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09yourself'),
  2037. messageSends: ["at:put:", "yourself", "new:"],
  2038. referencedClasses: []
  2039. }),
  2040. smalltalk.Array.klass);
  2041. smalltalk.addMethod(
  2042. unescape('_with_with_with_'),
  2043. smalltalk.method({
  2044. selector: unescape('with%3Awith%3Awith%3A'),
  2045. category: 'instance creation',
  2046. fn: function (anObject, anObject2, anObject3) {
  2047. var self=this;
  2048. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
  2049. return self;},
  2050. args: ["anObject", "anObject2", "anObject3"],
  2051. source: unescape('with%3A%20anObject%20with%3A%20anObject2%20with%3A%20anObject3%0A%09%20%20%20%20%5E%28self%20new%3A%203%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09at%3A%203%20put%3A%20anObject3%3B%0A%09%09yourself'),
  2052. messageSends: ["at:put:", "yourself", "new:"],
  2053. referencedClasses: []
  2054. }),
  2055. smalltalk.Array.klass);
  2056. smalltalk.addMethod(
  2057. unescape('_withAll_'),
  2058. smalltalk.method({
  2059. selector: unescape('withAll%3A'),
  2060. category: 'instance creation',
  2061. fn: function (aCollection) {
  2062. var self=this;
  2063. var instance=nil;
  2064. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  2065. smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  2066. return instance;
  2067. return self;},
  2068. args: ["aCollection"],
  2069. source: unescape('withAll%3A%20aCollection%0A%09%7C%20instance%20%7C%0A%09instance%20%3A%3D%20self%20new%3A%20aCollection%20size.%0A%09aCollection%20withIndexDo%3A%20%5B%3Aeach%20%3Aindex%20%20%7C%0A%09%09instance%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Einstance'),
  2070. messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
  2071. referencedClasses: []
  2072. }),
  2073. smalltalk.Array.klass);
  2074. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2075. smalltalk.addMethod(
  2076. unescape('_add_'),
  2077. smalltalk.method({
  2078. selector: unescape('add%3A'),
  2079. category: 'adding/removing',
  2080. fn: function (anObject) {
  2081. var self=this;
  2082. self.push(anObject); return anObject;;
  2083. return self;},
  2084. args: ["anObject"],
  2085. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  2086. messageSends: [],
  2087. referencedClasses: []
  2088. }),
  2089. smalltalk.Array);
  2090. smalltalk.addMethod(
  2091. unescape('_asJavascript'),
  2092. smalltalk.method({
  2093. selector: unescape('asJavascript'),
  2094. category: 'converting',
  2095. fn: function () {
  2096. var self=this;
  2097. 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")]);
  2098. return self;},
  2099. args: [],
  2100. 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'),
  2101. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  2102. referencedClasses: []
  2103. }),
  2104. smalltalk.Array);
  2105. smalltalk.addMethod(
  2106. unescape('_at_ifAbsent_'),
  2107. smalltalk.method({
  2108. selector: unescape('at%3AifAbsent%3A'),
  2109. category: 'accessing',
  2110. fn: function (anIndex, aBlock) {
  2111. var self=this;
  2112. var value = self[anIndex - 1];
  2113. if(value === undefined) {
  2114. return aBlock();
  2115. } else {
  2116. return value;
  2117. }
  2118. ;
  2119. return self;},
  2120. args: ["anIndex", "aBlock"],
  2121. 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'),
  2122. messageSends: [],
  2123. referencedClasses: []
  2124. }),
  2125. smalltalk.Array);
  2126. smalltalk.addMethod(
  2127. unescape('_at_put_'),
  2128. smalltalk.method({
  2129. selector: unescape('at%3Aput%3A'),
  2130. category: 'accessing',
  2131. fn: function (anIndex, anObject) {
  2132. var self=this;
  2133. return self[anIndex - 1] = anObject;
  2134. return self;},
  2135. args: ["anIndex", "anObject"],
  2136. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  2137. messageSends: [],
  2138. referencedClasses: []
  2139. }),
  2140. smalltalk.Array);
  2141. smalltalk.addMethod(
  2142. unescape('_join_'),
  2143. smalltalk.method({
  2144. selector: unescape('join%3A'),
  2145. category: 'enumerating',
  2146. fn: function (aString) {
  2147. var self=this;
  2148. return self.join(aString);
  2149. return self;},
  2150. args: ["aString"],
  2151. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  2152. messageSends: [],
  2153. referencedClasses: []
  2154. }),
  2155. smalltalk.Array);
  2156. smalltalk.addMethod(
  2157. unescape('_remove_'),
  2158. smalltalk.method({
  2159. selector: unescape('remove%3A'),
  2160. category: 'adding/removing',
  2161. fn: function (anObject) {
  2162. var self=this;
  2163. for(var i=0;i<self.length;i++) {
  2164. if(self[i] == anObject) {
  2165. self.splice(i,1);
  2166. break;
  2167. }
  2168. }
  2169. ;
  2170. return self;},
  2171. args: ["anObject"],
  2172. 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'),
  2173. messageSends: [],
  2174. referencedClasses: []
  2175. }),
  2176. smalltalk.Array);
  2177. smalltalk.addMethod(
  2178. unescape('_removeFrom_to_'),
  2179. smalltalk.method({
  2180. selector: unescape('removeFrom%3Ato%3A'),
  2181. category: 'adding/removing',
  2182. fn: function (aNumber, anotherNumber) {
  2183. var self=this;
  2184. self.splice(aNumber - 1,anotherNumber - 1);
  2185. return self;},
  2186. args: ["aNumber", "anotherNumber"],
  2187. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  2188. messageSends: [],
  2189. referencedClasses: []
  2190. }),
  2191. smalltalk.Array);
  2192. smalltalk.addMethod(
  2193. unescape('_reversed'),
  2194. smalltalk.method({
  2195. selector: unescape('reversed'),
  2196. category: 'converting',
  2197. fn: function () {
  2198. var self=this;
  2199. return self._copy().reverse();
  2200. return self;},
  2201. args: [],
  2202. source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
  2203. messageSends: [],
  2204. referencedClasses: []
  2205. }),
  2206. smalltalk.Array);
  2207. smalltalk.addMethod(
  2208. unescape('_size'),
  2209. smalltalk.method({
  2210. selector: unescape('size'),
  2211. category: 'accessing',
  2212. fn: function () {
  2213. var self=this;
  2214. return self.length;
  2215. return self;},
  2216. args: [],
  2217. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  2218. messageSends: [],
  2219. referencedClasses: []
  2220. }),
  2221. smalltalk.Array);
  2222. smalltalk.addMethod(
  2223. unescape('_sort'),
  2224. smalltalk.method({
  2225. selector: unescape('sort'),
  2226. category: 'enumerating',
  2227. fn: function () {
  2228. var self=this;
  2229. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  2230. return self;},
  2231. args: [],
  2232. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  2233. messageSends: ["basicPerform:"],
  2234. referencedClasses: []
  2235. }),
  2236. smalltalk.Array);
  2237. smalltalk.addMethod(
  2238. unescape('_sort_'),
  2239. smalltalk.method({
  2240. selector: unescape('sort%3A'),
  2241. category: 'enumerating',
  2242. fn: function (aBlock) {
  2243. var self=this;
  2244. return self.sort(function(a, b) {
  2245. if(aBlock(a,b)) {return -1} else {return 1}
  2246. })
  2247. ;
  2248. return self;},
  2249. args: ["aBlock"],
  2250. 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'),
  2251. messageSends: [],
  2252. referencedClasses: []
  2253. }),
  2254. smalltalk.Array);
  2255. smalltalk.addMethod(
  2256. unescape('_sorted'),
  2257. smalltalk.method({
  2258. selector: unescape('sorted'),
  2259. category: 'enumerating',
  2260. fn: function () {
  2261. var self=this;
  2262. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  2263. return self;},
  2264. args: [],
  2265. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  2266. messageSends: ["sort", "copy"],
  2267. referencedClasses: []
  2268. }),
  2269. smalltalk.Array);
  2270. smalltalk.addMethod(
  2271. unescape('_sorted_'),
  2272. smalltalk.method({
  2273. selector: unescape('sorted%3A'),
  2274. category: 'enumerating',
  2275. fn: function (aBlock) {
  2276. var self=this;
  2277. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  2278. return self;},
  2279. args: ["aBlock"],
  2280. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  2281. messageSends: ["sort:", "copy"],
  2282. referencedClasses: []
  2283. }),
  2284. smalltalk.Array);
  2285. smalltalk.addMethod(
  2286. unescape('_new_'),
  2287. smalltalk.method({
  2288. selector: unescape('new%3A'),
  2289. category: 'instance creation',
  2290. fn: function (anInteger) {
  2291. var self=this;
  2292. return new Array(anInteger);
  2293. return self;},
  2294. args: ["anInteger"],
  2295. source: unescape('new%3A%20anInteger%0A%09%3Creturn%20new%20Array%28anInteger%29%3E'),
  2296. messageSends: [],
  2297. referencedClasses: []
  2298. }),
  2299. smalltalk.Array.klass);
  2300. smalltalk.addMethod(
  2301. unescape('_with_'),
  2302. smalltalk.method({
  2303. selector: unescape('with%3A'),
  2304. category: 'instance creation',
  2305. fn: function (anObject) {
  2306. var self=this;
  2307. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  2308. return self;},
  2309. args: ["anObject"],
  2310. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5E%28self%20new%3A%201%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09yourself'),
  2311. messageSends: ["at:put:", "yourself", "new:"],
  2312. referencedClasses: []
  2313. }),
  2314. smalltalk.Array.klass);
  2315. smalltalk.addMethod(
  2316. unescape('_with_with_'),
  2317. smalltalk.method({
  2318. selector: unescape('with%3Awith%3A'),
  2319. category: 'instance creation',
  2320. fn: function (anObject, anObject2) {
  2321. var self=this;
  2322. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
  2323. return self;},
  2324. args: ["anObject", "anObject2"],
  2325. source: unescape('with%3A%20anObject%20with%3A%20anObject2%0A%09%20%20%20%20%5E%28self%20new%3A%202%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09yourself'),
  2326. messageSends: ["at:put:", "yourself", "new:"],
  2327. referencedClasses: []
  2328. }),
  2329. smalltalk.Array.klass);
  2330. smalltalk.addMethod(
  2331. unescape('_with_with_with_'),
  2332. smalltalk.method({
  2333. selector: unescape('with%3Awith%3Awith%3A'),
  2334. category: 'instance creation',
  2335. fn: function (anObject, anObject2, anObject3) {
  2336. var self=this;
  2337. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
  2338. return self;},
  2339. args: ["anObject", "anObject2", "anObject3"],
  2340. source: unescape('with%3A%20anObject%20with%3A%20anObject2%20with%3A%20anObject3%0A%09%20%20%20%20%5E%28self%20new%3A%203%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09at%3A%203%20put%3A%20anObject3%3B%0A%09%09yourself'),
  2341. messageSends: ["at:put:", "yourself", "new:"],
  2342. referencedClasses: []
  2343. }),
  2344. smalltalk.Array.klass);
  2345. smalltalk.addMethod(
  2346. unescape('_withAll_'),
  2347. smalltalk.method({
  2348. selector: unescape('withAll%3A'),
  2349. category: 'instance creation',
  2350. fn: function (aCollection) {
  2351. var self=this;
  2352. var instance=nil;
  2353. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  2354. smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  2355. return instance;
  2356. return self;},
  2357. args: ["aCollection"],
  2358. source: unescape('withAll%3A%20aCollection%0A%09%7C%20instance%20%7C%0A%09instance%20%3A%3D%20self%20new%3A%20aCollection%20size.%0A%09aCollection%20withIndexDo%3A%20%5B%3Aeach%20%3Aindex%20%20%7C%0A%09%09instance%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Einstance'),
  2359. messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
  2360. referencedClasses: []
  2361. }),
  2362. smalltalk.Array.klass);
  2363. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2364. smalltalk.addMethod(
  2365. unescape('__comma'),
  2366. smalltalk.method({
  2367. selector: unescape('%2C'),
  2368. category: 'copying',
  2369. fn: function (aString) {
  2370. var self=this;
  2371. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", [smalltalk.send(aString, "_asString", [])]);
  2372. return self;},
  2373. args: ["aString"],
  2374. source: unescape('%2C%20aString%0A%09%5Eself%20asString%2C%20aString%20asString'),
  2375. messageSends: [unescape("%2C"), "asString"],
  2376. referencedClasses: []
  2377. }),
  2378. smalltalk.CharacterArray);
  2379. smalltalk.addMethod(
  2380. unescape('_add_'),
  2381. smalltalk.method({
  2382. selector: unescape('add%3A'),
  2383. category: 'adding',
  2384. fn: function (anObject) {
  2385. var self=this;
  2386. smalltalk.send(self, "_errorReadOnly", []);
  2387. return self;},
  2388. args: ["anObject"],
  2389. source: unescape('add%3A%20anObject%0A%09self%20errorReadOnly'),
  2390. messageSends: ["errorReadOnly"],
  2391. referencedClasses: []
  2392. }),
  2393. smalltalk.CharacterArray);
  2394. smalltalk.addMethod(
  2395. unescape('_asLowercase'),
  2396. smalltalk.method({
  2397. selector: unescape('asLowercase'),
  2398. category: 'converting',
  2399. fn: function () {
  2400. var self=this;
  2401. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asLowercase", [])]);
  2402. return self;},
  2403. args: [],
  2404. source: unescape('asLowercase%0A%09%5Eself%20class%20fromString%3A%20self%20asString%20asLowercase'),
  2405. messageSends: ["fromString:", "class", "asLowercase", "asString"],
  2406. referencedClasses: []
  2407. }),
  2408. smalltalk.CharacterArray);
  2409. smalltalk.addMethod(
  2410. unescape('_asNumber'),
  2411. smalltalk.method({
  2412. selector: unescape('asNumber'),
  2413. category: 'converting',
  2414. fn: function () {
  2415. var self=this;
  2416. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asNumber", []);
  2417. return self;},
  2418. args: [],
  2419. source: unescape('asNumber%0A%09%5Eself%20asString%20asNumber'),
  2420. messageSends: ["asNumber", "asString"],
  2421. referencedClasses: []
  2422. }),
  2423. smalltalk.CharacterArray);
  2424. smalltalk.addMethod(
  2425. unescape('_asString'),
  2426. smalltalk.method({
  2427. selector: unescape('asString'),
  2428. category: 'converting',
  2429. fn: function () {
  2430. var self=this;
  2431. return smalltalk.send(self, "_subclassResponsibility", []);
  2432. return self;},
  2433. args: [],
  2434. source: unescape('asString%0A%09%5Eself%20subclassResponsibility'),
  2435. messageSends: ["subclassResponsibility"],
  2436. referencedClasses: []
  2437. }),
  2438. smalltalk.CharacterArray);
  2439. smalltalk.addMethod(
  2440. unescape('_asSymbol'),
  2441. smalltalk.method({
  2442. selector: unescape('asSymbol'),
  2443. category: 'converting',
  2444. fn: function () {
  2445. var self=this;
  2446. return smalltalk.send(self, "_subclassResponsibility", []);
  2447. return self;},
  2448. args: [],
  2449. source: unescape('asSymbol%0A%09%5Eself%20subclassResponsibility'),
  2450. messageSends: ["subclassResponsibility"],
  2451. referencedClasses: []
  2452. }),
  2453. smalltalk.CharacterArray);
  2454. smalltalk.addMethod(
  2455. unescape('_asUppercase'),
  2456. smalltalk.method({
  2457. selector: unescape('asUppercase'),
  2458. category: 'converting',
  2459. fn: function () {
  2460. var self=this;
  2461. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asUppercase", [])]);
  2462. return self;},
  2463. args: [],
  2464. source: unescape('asUppercase%0A%09%5Eself%20class%20fromString%3A%20self%20asString%20asUppercase'),
  2465. messageSends: ["fromString:", "class", "asUppercase", "asString"],
  2466. referencedClasses: []
  2467. }),
  2468. smalltalk.CharacterArray);
  2469. smalltalk.addMethod(
  2470. unescape('_at_put_'),
  2471. smalltalk.method({
  2472. selector: unescape('at%3Aput%3A'),
  2473. category: 'accessing',
  2474. fn: function (anIndex, anObject) {
  2475. var self=this;
  2476. smalltalk.send(self, "_errorReadOnly", []);
  2477. return self;},
  2478. args: ["anIndex", "anObject"],
  2479. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20errorReadOnly'),
  2480. messageSends: ["errorReadOnly"],
  2481. referencedClasses: []
  2482. }),
  2483. smalltalk.CharacterArray);
  2484. smalltalk.addMethod(
  2485. unescape('_errorReadOnly'),
  2486. smalltalk.method({
  2487. selector: unescape('errorReadOnly'),
  2488. category: 'error handling',
  2489. fn: function () {
  2490. var self=this;
  2491. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  2492. return self;},
  2493. args: [],
  2494. source: unescape('errorReadOnly%0A%09self%20error%3A%20%27Object%20is%20read-only%27'),
  2495. messageSends: ["error:"],
  2496. referencedClasses: []
  2497. }),
  2498. smalltalk.CharacterArray);
  2499. smalltalk.addMethod(
  2500. unescape('_printString'),
  2501. smalltalk.method({
  2502. selector: unescape('printString'),
  2503. category: 'printing',
  2504. fn: function () {
  2505. var self=this;
  2506. return smalltalk.send(smalltalk.send(self, "_asString", []), "_printString", []);
  2507. return self;},
  2508. args: [],
  2509. source: unescape('printString%0A%09%5Eself%20asString%20printString'),
  2510. messageSends: ["printString", "asString"],
  2511. referencedClasses: []
  2512. }),
  2513. smalltalk.CharacterArray);
  2514. smalltalk.addMethod(
  2515. unescape('_remove_'),
  2516. smalltalk.method({
  2517. selector: unescape('remove%3A'),
  2518. category: 'adding',
  2519. fn: function (anObject) {
  2520. var self=this;
  2521. smalltalk.send(self, "_errorReadOnly", []);
  2522. return self;},
  2523. args: ["anObject"],
  2524. source: unescape('remove%3A%20anObject%0A%09self%20errorReadOnly'),
  2525. messageSends: ["errorReadOnly"],
  2526. referencedClasses: []
  2527. }),
  2528. smalltalk.CharacterArray);
  2529. smalltalk.addMethod(
  2530. unescape('_fromString_'),
  2531. smalltalk.method({
  2532. selector: unescape('fromString%3A'),
  2533. category: 'instance creation',
  2534. fn: function (aString) {
  2535. var self=this;
  2536. smalltalk.send(self, "_subclassResponsibility", []);
  2537. return self;},
  2538. args: ["aString"],
  2539. source: unescape('fromString%3A%20aString%0A%09self%20subclassResponsibility'),
  2540. messageSends: ["subclassResponsibility"],
  2541. referencedClasses: []
  2542. }),
  2543. smalltalk.CharacterArray.klass);
  2544. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2545. smalltalk.addMethod(
  2546. unescape('__comma'),
  2547. smalltalk.method({
  2548. selector: unescape('%2C'),
  2549. category: 'copying',
  2550. fn: function (aString) {
  2551. var self=this;
  2552. return self + aString;
  2553. return self;},
  2554. args: ["aString"],
  2555. source: unescape('%2C%20aString%0A%09%3Creturn%20self%20+%20aString%3E'),
  2556. messageSends: [],
  2557. referencedClasses: []
  2558. }),
  2559. smalltalk.String);
  2560. smalltalk.addMethod(
  2561. unescape('__lt'),
  2562. smalltalk.method({
  2563. selector: unescape('%3C'),
  2564. category: 'comparing',
  2565. fn: function (aString) {
  2566. var self=this;
  2567. return String(self) < aString._asString();
  2568. return self;},
  2569. args: ["aString"],
  2570. source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString._asString%28%29%3E'),
  2571. messageSends: [],
  2572. referencedClasses: []
  2573. }),
  2574. smalltalk.String);
  2575. smalltalk.addMethod(
  2576. unescape('__lt_eq'),
  2577. smalltalk.method({
  2578. selector: unescape('%3C%3D'),
  2579. category: 'comparing',
  2580. fn: function (aString) {
  2581. var self=this;
  2582. return String(self) <= aString._asString();
  2583. return self;},
  2584. args: ["aString"],
  2585. source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString._asString%28%29%3E'),
  2586. messageSends: [],
  2587. referencedClasses: []
  2588. }),
  2589. smalltalk.String);
  2590. smalltalk.addMethod(
  2591. unescape('__eq'),
  2592. smalltalk.method({
  2593. selector: unescape('%3D'),
  2594. category: 'comparing',
  2595. fn: function (aString) {
  2596. var self=this;
  2597. 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}})})();})]));
  2598. return String(self) === String(aString);
  2599. return self;
  2600. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2601. args: ["aString"],
  2602. 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%3D%20String%28aString%29%3E'),
  2603. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  2604. referencedClasses: []
  2605. }),
  2606. smalltalk.String);
  2607. smalltalk.addMethod(
  2608. unescape('__gt'),
  2609. smalltalk.method({
  2610. selector: unescape('%3E'),
  2611. category: 'comparing',
  2612. fn: function (aString) {
  2613. var self=this;
  2614. return String(self) > aString._asString();
  2615. return self;},
  2616. args: ["aString"],
  2617. source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString._asString%28%29%3E'),
  2618. messageSends: [],
  2619. referencedClasses: []
  2620. }),
  2621. smalltalk.String);
  2622. smalltalk.addMethod(
  2623. unescape('__gt_eq'),
  2624. smalltalk.method({
  2625. selector: unescape('%3E%3D'),
  2626. category: 'comparing',
  2627. fn: function (aString) {
  2628. var self=this;
  2629. return String(self) >= aString._asString();
  2630. return self;},
  2631. args: ["aString"],
  2632. source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString._asString%28%29%3E'),
  2633. messageSends: [],
  2634. referencedClasses: []
  2635. }),
  2636. smalltalk.String);
  2637. smalltalk.addMethod(
  2638. unescape('_asJSON'),
  2639. smalltalk.method({
  2640. selector: unescape('asJSON'),
  2641. category: 'converting',
  2642. fn: function (){
  2643. var self=this;
  2644. return self;
  2645. return self;},
  2646. args: [],
  2647. source: unescape('asJSON%0A%09%5Eself'),
  2648. messageSends: [],
  2649. referencedClasses: []
  2650. }),
  2651. smalltalk.String);
  2652. smalltalk.addMethod(
  2653. unescape('_asJavaScriptSelector'),
  2654. smalltalk.method({
  2655. selector: unescape('asJavaScriptSelector'),
  2656. category: 'converting',
  2657. fn: function () {
  2658. var self=this;
  2659. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  2660. return self;},
  2661. args: [],
  2662. 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.'),
  2663. messageSends: ["replace:with:", "asSelector"],
  2664. referencedClasses: []
  2665. }),
  2666. smalltalk.String);
  2667. smalltalk.addMethod(
  2668. unescape('_asJavascript'),
  2669. smalltalk.method({
  2670. selector: unescape('asJavascript'),
  2671. category: 'converting',
  2672. fn: function () {
  2673. var self=this;
  2674. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2675. return "unescape(\"" + escape(self) + "\")";
  2676. else
  2677. return "\"" + self + "\"";
  2678. ;
  2679. return self;},
  2680. args: [],
  2681. 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'),
  2682. messageSends: [],
  2683. referencedClasses: []
  2684. }),
  2685. smalltalk.String);
  2686. smalltalk.addMethod(
  2687. unescape('_asLowercase'),
  2688. smalltalk.method({
  2689. selector: unescape('asLowercase'),
  2690. category: 'converting',
  2691. fn: function () {
  2692. var self=this;
  2693. return self.toLowerCase();
  2694. return self;},
  2695. args: [],
  2696. source: unescape('asLowercase%0A%09%3Creturn%20self.toLowerCase%28%29%3E'),
  2697. messageSends: [],
  2698. referencedClasses: []
  2699. }),
  2700. smalltalk.String);
  2701. smalltalk.addMethod(
  2702. unescape('_asNumber'),
  2703. smalltalk.method({
  2704. selector: unescape('asNumber'),
  2705. category: 'converting',
  2706. fn: function () {
  2707. var self=this;
  2708. return Number(self);
  2709. return self;},
  2710. args: [],
  2711. source: unescape('asNumber%0A%09%3Creturn%20Number%28self%29%3E'),
  2712. messageSends: [],
  2713. referencedClasses: []
  2714. }),
  2715. smalltalk.String);
  2716. smalltalk.addMethod(
  2717. unescape('_asSelector'),
  2718. smalltalk.method({
  2719. selector: unescape('asSelector'),
  2720. category: 'converting',
  2721. fn: function () {
  2722. var self=this;
  2723. var selector=nil;
  2724. (selector=smalltalk.send("_", "__comma", [self]));
  2725. (selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
  2726. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]));
  2727. (selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]));
  2728. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]));
  2729. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]));
  2730. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]));
  2731. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]));
  2732. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]));
  2733. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]));
  2734. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]));
  2735. return selector;
  2736. return self;},
  2737. args: [],
  2738. 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%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector'),
  2739. messageSends: [unescape("%2C"), "replace:with:"],
  2740. referencedClasses: []
  2741. }),
  2742. smalltalk.String);
  2743. smalltalk.addMethod(
  2744. unescape('_asString'),
  2745. smalltalk.method({
  2746. selector: unescape('asString'),
  2747. category: 'converting',
  2748. fn: function () {
  2749. var self=this;
  2750. return self;
  2751. return self;},
  2752. args: [],
  2753. source: unescape('asString%0A%09%5Eself'),
  2754. messageSends: [],
  2755. referencedClasses: []
  2756. }),
  2757. smalltalk.String);
  2758. smalltalk.addMethod(
  2759. unescape('_asSymbol'),
  2760. smalltalk.method({
  2761. selector: unescape('asSymbol'),
  2762. category: 'converting',
  2763. fn: function () {
  2764. var self=this;
  2765. return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
  2766. return self;},
  2767. args: [],
  2768. source: unescape('asSymbol%0A%09%5ESymbol%20lookup%3A%20self'),
  2769. messageSends: ["lookup:"],
  2770. referencedClasses: ["Symbol"]
  2771. }),
  2772. smalltalk.String);
  2773. smalltalk.addMethod(
  2774. unescape('_asUppercase'),
  2775. smalltalk.method({
  2776. selector: unescape('asUppercase'),
  2777. category: 'converting',
  2778. fn: function () {
  2779. var self=this;
  2780. return self.toUpperCase();
  2781. return self;},
  2782. args: [],
  2783. source: unescape('asUppercase%0A%09%3Creturn%20self.toUpperCase%28%29%3E'),
  2784. messageSends: [],
  2785. referencedClasses: []
  2786. }),
  2787. smalltalk.String);
  2788. smalltalk.addMethod(
  2789. unescape('_asciiValue'),
  2790. smalltalk.method({
  2791. selector: unescape('asciiValue'),
  2792. category: 'accessing',
  2793. fn: function () {
  2794. var self=this;
  2795. return self.charCodeAt(0);;
  2796. return self;},
  2797. args: [],
  2798. source: unescape('asciiValue%0A%09%3Creturn%20self.charCodeAt%280%29%3B%3E'),
  2799. messageSends: [],
  2800. referencedClasses: []
  2801. }),
  2802. smalltalk.String);
  2803. smalltalk.addMethod(
  2804. unescape('_at_ifAbsent_'),
  2805. smalltalk.method({
  2806. selector: unescape('at%3AifAbsent%3A'),
  2807. category: 'accessing',
  2808. fn: function (anIndex, aBlock) {
  2809. var self=this;
  2810. return self[anIndex - 1] || aBlock();
  2811. return self;},
  2812. args: ["anIndex", "aBlock"],
  2813. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%7C%7C%20aBlock%28%29%3E'),
  2814. messageSends: [],
  2815. referencedClasses: []
  2816. }),
  2817. smalltalk.String);
  2818. smalltalk.addMethod(
  2819. unescape('_copyFrom_to_'),
  2820. smalltalk.method({
  2821. selector: unescape('copyFrom%3Ato%3A'),
  2822. category: 'copying',
  2823. fn: function (anIndex, anotherIndex) {
  2824. var self=this;
  2825. return self.substring(anIndex - 1, anotherIndex);
  2826. return self;},
  2827. args: ["anIndex", "anotherIndex"],
  2828. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%3Creturn%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3E'),
  2829. messageSends: [],
  2830. referencedClasses: []
  2831. }),
  2832. smalltalk.String);
  2833. smalltalk.addMethod(
  2834. unescape('_deepCopy'),
  2835. smalltalk.method({
  2836. selector: unescape('deepCopy'),
  2837. category: 'copying',
  2838. fn: function () {
  2839. var self=this;
  2840. return smalltalk.send(self, "_shallowCopy", []);
  2841. return self;},
  2842. args: [],
  2843. source: unescape('deepCopy%0A%09%5Eself%20shallowCopy'),
  2844. messageSends: ["shallowCopy"],
  2845. referencedClasses: []
  2846. }),
  2847. smalltalk.String);
  2848. smalltalk.addMethod(
  2849. unescape('_escaped'),
  2850. smalltalk.method({
  2851. selector: unescape('escaped'),
  2852. category: 'accessing',
  2853. fn: function () {
  2854. var self=this;
  2855. return escape(self);
  2856. return self;},
  2857. args: [],
  2858. source: unescape('escaped%0A%09%3Creturn%20escape%28self%29%3E'),
  2859. messageSends: [],
  2860. referencedClasses: []
  2861. }),
  2862. smalltalk.String);
  2863. smalltalk.addMethod(
  2864. unescape('_includesSubString_'),
  2865. smalltalk.method({
  2866. selector: unescape('includesSubString%3A'),
  2867. category: 'testing',
  2868. fn: function (subString) {
  2869. var self=this;
  2870. return self.indexOf(subString) != -1 ;
  2871. return self;},
  2872. args: ["subString"],
  2873. source: unescape('includesSubString%3A%20subString%0A%09%3C%20return%20self.indexOf%28subString%29%20%21%3D%20-1%20%3E'),
  2874. messageSends: [],
  2875. referencedClasses: []
  2876. }),
  2877. smalltalk.String);
  2878. smalltalk.addMethod(
  2879. unescape('_isString'),
  2880. smalltalk.method({
  2881. selector: unescape('isString'),
  2882. category: 'testing',
  2883. fn: function () {
  2884. var self=this;
  2885. return true;
  2886. return self;},
  2887. args: [],
  2888. source: unescape('isString%0A%09%5Etrue'),
  2889. messageSends: [],
  2890. referencedClasses: []
  2891. }),
  2892. smalltalk.String);
  2893. smalltalk.addMethod(
  2894. unescape('_join_'),
  2895. smalltalk.method({
  2896. selector: unescape('join%3A'),
  2897. category: 'split join',
  2898. fn: function (aCollection) {
  2899. var self=this;
  2900. 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]);})]);})]);
  2901. return self;},
  2902. args: ["aCollection"],
  2903. 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'),
  2904. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  2905. referencedClasses: ["String"]
  2906. }),
  2907. smalltalk.String);
  2908. smalltalk.addMethod(
  2909. unescape('_lineIndicesDo_'),
  2910. smalltalk.method({
  2911. selector: unescape('lineIndicesDo%3A'),
  2912. category: 'split join',
  2913. fn: function (aBlock) {
  2914. var self=this;
  2915. try{var cr=nil;
  2916. var lf=nil;
  2917. var start=nil;
  2918. var sz=nil;
  2919. var nextLF=nil;
  2920. var nextCR=nil;
  2921. (start=(1));
  2922. (sz=smalltalk.send(self, "_size", []));
  2923. (cr=smalltalk.send((smalltalk.String || String), "_cr", []));
  2924. (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
  2925. (lf=smalltalk.send((smalltalk.String || String), "_lf", []));
  2926. (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
  2927. (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]));})]));})]));})()}})();
  2928. return self;
  2929. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}},
  2930. args: ["aBlock"],
  2931. 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'),
  2932. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", unescape("%3C%3D"), "ifTrue:", "and:", unescape("%3D"), "value:value:value:", "ifTrue:ifFalse:", "or:", unescape("%3C"), unescape("-"), unescape("+")],
  2933. referencedClasses: ["String"]
  2934. }),
  2935. smalltalk.String);
  2936. smalltalk.addMethod(
  2937. unescape('_lineNumber_'),
  2938. smalltalk.method({
  2939. selector: unescape('lineNumber%3A'),
  2940. category: 'split join',
  2941. fn: function (anIndex) {
  2942. var self=this;
  2943. try{var lineCount=nil;
  2944. (lineCount=(0));
  2945. 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])}})})();})]));})]);
  2946. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  2947. return self;
  2948. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}},
  2949. args: ["anIndex"],
  2950. 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'),
  2951. messageSends: ["lineIndicesDo:", "ifTrue:", unescape("%3D"), unescape("+"), "copyFrom:to:"],
  2952. referencedClasses: []
  2953. }),
  2954. smalltalk.String);
  2955. smalltalk.addMethod(
  2956. unescape('_lines'),
  2957. smalltalk.method({
  2958. selector: unescape('lines'),
  2959. category: 'split join',
  2960. fn: function () {
  2961. var self=this;
  2962. var lines=nil;
  2963. (lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
  2964. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  2965. return lines;
  2966. return self;},
  2967. args: [],
  2968. 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'),
  2969. messageSends: ["new", "linesDo:", "add:"],
  2970. referencedClasses: ["Array"]
  2971. }),
  2972. smalltalk.String);
  2973. smalltalk.addMethod(
  2974. unescape('_linesDo_'),
  2975. smalltalk.method({
  2976. selector: unescape('linesDo%3A'),
  2977. category: 'split join',
  2978. fn: function (aBlock) {
  2979. var self=this;
  2980. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  2981. return self;},
  2982. args: ["aBlock"],
  2983. 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'),
  2984. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"],
  2985. referencedClasses: []
  2986. }),
  2987. smalltalk.String);
  2988. smalltalk.addMethod(
  2989. unescape('_match_'),
  2990. smalltalk.method({
  2991. selector: unescape('match%3A'),
  2992. category: 'regular expressions',
  2993. fn: function (aRegexp) {
  2994. var self=this;
  2995. return self.search(aRegexp) != -1;
  2996. return self;},
  2997. args: ["aRegexp"],
  2998. source: unescape('match%3A%20aRegexp%0A%09%3Creturn%20self.search%28aRegexp%29%20%21%3D%20-1%3E'),
  2999. messageSends: [],
  3000. referencedClasses: []
  3001. }),
  3002. smalltalk.String);
  3003. smalltalk.addMethod(
  3004. unescape('_printNl'),
  3005. smalltalk.method({
  3006. selector: unescape('printNl'),
  3007. category: 'printing',
  3008. fn: function () {
  3009. var self=this;
  3010. console.log(self);
  3011. return self;},
  3012. args: [],
  3013. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  3014. messageSends: [],
  3015. referencedClasses: []
  3016. }),
  3017. smalltalk.String);
  3018. smalltalk.addMethod(
  3019. unescape('_printString'),
  3020. smalltalk.method({
  3021. selector: unescape('printString'),
  3022. category: 'printing',
  3023. fn: function () {
  3024. var self=this;
  3025. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3026. return self;},
  3027. args: [],
  3028. source: unescape('printString%0A%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27'),
  3029. messageSends: [unescape("%2C")],
  3030. referencedClasses: []
  3031. }),
  3032. smalltalk.String);
  3033. smalltalk.addMethod(
  3034. unescape('_replace_with_'),
  3035. smalltalk.method({
  3036. selector: unescape('replace%3Awith%3A'),
  3037. category: 'regular expressions',
  3038. fn: function (aString, anotherString) {
  3039. var self=this;
  3040. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  3041. return self;},
  3042. args: ["aString", "anotherString"],
  3043. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString'),
  3044. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  3045. referencedClasses: ["RegularExpression"]
  3046. }),
  3047. smalltalk.String);
  3048. smalltalk.addMethod(
  3049. unescape('_replaceRegexp_with_'),
  3050. smalltalk.method({
  3051. selector: unescape('replaceRegexp%3Awith%3A'),
  3052. category: 'regular expressions',
  3053. fn: function (aRegexp, aString) {
  3054. var self=this;
  3055. return self.replace(aRegexp, aString);
  3056. return self;},
  3057. args: ["aRegexp", "aString"],
  3058. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%3Creturn%20self.replace%28aRegexp%2C%20aString%29%3E'),
  3059. messageSends: [],
  3060. referencedClasses: []
  3061. }),
  3062. smalltalk.String);
  3063. smalltalk.addMethod(
  3064. unescape('_reversed'),
  3065. smalltalk.method({
  3066. selector: unescape('reversed'),
  3067. category: 'converting',
  3068. fn: function () {
  3069. var self=this;
  3070. return self.split("").reverse().join("");
  3071. return self;},
  3072. args: [],
  3073. source: unescape('reversed%0A%09%3Creturn%20self.split%28%22%22%29.reverse%28%29.join%28%22%22%29%3E'),
  3074. messageSends: [],
  3075. referencedClasses: []
  3076. }),
  3077. smalltalk.String);
  3078. smalltalk.addMethod(
  3079. unescape('_shallowCopy'),
  3080. smalltalk.method({
  3081. selector: unescape('shallowCopy'),
  3082. category: 'copying',
  3083. fn: function () {
  3084. var self=this;
  3085. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3086. return self;},
  3087. args: [],
  3088. source: unescape('shallowCopy%0A%09%5Eself%20class%20fromString%3A%20self'),
  3089. messageSends: ["fromString:", "class"],
  3090. referencedClasses: []
  3091. }),
  3092. smalltalk.String);
  3093. smalltalk.addMethod(
  3094. unescape('_size'),
  3095. smalltalk.method({
  3096. selector: unescape('size'),
  3097. category: 'accessing',
  3098. fn: function () {
  3099. var self=this;
  3100. return self.length;
  3101. return self;},
  3102. args: [],
  3103. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  3104. messageSends: [],
  3105. referencedClasses: []
  3106. }),
  3107. smalltalk.String);
  3108. smalltalk.addMethod(
  3109. unescape('_tokenize_'),
  3110. smalltalk.method({
  3111. selector: unescape('tokenize%3A'),
  3112. category: 'converting',
  3113. fn: function (aString) {
  3114. var self=this;
  3115. return self.split(aString);
  3116. return self;},
  3117. args: ["aString"],
  3118. source: unescape('tokenize%3A%20aString%0A%09%3Creturn%20self.split%28aString%29%3E'),
  3119. messageSends: [],
  3120. referencedClasses: []
  3121. }),
  3122. smalltalk.String);
  3123. smalltalk.addMethod(
  3124. unescape('_trimBoth'),
  3125. smalltalk.method({
  3126. selector: unescape('trimBoth'),
  3127. category: 'regular expressions',
  3128. fn: function () {
  3129. var self=this;
  3130. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3131. return self;},
  3132. args: [],
  3133. source: unescape('trimBoth%0A%09%5Eself%20trimBoth%3A%20%27%5Cs%27'),
  3134. messageSends: ["trimBoth:"],
  3135. referencedClasses: []
  3136. }),
  3137. smalltalk.String);
  3138. smalltalk.addMethod(
  3139. unescape('_trimBoth_'),
  3140. smalltalk.method({
  3141. selector: unescape('trimBoth%3A'),
  3142. category: 'regular expressions',
  3143. fn: function (separators) {
  3144. var self=this;
  3145. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3146. return self;},
  3147. args: ["separators"],
  3148. source: unescape('trimBoth%3A%20separators%0A%0A%09%5E%28self%20trimLeft%3A%20separators%29%20trimRight%3A%20separators'),
  3149. messageSends: ["trimRight:", "trimLeft:"],
  3150. referencedClasses: []
  3151. }),
  3152. smalltalk.String);
  3153. smalltalk.addMethod(
  3154. unescape('_trimLeft'),
  3155. smalltalk.method({
  3156. selector: unescape('trimLeft'),
  3157. category: 'regular expressions',
  3158. fn: function () {
  3159. var self=this;
  3160. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3161. return self;},
  3162. args: [],
  3163. source: unescape('trimLeft%0A%09%5Eself%20trimLeft%3A%20%27%5Cs%27'),
  3164. messageSends: ["trimLeft:"],
  3165. referencedClasses: []
  3166. }),
  3167. smalltalk.String);
  3168. smalltalk.addMethod(
  3169. unescape('_trimLeft_'),
  3170. smalltalk.method({
  3171. selector: unescape('trimLeft%3A'),
  3172. category: 'regular expressions',
  3173. fn: function (separators) {
  3174. var self=this;
  3175. 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"]), ""]);
  3176. return self;},
  3177. args: ["separators"],
  3178. source: unescape('trimLeft%3A%20separators%0A%0A%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'),
  3179. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  3180. referencedClasses: ["RegularExpression"]
  3181. }),
  3182. smalltalk.String);
  3183. smalltalk.addMethod(
  3184. unescape('_trimRight'),
  3185. smalltalk.method({
  3186. selector: unescape('trimRight'),
  3187. category: 'regular expressions',
  3188. fn: function () {
  3189. var self=this;
  3190. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3191. return self;},
  3192. args: [],
  3193. source: unescape('trimRight%0A%09%5Eself%20trimRight%3A%20%27%5Cs%27'),
  3194. messageSends: ["trimRight:"],
  3195. referencedClasses: []
  3196. }),
  3197. smalltalk.String);
  3198. smalltalk.addMethod(
  3199. unescape('_trimRight_'),
  3200. smalltalk.method({
  3201. selector: unescape('trimRight%3A'),
  3202. category: 'regular expressions',
  3203. fn: function (separators) {
  3204. var self=this;
  3205. 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"]), ""]);
  3206. return self;},
  3207. args: ["separators"],
  3208. source: unescape('trimRight%3A%20separators%0A%0A%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'),
  3209. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  3210. referencedClasses: ["RegularExpression"]
  3211. }),
  3212. smalltalk.String);
  3213. smalltalk.addMethod(
  3214. unescape('_unescaped'),
  3215. smalltalk.method({
  3216. selector: unescape('unescaped'),
  3217. category: 'accessing',
  3218. fn: function () {
  3219. var self=this;
  3220. return unescape(self);
  3221. return self;},
  3222. args: [],
  3223. source: unescape('unescaped%0A%09%3Creturn%20unescape%28self%29%3E'),
  3224. messageSends: [],
  3225. referencedClasses: []
  3226. }),
  3227. smalltalk.String);
  3228. smalltalk.addMethod(
  3229. unescape('_cr'),
  3230. smalltalk.method({
  3231. selector: unescape('cr'),
  3232. category: 'accessing',
  3233. fn: function () {
  3234. var self=this;
  3235. return '\r';
  3236. return self;},
  3237. args: [],
  3238. source: unescape('cr%0A%09%3Creturn%20%27%5Cr%27%3E'),
  3239. messageSends: [],
  3240. referencedClasses: []
  3241. }),
  3242. smalltalk.String.klass);
  3243. smalltalk.addMethod(
  3244. unescape('_crlf'),
  3245. smalltalk.method({
  3246. selector: unescape('crlf'),
  3247. category: 'accessing',
  3248. fn: function () {
  3249. var self=this;
  3250. return '\r\n';
  3251. return self;},
  3252. args: [],
  3253. source: unescape('crlf%0A%09%3Creturn%20%27%5Cr%5Cn%27%3E'),
  3254. messageSends: [],
  3255. referencedClasses: []
  3256. }),
  3257. smalltalk.String.klass);
  3258. smalltalk.addMethod(
  3259. unescape('_fromString_'),
  3260. smalltalk.method({
  3261. selector: unescape('fromString%3A'),
  3262. category: 'instance creation',
  3263. fn: function (aString) {
  3264. var self=this;
  3265. return new self.fn(aString);
  3266. return self;},
  3267. args: ["aString"],
  3268. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%3Creturn%20new%20self.fn%28aString%29%3E'),
  3269. messageSends: [],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.String.klass);
  3273. smalltalk.addMethod(
  3274. unescape('_lf'),
  3275. smalltalk.method({
  3276. selector: unescape('lf'),
  3277. category: 'accessing',
  3278. fn: function () {
  3279. var self=this;
  3280. return '\n';
  3281. return self;},
  3282. args: [],
  3283. source: unescape('lf%0A%09%3Creturn%20%27%5Cn%27%3E'),
  3284. messageSends: [],
  3285. referencedClasses: []
  3286. }),
  3287. smalltalk.String.klass);
  3288. smalltalk.addMethod(
  3289. unescape('_space'),
  3290. smalltalk.method({
  3291. selector: unescape('space'),
  3292. category: 'accessing',
  3293. fn: function () {
  3294. var self=this;
  3295. return ' ';
  3296. return self;},
  3297. args: [],
  3298. source: unescape('space%0A%09%3Creturn%20%27%20%27%3E'),
  3299. messageSends: [],
  3300. referencedClasses: []
  3301. }),
  3302. smalltalk.String.klass);
  3303. smalltalk.addMethod(
  3304. unescape('_streamClass'),
  3305. smalltalk.method({
  3306. selector: unescape('streamClass'),
  3307. category: 'accessing',
  3308. fn: function () {
  3309. var self=this;
  3310. return (smalltalk.StringStream || StringStream);
  3311. return self;},
  3312. args: [],
  3313. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream'),
  3314. messageSends: [],
  3315. referencedClasses: ["StringStream"]
  3316. }),
  3317. smalltalk.String.klass);
  3318. smalltalk.addMethod(
  3319. unescape('_streamContents_'),
  3320. smalltalk.method({
  3321. selector: unescape('streamContents%3A'),
  3322. category: 'instance creation',
  3323. fn: function (blockWithArg) {
  3324. var self=this;
  3325. var stream=nil;
  3326. (stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
  3327. smalltalk.send(blockWithArg, "_value_", [stream]);
  3328. return smalltalk.send(stream, "_contents", []);
  3329. return self;},
  3330. args: ["blockWithArg"],
  3331. 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'),
  3332. messageSends: ["on:", "streamClass", "new", "value:", "contents"],
  3333. referencedClasses: ["String"]
  3334. }),
  3335. smalltalk.String.klass);
  3336. smalltalk.addMethod(
  3337. unescape('_tab'),
  3338. smalltalk.method({
  3339. selector: unescape('tab'),
  3340. category: 'accessing',
  3341. fn: function () {
  3342. var self=this;
  3343. return '\t';
  3344. return self;},
  3345. args: [],
  3346. source: unescape('tab%0A%09%3Creturn%20%27%5Ct%27%3E'),
  3347. messageSends: [],
  3348. referencedClasses: []
  3349. }),
  3350. smalltalk.String.klass);
  3351. smalltalk.addMethod(
  3352. unescape('_value_'),
  3353. smalltalk.method({
  3354. selector: unescape('value%3A'),
  3355. category: 'instance creation',
  3356. fn: function (aUTFCharCode) {
  3357. var self=this;
  3358. return String.fromCharCode(aUTFCharCode);;
  3359. return self;},
  3360. args: ["aUTFCharCode"],
  3361. source: unescape('value%3A%20aUTFCharCode%0A%0A%09%3Creturn%20String.fromCharCode%28aUTFCharCode%29%3B%3E'),
  3362. messageSends: [],
  3363. referencedClasses: []
  3364. }),
  3365. smalltalk.String.klass);
  3366. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  3367. smalltalk.addMethod(
  3368. unescape('__lt'),
  3369. smalltalk.method({
  3370. selector: unescape('%3C'),
  3371. category: 'comparing',
  3372. fn: function (aSymbol) {
  3373. var self=this;
  3374. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(aSymbol, "_asString", [])]));
  3375. return self;},
  3376. args: ["aSymbol"],
  3377. source: unescape('%3C%20aSymbol%0A%09%5Eself%20asString%20%3C%20aSymbol%20asString'),
  3378. messageSends: [unescape("%3C"), "asString"],
  3379. referencedClasses: []
  3380. }),
  3381. smalltalk.Symbol);
  3382. smalltalk.addMethod(
  3383. unescape('__lt_eq'),
  3384. smalltalk.method({
  3385. selector: unescape('%3C%3D'),
  3386. category: 'comparing',
  3387. fn: function (aSymbol) {
  3388. var self=this;
  3389. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  3390. return self;},
  3391. args: ["aSymbol"],
  3392. source: unescape('%3C%3D%20aSymbol%0A%09%5Eself%20asString%20%3C%3D%20aSymbol%20asString'),
  3393. messageSends: [unescape("%3C%3D"), "asString"],
  3394. referencedClasses: []
  3395. }),
  3396. smalltalk.Symbol);
  3397. smalltalk.addMethod(
  3398. unescape('__eq'),
  3399. smalltalk.method({
  3400. selector: unescape('%3D'),
  3401. category: 'comparing',
  3402. fn: function (aSymbol) {
  3403. var self=this;
  3404. try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_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}})})();})]));
  3405. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])])}})})();
  3406. return self;
  3407. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  3408. args: ["aSymbol"],
  3409. source: unescape('%3D%20aSymbol%0A%09aSymbol%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20asString%20%3D%20aSymbol%20asString'),
  3410. messageSends: ["ifFalse:", unescape("%3D"), "class", "asString"],
  3411. referencedClasses: []
  3412. }),
  3413. smalltalk.Symbol);
  3414. smalltalk.addMethod(
  3415. unescape('__gt'),
  3416. smalltalk.method({
  3417. selector: unescape('%3E'),
  3418. category: 'comparing',
  3419. fn: function (aSymbol) {
  3420. var self=this;
  3421. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt", [smalltalk.send(aSymbol, "_asString", [])]));
  3422. return self;},
  3423. args: ["aSymbol"],
  3424. source: unescape('%3E%20aSymbol%0A%09%5Eself%20asString%20%3E%20aSymbol%20asString'),
  3425. messageSends: [unescape("%3E"), "asString"],
  3426. referencedClasses: []
  3427. }),
  3428. smalltalk.Symbol);
  3429. smalltalk.addMethod(
  3430. unescape('__gt_eq'),
  3431. smalltalk.method({
  3432. selector: unescape('%3E%3D'),
  3433. category: 'comparing',
  3434. fn: function (aSymbol) {
  3435. var self=this;
  3436. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  3437. return self;},
  3438. args: ["aSymbol"],
  3439. source: unescape('%3E%3D%20aSymbol%0A%09%5Eself%20asString%20%3E%3D%20aSymbol%20asString'),
  3440. messageSends: [unescape("%3E%3D"), "asString"],
  3441. referencedClasses: []
  3442. }),
  3443. smalltalk.Symbol);
  3444. smalltalk.addMethod(
  3445. unescape('_asJSON'),
  3446. smalltalk.method({
  3447. selector: unescape('asJSON'),
  3448. category: 'converting',
  3449. fn: function (){
  3450. var self=this;
  3451. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
  3452. return self;},
  3453. args: [],
  3454. source: unescape('asJSON%0A%09%5Eself%20asString%20asJSON'),
  3455. messageSends: ["asJSON", "asString"],
  3456. referencedClasses: []
  3457. }),
  3458. smalltalk.Symbol);
  3459. smalltalk.addMethod(
  3460. unescape('_asJavascript'),
  3461. smalltalk.method({
  3462. selector: unescape('asJavascript'),
  3463. category: 'converting',
  3464. fn: function () {
  3465. var self=this;
  3466. return smalltalk.send(smalltalk.send(unescape("smalltalk.symbolFor%28%22"), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%22%29")]);
  3467. return self;},
  3468. args: [],
  3469. source: unescape('asJavascript%0A%09%5E%27smalltalk.symbolFor%28%22%27%2C%20self%20asString%2C%20%27%22%29%27'),
  3470. messageSends: [unescape("%2C"), "asString"],
  3471. referencedClasses: []
  3472. }),
  3473. smalltalk.Symbol);
  3474. smalltalk.addMethod(
  3475. unescape('_asSelector'),
  3476. smalltalk.method({
  3477. selector: unescape('asSelector'),
  3478. category: 'converting',
  3479. fn: function () {
  3480. var self=this;
  3481. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
  3482. return self;},
  3483. args: [],
  3484. source: unescape('asSelector%0A%09%5Eself%20asString%20asSelector'),
  3485. messageSends: ["asSelector", "asString"],
  3486. referencedClasses: []
  3487. }),
  3488. smalltalk.Symbol);
  3489. smalltalk.addMethod(
  3490. unescape('_asString'),
  3491. smalltalk.method({
  3492. selector: unescape('asString'),
  3493. category: 'converting',
  3494. fn: function () {
  3495. var self=this;
  3496. return self.value;
  3497. return self;},
  3498. args: [],
  3499. source: unescape('asString%0A%09%3Creturn%20self.value%3E'),
  3500. messageSends: [],
  3501. referencedClasses: []
  3502. }),
  3503. smalltalk.Symbol);
  3504. smalltalk.addMethod(
  3505. unescape('_asSymbol'),
  3506. smalltalk.method({
  3507. selector: unescape('asSymbol'),
  3508. category: 'converting',
  3509. fn: function () {
  3510. var self=this;
  3511. return self;
  3512. return self;},
  3513. args: [],
  3514. source: unescape('asSymbol%0A%09%5Eself'),
  3515. messageSends: [],
  3516. referencedClasses: []
  3517. }),
  3518. smalltalk.Symbol);
  3519. smalltalk.addMethod(
  3520. unescape('_at_ifAbsent_'),
  3521. smalltalk.method({
  3522. selector: unescape('at%3AifAbsent%3A'),
  3523. category: 'accessing',
  3524. fn: function (anIndex, aBlock) {
  3525. var self=this;
  3526. return smalltalk.send(smalltalk.send(self, "_asString", []), "_at_ifAbsent_", [anIndex, aBlock]);
  3527. return self;},
  3528. args: ["anIndex", "aBlock"],
  3529. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%5Eself%20asString%20at%3A%20anIndex%20ifAbsent%3A%20aBlock'),
  3530. messageSends: ["at:ifAbsent:", "asString"],
  3531. referencedClasses: []
  3532. }),
  3533. smalltalk.Symbol);
  3534. smalltalk.addMethod(
  3535. unescape('_copyFrom_to_'),
  3536. smalltalk.method({
  3537. selector: unescape('copyFrom%3Ato%3A'),
  3538. category: 'copying',
  3539. fn: function (anIndex, anotherIndex) {
  3540. var self=this;
  3541. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_copyFrom_to_", [anIndex, anotherIndex])]);
  3542. return self;},
  3543. args: ["anIndex", "anotherIndex"],
  3544. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%5Eself%20class%20fromString%3A%20%28self%20asString%20copyFrom%3A%20anIndex%20to%3A%20anotherIndex%29'),
  3545. messageSends: ["fromString:", "class", "copyFrom:to:", "asString"],
  3546. referencedClasses: []
  3547. }),
  3548. smalltalk.Symbol);
  3549. smalltalk.addMethod(
  3550. unescape('_deepCopy'),
  3551. smalltalk.method({
  3552. selector: unescape('deepCopy'),
  3553. category: 'copying',
  3554. fn: function () {
  3555. var self=this;
  3556. return self;
  3557. return self;},
  3558. args: [],
  3559. source: unescape('deepCopy%0A%09%5Eself'),
  3560. messageSends: [],
  3561. referencedClasses: []
  3562. }),
  3563. smalltalk.Symbol);
  3564. smalltalk.addMethod(
  3565. unescape('_isSymbol'),
  3566. smalltalk.method({
  3567. selector: unescape('isSymbol'),
  3568. category: 'printing',
  3569. fn: function () {
  3570. var self=this;
  3571. return true;
  3572. return self;},
  3573. args: [],
  3574. source: unescape('isSymbol%0A%09%5Etrue'),
  3575. messageSends: [],
  3576. referencedClasses: []
  3577. }),
  3578. smalltalk.Symbol);
  3579. smalltalk.addMethod(
  3580. unescape('_printString'),
  3581. smalltalk.method({
  3582. selector: unescape('printString'),
  3583. category: 'printing',
  3584. fn: function () {
  3585. var self=this;
  3586. return smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self, "_asString", [])]);
  3587. return self;},
  3588. args: [],
  3589. source: unescape('printString%0A%09%5E%27%23%27%2C%20self%20asString'),
  3590. messageSends: [unescape("%2C"), "asString"],
  3591. referencedClasses: []
  3592. }),
  3593. smalltalk.Symbol);
  3594. smalltalk.addMethod(
  3595. unescape('_shallowCopy'),
  3596. smalltalk.method({
  3597. selector: unescape('shallowCopy'),
  3598. category: 'copying',
  3599. fn: function () {
  3600. var self=this;
  3601. return self;
  3602. return self;},
  3603. args: [],
  3604. source: unescape('shallowCopy%0A%09%5Eself'),
  3605. messageSends: [],
  3606. referencedClasses: []
  3607. }),
  3608. smalltalk.Symbol);
  3609. smalltalk.addMethod(
  3610. unescape('_size'),
  3611. smalltalk.method({
  3612. selector: unescape('size'),
  3613. category: 'accessing',
  3614. fn: function () {
  3615. var self=this;
  3616. return smalltalk.send(smalltalk.send(self, "_asString", []), "_size", []);
  3617. return self;},
  3618. args: [],
  3619. source: unescape('size%0A%09%5Eself%20asString%20size'),
  3620. messageSends: ["size", "asString"],
  3621. referencedClasses: []
  3622. }),
  3623. smalltalk.Symbol);
  3624. smalltalk.addMethod(
  3625. unescape('_basicNew'),
  3626. smalltalk.method({
  3627. selector: unescape('basicNew'),
  3628. category: 'instance creation',
  3629. fn: function () {
  3630. var self=this;
  3631. smalltalk.send(self, "_shouldNotImplement", []);
  3632. return self;},
  3633. args: [],
  3634. source: unescape('basicNew%0A%09self%20shouldNotImplement'),
  3635. messageSends: ["shouldNotImplement"],
  3636. referencedClasses: []
  3637. }),
  3638. smalltalk.Symbol.klass);
  3639. smalltalk.addMethod(
  3640. unescape('_fromString_'),
  3641. smalltalk.method({
  3642. selector: unescape('fromString%3A'),
  3643. category: 'instance creation',
  3644. fn: function (aString) {
  3645. var self=this;
  3646. return smalltalk.send(self, "_lookup_", [aString]);
  3647. return self;},
  3648. args: ["aString"],
  3649. source: unescape('fromString%3A%20aString%0A%09%5Eself%20lookup%3A%20aString'),
  3650. messageSends: ["lookup:"],
  3651. referencedClasses: []
  3652. }),
  3653. smalltalk.Symbol.klass);
  3654. smalltalk.addMethod(
  3655. unescape('_lookup_'),
  3656. smalltalk.method({
  3657. selector: unescape('lookup%3A'),
  3658. category: 'instance creation',
  3659. fn: function (aString) {
  3660. var self=this;
  3661. return smalltalk.symbolFor(aString);;
  3662. return self;},
  3663. args: ["aString"],
  3664. source: unescape('lookup%3A%20aString%0A%09%3Creturn%20smalltalk.symbolFor%28aString%29%3B%3E'),
  3665. messageSends: [],
  3666. referencedClasses: []
  3667. }),
  3668. smalltalk.Symbol.klass);
  3669. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3670. smalltalk.addMethod(
  3671. unescape('__eq'),
  3672. smalltalk.method({
  3673. selector: unescape('%3D'),
  3674. category: 'comparing',
  3675. fn: function (aCollection) {
  3676. var self=this;
  3677. 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", [])]);})]);
  3678. return self;},
  3679. args: ["aCollection"],
  3680. source: unescape('%3D%20aCollection%0A%09%5Eself%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%09%09elements%20%3D%20aCollection%20asArray%5D'),
  3681. messageSends: ["and:", unescape("%3D"), "class", "asArray"],
  3682. referencedClasses: []
  3683. }),
  3684. smalltalk.Set);
  3685. smalltalk.addMethod(
  3686. unescape('_add_'),
  3687. smalltalk.method({
  3688. selector: unescape('add%3A'),
  3689. category: 'adding/removing',
  3690. fn: function (anObject) {
  3691. var self=this;
  3692. var found;
  3693. for(var i=0; i < self['@elements'].length; i++) {
  3694. if(anObject == self['@elements'][i]) {
  3695. found = true;
  3696. break;
  3697. }
  3698. }
  3699. if(!found) {self['@elements'].push(anObject)}
  3700. ;
  3701. return self;},
  3702. args: ["anObject"],
  3703. source: unescape('add%3A%20anObject%0A%09%3C%0A%09%09var%20found%3B%0A%09%09for%28var%20i%3D0%3B%20i%20%3C%20self%5B%27@elements%27%5D.length%3B%20i++%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'),
  3704. messageSends: [],
  3705. referencedClasses: []
  3706. }),
  3707. smalltalk.Set);
  3708. smalltalk.addMethod(
  3709. unescape('_asArray'),
  3710. smalltalk.method({
  3711. selector: unescape('asArray'),
  3712. category: 'converting',
  3713. fn: function () {
  3714. var self=this;
  3715. return smalltalk.send(self['@elements'], "_copy", []);
  3716. return self;},
  3717. args: [],
  3718. source: unescape('asArray%0A%09%5Eelements%20copy'),
  3719. messageSends: ["copy"],
  3720. referencedClasses: []
  3721. }),
  3722. smalltalk.Set);
  3723. smalltalk.addMethod(
  3724. unescape('_detect_ifNone_'),
  3725. smalltalk.method({
  3726. selector: unescape('detect%3AifNone%3A'),
  3727. category: 'enumerating',
  3728. fn: function (aBlock, anotherBlock) {
  3729. var self=this;
  3730. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  3731. return self;},
  3732. args: ["aBlock", "anotherBlock"],
  3733. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eelements%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  3734. messageSends: ["detect:ifNone:"],
  3735. referencedClasses: []
  3736. }),
  3737. smalltalk.Set);
  3738. smalltalk.addMethod(
  3739. unescape('_do_'),
  3740. smalltalk.method({
  3741. selector: unescape('do%3A'),
  3742. category: 'enumerating',
  3743. fn: function (aBlock) {
  3744. var self=this;
  3745. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  3746. return self;},
  3747. args: ["aBlock"],
  3748. source: unescape('do%3A%20aBlock%0A%09elements%20do%3A%20aBlock'),
  3749. messageSends: ["do:"],
  3750. referencedClasses: []
  3751. }),
  3752. smalltalk.Set);
  3753. smalltalk.addMethod(
  3754. unescape('_includes_'),
  3755. smalltalk.method({
  3756. selector: unescape('includes%3A'),
  3757. category: 'testing',
  3758. fn: function (anObject) {
  3759. var self=this;
  3760. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  3761. return self;},
  3762. args: ["anObject"],
  3763. source: unescape('includes%3A%20anObject%0A%09%5Eelements%20includes%3A%20anObject'),
  3764. messageSends: ["includes:"],
  3765. referencedClasses: []
  3766. }),
  3767. smalltalk.Set);
  3768. smalltalk.addMethod(
  3769. unescape('_initialize'),
  3770. smalltalk.method({
  3771. selector: unescape('initialize'),
  3772. category: 'initialization',
  3773. fn: function () {
  3774. var self=this;
  3775. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3776. (self['@elements']=[]);
  3777. return self;},
  3778. args: [],
  3779. source: unescape('initialize%0A%09super%20initialize.%0A%09elements%20%3A%3D%20%23%28%29'),
  3780. messageSends: ["initialize"],
  3781. referencedClasses: []
  3782. }),
  3783. smalltalk.Set);
  3784. smalltalk.addMethod(
  3785. unescape('_remove_'),
  3786. smalltalk.method({
  3787. selector: unescape('remove%3A'),
  3788. category: 'adding/removing',
  3789. fn: function (anObject) {
  3790. var self=this;
  3791. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  3792. return self;},
  3793. args: ["anObject"],
  3794. source: unescape('remove%3A%20anObject%0A%09elements%20remove%3A%20anObject'),
  3795. messageSends: ["remove:"],
  3796. referencedClasses: []
  3797. }),
  3798. smalltalk.Set);
  3799. smalltalk.addMethod(
  3800. unescape('_select_'),
  3801. smalltalk.method({
  3802. selector: unescape('select%3A'),
  3803. category: 'enumerating',
  3804. fn: function (aBlock) {
  3805. var self=this;
  3806. var collection=nil;
  3807. (collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  3808. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
  3809. return collection;
  3810. return self;},
  3811. args: ["aBlock"],
  3812. source: unescape('select%3A%20aBlock%0A%09%7C%20collection%20%7C%0A%09collection%20%3A%3D%20self%20class%20new.%20%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09%09collection%20add%3A%20each%5D%5D.%0A%09%5Ecollection'),
  3813. messageSends: ["new", "class", "do:", "ifTrue:", "value:", "add:"],
  3814. referencedClasses: []
  3815. }),
  3816. smalltalk.Set);
  3817. smalltalk.addMethod(
  3818. unescape('_size'),
  3819. smalltalk.method({
  3820. selector: unescape('size'),
  3821. category: 'accessing',
  3822. fn: function () {
  3823. var self=this;
  3824. return smalltalk.send(self['@elements'], "_size", []);
  3825. return self;},
  3826. args: [],
  3827. source: unescape('size%0A%09%5Eelements%20size'),
  3828. messageSends: ["size"],
  3829. referencedClasses: []
  3830. }),
  3831. smalltalk.Set);
  3832. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3833. smalltalk.addMethod(
  3834. unescape('_compile_'),
  3835. smalltalk.method({
  3836. selector: unescape('compile%3A'),
  3837. category: 'evaluating',
  3838. fn: function (aString) {
  3839. var self=this;
  3840. return self.compile(aString);
  3841. return self;},
  3842. args: ["aString"],
  3843. source: unescape('compile%3A%20aString%0A%09%3Creturn%20self.compile%28aString%29%3E'),
  3844. messageSends: [],
  3845. referencedClasses: []
  3846. }),
  3847. smalltalk.RegularExpression);
  3848. smalltalk.addMethod(
  3849. unescape('_exec_'),
  3850. smalltalk.method({
  3851. selector: unescape('exec%3A'),
  3852. category: 'evaluating',
  3853. fn: function (aString) {
  3854. var self=this;
  3855. return self.exec(aString) || nil;
  3856. return self;},
  3857. args: ["aString"],
  3858. source: unescape('exec%3A%20aString%0A%09%3Creturn%20self.exec%28aString%29%20%7C%7C%20nil%3E'),
  3859. messageSends: [],
  3860. referencedClasses: []
  3861. }),
  3862. smalltalk.RegularExpression);
  3863. smalltalk.addMethod(
  3864. unescape('_test_'),
  3865. smalltalk.method({
  3866. selector: unescape('test%3A'),
  3867. category: 'evaluating',
  3868. fn: function (aString) {
  3869. var self=this;
  3870. return self.test(aString);
  3871. return self;},
  3872. args: ["aString"],
  3873. source: unescape('test%3A%20aString%0A%09%3Creturn%20self.test%28aString%29%3E'),
  3874. messageSends: [],
  3875. referencedClasses: []
  3876. }),
  3877. smalltalk.RegularExpression);
  3878. smalltalk.addMethod(
  3879. unescape('_fromString_'),
  3880. smalltalk.method({
  3881. selector: unescape('fromString%3A'),
  3882. category: 'instance creation',
  3883. fn: function (aString) {
  3884. var self=this;
  3885. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3886. return self;},
  3887. args: ["aString"],
  3888. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27'),
  3889. messageSends: ["fromString:flag:"],
  3890. referencedClasses: []
  3891. }),
  3892. smalltalk.RegularExpression.klass);
  3893. smalltalk.addMethod(
  3894. unescape('_fromString_flag_'),
  3895. smalltalk.method({
  3896. selector: unescape('fromString%3Aflag%3A'),
  3897. category: 'instance creation',
  3898. fn: function (aString, anotherString) {
  3899. var self=this;
  3900. return new RegExp(aString, anotherString);
  3901. return self;},
  3902. args: ["aString", "anotherString"],
  3903. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%3Creturn%20new%20RegExp%28aString%2C%20anotherString%29%3E'),
  3904. messageSends: [],
  3905. referencedClasses: []
  3906. }),
  3907. smalltalk.RegularExpression.klass);
  3908. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3909. smalltalk.addMethod(
  3910. unescape('_atEnd'),
  3911. smalltalk.method({
  3912. selector: unescape('atEnd'),
  3913. category: 'testing',
  3914. fn: function () {
  3915. var self=this;
  3916. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  3917. return self;},
  3918. args: [],
  3919. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size'),
  3920. messageSends: [unescape("%3D"), "position", "size"],
  3921. referencedClasses: []
  3922. }),
  3923. smalltalk.Stream);
  3924. smalltalk.addMethod(
  3925. unescape('_atStart'),
  3926. smalltalk.method({
  3927. selector: unescape('atStart'),
  3928. category: 'testing',
  3929. fn: function () {
  3930. var self=this;
  3931. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  3932. return self;},
  3933. args: [],
  3934. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200'),
  3935. messageSends: [unescape("%3D"), "position"],
  3936. referencedClasses: []
  3937. }),
  3938. smalltalk.Stream);
  3939. smalltalk.addMethod(
  3940. unescape('_close'),
  3941. smalltalk.method({
  3942. selector: unescape('close'),
  3943. category: 'actions',
  3944. fn: function () {
  3945. var self=this;
  3946. return self;},
  3947. args: [],
  3948. source: unescape('close'),
  3949. messageSends: [],
  3950. referencedClasses: []
  3951. }),
  3952. smalltalk.Stream);
  3953. smalltalk.addMethod(
  3954. unescape('_collection'),
  3955. smalltalk.method({
  3956. selector: unescape('collection'),
  3957. category: 'accessing',
  3958. fn: function () {
  3959. var self=this;
  3960. return self['@collection'];
  3961. return self;},
  3962. args: [],
  3963. source: unescape('collection%0A%09%5Ecollection'),
  3964. messageSends: [],
  3965. referencedClasses: []
  3966. }),
  3967. smalltalk.Stream);
  3968. smalltalk.addMethod(
  3969. unescape('_contents'),
  3970. smalltalk.method({
  3971. selector: unescape('contents'),
  3972. category: 'accessing',
  3973. fn: function () {
  3974. var self=this;
  3975. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  3976. return self;},
  3977. args: [],
  3978. 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'),
  3979. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  3980. referencedClasses: []
  3981. }),
  3982. smalltalk.Stream);
  3983. smalltalk.addMethod(
  3984. unescape('_do_'),
  3985. smalltalk.method({
  3986. selector: unescape('do%3A'),
  3987. category: 'enumerating',
  3988. fn: function (aBlock) {
  3989. var self=this;
  3990. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  3991. return self;},
  3992. args: ["aBlock"],
  3993. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D'),
  3994. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  3995. referencedClasses: []
  3996. }),
  3997. smalltalk.Stream);
  3998. smalltalk.addMethod(
  3999. unescape('_flush'),
  4000. smalltalk.method({
  4001. selector: unescape('flush'),
  4002. category: 'actions',
  4003. fn: function () {
  4004. var self=this;
  4005. return self;},
  4006. args: [],
  4007. source: unescape('flush'),
  4008. messageSends: [],
  4009. referencedClasses: []
  4010. }),
  4011. smalltalk.Stream);
  4012. smalltalk.addMethod(
  4013. unescape('_isEmpty'),
  4014. smalltalk.method({
  4015. selector: unescape('isEmpty'),
  4016. category: 'testing',
  4017. fn: function () {
  4018. var self=this;
  4019. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  4020. return self;},
  4021. args: [],
  4022. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  4023. messageSends: [unescape("%3D"), "size"],
  4024. referencedClasses: []
  4025. }),
  4026. smalltalk.Stream);
  4027. smalltalk.addMethod(
  4028. unescape('_next'),
  4029. smalltalk.method({
  4030. selector: unescape('next'),
  4031. category: 'reading',
  4032. fn: function () {
  4033. var self=this;
  4034. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return nil;})() : (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})]));
  4035. return self;},
  4036. args: [],
  4037. source: unescape('next%0A%09%5Eself%20atEnd%20%0A%09%09ifTrue%3A%20%5Bnil%5D%0A%09%09ifFalse%3A%20%5B%0A%09%09%09self%20position%3A%20self%20position%20+%201.%20%0A%09%09%09collection%20at%3A%20self%20position%5D'),
  4038. messageSends: ["ifTrue:ifFalse:", "atEnd", "position:", unescape("+"), "position", "at:"],
  4039. referencedClasses: []
  4040. }),
  4041. smalltalk.Stream);
  4042. smalltalk.addMethod(
  4043. unescape('_next_'),
  4044. smalltalk.method({
  4045. selector: unescape('next%3A'),
  4046. category: 'reading',
  4047. fn: function (anInteger) {
  4048. var self=this;
  4049. var tempCollection=nil;
  4050. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  4051. 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", [])]);})]));})]);
  4052. return tempCollection;
  4053. return self;},
  4054. args: ["anInteger"],
  4055. 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'),
  4056. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  4057. referencedClasses: []
  4058. }),
  4059. smalltalk.Stream);
  4060. smalltalk.addMethod(
  4061. unescape('_nextPut_'),
  4062. smalltalk.method({
  4063. selector: unescape('nextPut%3A'),
  4064. category: 'writing',
  4065. fn: function (anObject) {
  4066. var self=this;
  4067. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  4068. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4069. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4070. return self;},
  4071. args: ["anObject"],
  4072. 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'),
  4073. messageSends: ["position:", unescape("+"), "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  4074. referencedClasses: []
  4075. }),
  4076. smalltalk.Stream);
  4077. smalltalk.addMethod(
  4078. unescape('_nextPutAll_'),
  4079. smalltalk.method({
  4080. selector: unescape('nextPutAll%3A'),
  4081. category: 'writing',
  4082. fn: function (aCollection) {
  4083. var self=this;
  4084. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  4085. return self;},
  4086. args: ["aCollection"],
  4087. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D'),
  4088. messageSends: ["do:", "nextPut:"],
  4089. referencedClasses: []
  4090. }),
  4091. smalltalk.Stream);
  4092. smalltalk.addMethod(
  4093. unescape('_peek'),
  4094. smalltalk.method({
  4095. selector: unescape('peek'),
  4096. category: 'reading',
  4097. fn: function () {
  4098. var self=this;
  4099. 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)]))]);})]));
  4100. return self;},
  4101. args: [],
  4102. 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'),
  4103. messageSends: ["ifFalse:", "atEnd", "at:", "collection", unescape("+"), "position"],
  4104. referencedClasses: []
  4105. }),
  4106. smalltalk.Stream);
  4107. smalltalk.addMethod(
  4108. unescape('_position'),
  4109. smalltalk.method({
  4110. selector: unescape('position'),
  4111. category: 'accessing',
  4112. fn: function () {
  4113. var self=this;
  4114. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return (self['@position']=(0));})() : $receiver;
  4115. return self;},
  4116. args: [],
  4117. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D'),
  4118. messageSends: ["ifNil:"],
  4119. referencedClasses: []
  4120. }),
  4121. smalltalk.Stream);
  4122. smalltalk.addMethod(
  4123. unescape('_position_'),
  4124. smalltalk.method({
  4125. selector: unescape('position%3A'),
  4126. category: 'accessing',
  4127. fn: function (anInteger) {
  4128. var self=this;
  4129. (self['@position']=anInteger);
  4130. return self;},
  4131. args: ["anInteger"],
  4132. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger'),
  4133. messageSends: [],
  4134. referencedClasses: []
  4135. }),
  4136. smalltalk.Stream);
  4137. smalltalk.addMethod(
  4138. unescape('_reset'),
  4139. smalltalk.method({
  4140. selector: unescape('reset'),
  4141. category: 'actions',
  4142. fn: function () {
  4143. var self=this;
  4144. smalltalk.send(self, "_position_", [(0)]);
  4145. return self;},
  4146. args: [],
  4147. source: unescape('reset%0A%09self%20position%3A%200'),
  4148. messageSends: ["position:"],
  4149. referencedClasses: []
  4150. }),
  4151. smalltalk.Stream);
  4152. smalltalk.addMethod(
  4153. unescape('_resetContents'),
  4154. smalltalk.method({
  4155. selector: unescape('resetContents'),
  4156. category: 'actions',
  4157. fn: function () {
  4158. var self=this;
  4159. smalltalk.send(self, "_reset", []);
  4160. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4161. return self;},
  4162. args: [],
  4163. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200'),
  4164. messageSends: ["reset", "setStreamSize:"],
  4165. referencedClasses: []
  4166. }),
  4167. smalltalk.Stream);
  4168. smalltalk.addMethod(
  4169. unescape('_setCollection_'),
  4170. smalltalk.method({
  4171. selector: unescape('setCollection%3A'),
  4172. category: 'accessing',
  4173. fn: function (aCollection) {
  4174. var self=this;
  4175. (self['@collection']=aCollection);
  4176. return self;},
  4177. args: ["aCollection"],
  4178. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection'),
  4179. messageSends: [],
  4180. referencedClasses: []
  4181. }),
  4182. smalltalk.Stream);
  4183. smalltalk.addMethod(
  4184. unescape('_setStreamSize_'),
  4185. smalltalk.method({
  4186. selector: unescape('setStreamSize%3A'),
  4187. category: 'accessing',
  4188. fn: function (anInteger) {
  4189. var self=this;
  4190. (self['@streamSize']=anInteger);
  4191. return self;},
  4192. args: ["anInteger"],
  4193. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger'),
  4194. messageSends: [],
  4195. referencedClasses: []
  4196. }),
  4197. smalltalk.Stream);
  4198. smalltalk.addMethod(
  4199. unescape('_setToEnd'),
  4200. smalltalk.method({
  4201. selector: unescape('setToEnd'),
  4202. category: 'positioning',
  4203. fn: function () {
  4204. var self=this;
  4205. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4206. return self;},
  4207. args: [],
  4208. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size'),
  4209. messageSends: ["position:", "size"],
  4210. referencedClasses: []
  4211. }),
  4212. smalltalk.Stream);
  4213. smalltalk.addMethod(
  4214. unescape('_size'),
  4215. smalltalk.method({
  4216. selector: unescape('size'),
  4217. category: 'accessing',
  4218. fn: function () {
  4219. var self=this;
  4220. return smalltalk.send(self, "_streamSize", []);
  4221. return self;},
  4222. args: [],
  4223. source: unescape('size%0A%09%5Eself%20streamSize'),
  4224. messageSends: ["streamSize"],
  4225. referencedClasses: []
  4226. }),
  4227. smalltalk.Stream);
  4228. smalltalk.addMethod(
  4229. unescape('_skip_'),
  4230. smalltalk.method({
  4231. selector: unescape('skip%3A'),
  4232. category: 'positioning',
  4233. fn: function (anInteger) {
  4234. var self=this;
  4235. 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)])]);
  4236. return self;},
  4237. args: ["anInteger"],
  4238. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29'),
  4239. messageSends: ["position:", "min:max:", unescape("+"), "position", "size"],
  4240. referencedClasses: []
  4241. }),
  4242. smalltalk.Stream);
  4243. smalltalk.addMethod(
  4244. unescape('_streamSize'),
  4245. smalltalk.method({
  4246. selector: unescape('streamSize'),
  4247. category: 'accessing',
  4248. fn: function () {
  4249. var self=this;
  4250. return self['@streamSize'];
  4251. return self;},
  4252. args: [],
  4253. source: unescape('streamSize%0A%09%5EstreamSize'),
  4254. messageSends: [],
  4255. referencedClasses: []
  4256. }),
  4257. smalltalk.Stream);
  4258. smalltalk.addMethod(
  4259. unescape('_on_'),
  4260. smalltalk.method({
  4261. selector: unescape('on%3A'),
  4262. category: 'instance creation',
  4263. fn: function (aCollection) {
  4264. var self=this;
  4265. 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", []));
  4266. return self;},
  4267. args: ["aCollection"],
  4268. 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'),
  4269. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  4270. referencedClasses: []
  4271. }),
  4272. smalltalk.Stream.klass);
  4273. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  4274. smalltalk.addMethod(
  4275. unescape('_cr'),
  4276. smalltalk.method({
  4277. selector: unescape('cr'),
  4278. category: 'writing',
  4279. fn: function () {
  4280. var self=this;
  4281. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  4282. return self;},
  4283. args: [],
  4284. source: unescape('cr%0A%09%5Eself%20nextPutAll%3A%20String%20cr'),
  4285. messageSends: ["nextPutAll:", "cr"],
  4286. referencedClasses: ["String"]
  4287. }),
  4288. smalltalk.StringStream);
  4289. smalltalk.addMethod(
  4290. unescape('_crlf'),
  4291. smalltalk.method({
  4292. selector: unescape('crlf'),
  4293. category: 'writing',
  4294. fn: function () {
  4295. var self=this;
  4296. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  4297. return self;},
  4298. args: [],
  4299. source: unescape('crlf%0A%09%5Eself%20nextPutAll%3A%20String%20crlf'),
  4300. messageSends: ["nextPutAll:", "crlf"],
  4301. referencedClasses: ["String"]
  4302. }),
  4303. smalltalk.StringStream);
  4304. smalltalk.addMethod(
  4305. unescape('_lf'),
  4306. smalltalk.method({
  4307. selector: unescape('lf'),
  4308. category: 'writing',
  4309. fn: function () {
  4310. var self=this;
  4311. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  4312. return self;},
  4313. args: [],
  4314. source: unescape('lf%0A%09%5Eself%20nextPutAll%3A%20String%20lf'),
  4315. messageSends: ["nextPutAll:", "lf"],
  4316. referencedClasses: ["String"]
  4317. }),
  4318. smalltalk.StringStream);
  4319. smalltalk.addMethod(
  4320. unescape('_next_'),
  4321. smalltalk.method({
  4322. selector: unescape('next%3A'),
  4323. category: 'reading',
  4324. fn: function (anInteger) {
  4325. var self=this;
  4326. var tempCollection=nil;
  4327. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  4328. 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", [])]));})]));})]);
  4329. return tempCollection;
  4330. return self;},
  4331. args: ["anInteger"],
  4332. 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'),
  4333. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", unescape("%2C"), "next"],
  4334. referencedClasses: []
  4335. }),
  4336. smalltalk.StringStream);
  4337. smalltalk.addMethod(
  4338. unescape('_nextPut_'),
  4339. smalltalk.method({
  4340. selector: unescape('nextPut%3A'),
  4341. category: 'writing',
  4342. fn: function (aString) {
  4343. var self=this;
  4344. smalltalk.send(self, "_nextPutAll_", [aString]);
  4345. return self;},
  4346. args: ["aString"],
  4347. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString'),
  4348. messageSends: ["nextPutAll:"],
  4349. referencedClasses: []
  4350. }),
  4351. smalltalk.StringStream);
  4352. smalltalk.addMethod(
  4353. unescape('_nextPutAll_'),
  4354. smalltalk.method({
  4355. selector: unescape('nextPutAll%3A'),
  4356. category: 'writing',
  4357. fn: function (aString) {
  4358. var self=this;
  4359. 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", [])])])]);
  4360. 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", [])]))]);
  4361. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4362. return self;},
  4363. args: ["aString"],
  4364. 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'),
  4365. messageSends: ["setCollection:", unescape("%2C"), "copyFrom:to:", "collection", "position", unescape("+"), "size", "position:", "setStreamSize:", "max:", "streamSize"],
  4366. referencedClasses: []
  4367. }),
  4368. smalltalk.StringStream);
  4369. smalltalk.addMethod(
  4370. unescape('_space'),
  4371. smalltalk.method({
  4372. selector: unescape('space'),
  4373. category: 'writing',
  4374. fn: function () {
  4375. var self=this;
  4376. smalltalk.send(self, "_nextPut_", [" "]);
  4377. return self;},
  4378. args: [],
  4379. source: unescape('space%0A%09self%20nextPut%3A%20%27%20%27'),
  4380. messageSends: ["nextPut:"],
  4381. referencedClasses: []
  4382. }),
  4383. smalltalk.StringStream);