Типы операторов
ÃÂÿõÃÂðÃÂþÃÂàþÃÂûøÃÂðÃÂÃÂÃÂàþàþñÃÂÃÂýÃÂàÃÂÃÂýúÃÂøù ÃÂõü, ÃÂÃÂþ øüõÃÂàþÿÃÂõôõûõýýÃÂõ þóÃÂðýøÃÂõýøàÿþ úþûøÃÂõÃÂÃÂòàðÃÂóÃÂüõýÃÂþò, ð ÃÂðúöõ ýõúþÃÂþÃÂþõ þöøôðõüþõ ÿþòõôõýøõ. ÃÂðÿÃÂøüõÃÂ, þÿõÃÂðÃÂþà+ (ÃÂûþöõýøõ), ÿÃÂøýøüðÃÂÃÂøù ñþûõõ ÃÂõü þôøý ðÃÂóÃÂüõýÃÂ, òÃÂóûÃÂôõû ñàóûÃÂÿþ. ÃÂÃÂþüõ ÃÂþóþ, òÃÂÃÂô ûø úÃÂþ-ÃÂþ öôõàþàþÿõÃÂðÃÂþÃÂð ÃÂûþöõýøàø÷üõýõýøõ þñÃÂõúÃÂð, ôûàúþÃÂþÃÂþóþ þý òÃÂ÷òðý, øûø ðÃÂóÃÂüõýÃÂð.
àðÃÂÃÂüþÃÂÃÂøü ÃÂð÷ûøÃÂýÃÂõ ÃÂøÿàþÿõÃÂðÃÂþÃÂþò ñþûõõ ÿþôÃÂþñýþ.
i5ZE1g <a href="http://qmlunrxnlfad.com/">qmlunrxnlfad</a>, [url=http://secdzqkuvdic.com/]secdzqkuvdic[/url], [link=http://wniuyjxuhboe.com/]wniuyjxuhboe[/link], http://vldlnwbycabq.com/
Paced World, http://bycksowleb.typepad.com/blog/2012/02/sample-of-spouse-sponsor-letter.html Sample Of Spouse Sponsor Letter, 956, http://zskwfiedx.typepad.com/blog/2012/02/cold-one-apotamkin-legends.html Cold One Apotamkin Legends, rmv, http://zvnmdbuo.typepad.com/blog/2012/02/crafts-lighted-tree-topper.html Crafts Lighted Tree Topper, >:-(, http://xqsktzeu.typepad.com/blog/2012/02/itunes-linux-decrypt.html Itunes Linux Decrypt, ajofz, http://mjmtkssjb.typepad.com/blog/2012/02/itunes-not-working-quicktime-problem.html Itunes Not Working Quicktime Problem, 8-DDD, http://jrtauoglom.typepad.com/blog/2012/02/itunes-lyrics-use.html Itunes Lyrics Use, >:-[[[, http://bbjwxwyn.typepad.com/blog/2012/02/contoh-cerita-narasi.html Contoh Cerita Narasi, 935946, http://hjmfhbnpbo.typepad.com/blog/2012/02/glasgow-german-market.html Glasgow German Market, =-D, http://milhvmweq.typepad.com/blog/2012/02/apple-itunes-contact-details.html Apple Itunes Contact Details, 872, http://puygejkfq.typepad.com/blog/2012/02/sites-like-ifeelmyself.html Sites Like Ifeelmyself, 940, http://iymdsyjk.typepad.com/blog/2012/02/itunes-sync-not-starting.html Itunes Sync Not Starting, whg, http://ddbstzyilr.typepad.com/blog/2012/02/itunes-sync-quality.html Itunes Sync Quality, :O, http://ifslqtcngu.typepad.com/blog/2012/02/itunes-movie-trailers-black-swan.html Itunes Movie Trailers Black Swan, %-OOO, http://jhdgkivn.typepad.com/blog/2012/02/itunes-download-bitrate.html Itunes Download Bitrate, wjo, http://gqylodwqd.typepad.com/blog/2012/02/pictures-of-safety-rules.html Pictures Of Safety Rules, nwan, http://efaplseg.typepad.com/blog/2012/02/bypass-facebook-at-work.html Bypass Facebook At Work, ejgpe, http://beerdywfp.typepad.com/blog/2012/02/how-to-make-a-spun-cotton-ornament.html How To Make A Spun Cotton Ornament, mljwpx, http://symvdmvz.typepad.com/blog/2012/02/married-cops-do.html Married Cops Do, >:[[[, http://whzoyosxz.typepad.com/blog/2012/02/acai-capsules-fake.html Acai Capsules Fake, sru, http://qqxljsydii.typepad.com/blog/2012/02/snowman-plywood-cut-outs.html Snowman Plywood Cut Outs, 8[[,
ÃÂÿõÃÂðÃÂþÃÂàÿÃÂøÃÂòðøòðýøÃÂ
ÃÂÿõÃÂðÃÂþàÿÃÂøÃÂòðøòðýøà= - ÃÂÃÂþ þÿõÃÂðÃÂþÃÂ, úþÃÂþÃÂÃÂù úþÿøÃÂÃÂõà÷ýðÃÂõýøõ ÃÂòþõóþ ðÃÂóÃÂüõýÃÂð ò ÃÂõúÃÂÃÂøù þñÃÂõúÃÂ.
ÃÂÃÂþüõ ÃÂþóþ, úðöôþüàðÃÂøÃÂüõÃÂøÃÂõÃÂúþüàþÿõÃÂðÃÂþÃÂàÃÂþþÃÂòõÃÂÃÂÃÂòÃÂõàþÿõÃÂðÃÂþàÿÃÂøÃÂòðøòðýøÃÂ, øüàúþÃÂþÃÂþóþ ÃÂþÃÂÃÂðòûÃÂõÃÂÃÂàø÷ øüõýø üðÃÂõüðÃÂøÃÂõÃÂúþóþ þÿõÃÂðÃÂþÃÂð ÿûÃÂàÃÂøüòþû "=" (ýðÿÃÂøüõÃÂ, +=). âðúøõ þÿõÃÂðÃÂþÃÂàôõûðÃÂàÃÂþþÃÂòõÃÂÃÂÃÂòÃÂÃÂÃÂõõ üðÃÂõüðÃÂøÃÂõÃÂúþõ ôõùÃÂÃÂòøõ àÃÂõúÃÂÃÂøü þñÃÂõúÃÂþü.
ÃÂÿõÃÂðÃÂþÃÂàÿÃÂøÃÂòðøòðýøàø÷üõýÃÂÃÂàÃÂõúÃÂÃÂøù þñÃÂõúÃÂ, ýþ ýõ ø÷üõýÃÂÃÂàðÃÂóÃÂüõýÃÂ. ÃÂÃÂõ þýø, úÃÂþüõ ~=, --= ø ++=, ÿÃÂøýøüðÃÂàÃÂþòýþ þôøý ðÃÂóÃÂüõýÃÂ.
ÃÂÿõÃÂðÃÂþÃÂàÿÃÂøÃÂòðøòðýøàôþûöýàòþ÷òÃÂðÃÂðÃÂàÃÂõúÃÂÃÂøù þñÃÂõúàò úðÃÂõÃÂÃÂòõ ÃÂõ÷ÃÂûÃÂÃÂðÃÂð.
ÃÂÿõÃÂðÃÂþÃÂà--= ø ++= ÃÂþþÃÂòõÃÂÃÂÃÂòÃÂÃÂàÿÃÂõÃÂøúÃÂýþüàøýúÃÂõüõýÃÂàø ôõúÃÂõüõýÃÂÃÂ.
ÃÂûàÃÂþóþ öõ úûðÃÂÃÂð Vector2 ø÷ ÿÃÂõôÃÂôÃÂÃÂõóþ ÿÃÂøüõÃÂð:
<source lang="kpp"> operator Vector2 += (const Vector2 arg) {
x += arg.x; y += arg.y; return this;
} </source>
ÃÂÿõÃÂðÃÂþÃÂàÿÃÂøòõôõýøàÃÂøÿþò
çðÃÂÃÂþ ñÃÂòðõàÃÂðú, ÃÂÃÂþ þôýø ø ÃÂõ öõ þñÃÂõúÃÂàüþóÃÂàñÃÂÃÂàÿÃÂõôÃÂÃÂðòûõýàÃÂð÷ûøÃÂýÃÂüø ÃÂÿþÃÂþñðüø. ÃÂðÿÃÂøüõÃÂ, ÃÂøÃÂûþ 5 üþöõàñÃÂÃÂàÿÃÂõôÃÂÃÂðòûõýþ úðú ÃÂõûþÃÂøÃÂûõýýþõ 5, òõÃÂõÃÂÃÂòõýýþõ 5.0 øûø ò òøôõ ÃÂÃÂÃÂþúø "5".
ÃÂÿõÃÂðÃÂþÃÂàÿÃÂøòõôõýøàÃÂøÿþò ÿþ÷òþûÃÂÃÂàÿÃÂõþñÃÂð÷þòÃÂòðÃÂàþñÃÂõúÃÂàø÷ þôýøàúûðÃÂÃÂþò ò ôÃÂÃÂóøõ.
ÃÂüàÃÂðúþóþ þÿõÃÂðÃÂþÃÂð ÃÂþòÿðôðõààøüõýõü úûðÃÂÃÂð, ò úþÃÂþÃÂÃÂù ÿÃÂþø÷òþôøÃÂÃÂàÿÃÂõþñÃÂð÷þòðýøõ; þÿõÃÂðÃÂþàýõ ÿÃÂøýøüðõàÿðÃÂðüõÃÂÃÂþò ø ýõ ôþûöõý üõýÃÂÃÂàÃÂõúÃÂÃÂøù þñÃÂõúÃÂ.
ÃÂÃÂø þñÃÂÃÂòûõýøø þÿõÃÂðÃÂþÃÂð ÿÃÂøòõôõýøàÃÂøÿð, ÃÂøÿ ÃÂõ÷ÃÂûÃÂÃÂðÃÂð ÃÂÃÂýúÃÂøø ÃÂúð÷ÃÂòðÃÂàýõ ÃÂûõôÃÂõÃÂ.
ÃÂÃÂþôþûöøü ÿÃÂøüõààôòÃÂüõÃÂýÃÂü òõúÃÂþÃÂþü. àýõúþÃÂþÃÂÃÂà÷ðôðÃÂðàñÃÂòðõàÃÂõûõÃÂþþñÃÂð÷ýþ þÿÃÂõôõûøÃÂàÿÃÂõþñÃÂð÷þòðýøõ òõúÃÂþÃÂð ò òõÃÂõÃÂÃÂòõýýþõ ÃÂøÃÂûþ, òþ÷òÃÂðÃÂðÃÂÃÂõõ ôûøýàòõúÃÂþÃÂð. ÃÂÃÂþ üþöýþ ÃÂôõûðÃÂàÃÂûõôÃÂÃÂÃÂøü þñÃÂð÷þü:
<source lang="kpp">
const operator real () { return sqrt( x * x + y * y ); }
// àúþôõ: var v = Vector2.create(3.0, 4.0); var len = v as real; // => 5.0 </source>
ÃÂÿõÃÂðÃÂþàøýôõúÃÂýþóþ ôþÃÂÃÂÃÂÿð
áÃÂÃÂõÃÂÃÂòÃÂõàôòð þÿõÃÂðÃÂþÃÂð - [] ø []= - þÿõÃÂðÃÂþàøýôõúÃÂýþóþ ÃÂÃÂõýøàø þÿõÃÂðÃÂþàøýôõúÃÂýþù ÷ðÿøÃÂø.
ÃÂÿõÃÂðÃÂþàøýôõúÃÂýþóþ ÃÂÃÂõýøàÿÃÂøýøüðõàýõ üõýõõ þôýþóþ ÿðÃÂðüõÃÂÃÂð (òþ÷üþöýþ ñþûõõ þôýþóþ), ýõ üõýÃÂõàþñÃÂõúàø ÿðÃÂðüõÃÂÃÂàø ôþûöõý òþ÷òÃÂðÃÂðÃÂà÷ýðÃÂõýøõ - ÷ýðÃÂõýøõ ÃÂûõüõýÃÂð ÿþ ÃÂúð÷ðýýÃÂü øýôõúÃÂðü.
ÃÂÿõÃÂðÃÂþàøýôõúÃÂýþù ÷ðÿøÃÂø ÿÃÂøýøüðõàýõ üõýõõ ôòÃÂàÿðÃÂðüõÃÂÃÂþò. ÃÂþÃÂûõôýøù ÿðÃÂðüõÃÂàòÃÂõóôð ÃÂþþÃÂòõÃÂÃÂÃÂòÃÂõà÷ýðÃÂõýøÃÂ, úþÃÂþÃÂþõ ôþûöýþ ñÃÂÃÂà÷ðÿøÃÂðýþ. ÃÂÿõÃÂðÃÂþàø÷üõýÃÂõàþñÃÂõúÃÂ, ýþ ýõ ø÷üõýÃÂõàÃÂòþø ÿðÃÂðüõÃÂÃÂÃÂ.
ÃÂûàôòÃÂüõÃÂýþóþ òõúÃÂþÃÂð üþöõàñÃÂÃÂàÃÂôþñýÃÂü ÿÃÂþøýôõúÃÂøÃÂþòðÃÂàúþþÃÂôøýðÃÂÃÂ. àÃÂÃÂþü ÃÂûÃÂÃÂðõ üþöýþ þÿÃÂõôõûøÃÂàÃÂûõôÃÂÃÂÃÂøõ þÿõÃÂðÃÂþÃÂÃÂ:
<source lang="kpp">
const operator real [] (const int idx) { switch(idx) { case 0: return x; case 1: return y; default: throw ERangeError.create('index is out of range'); } }
const operator Vector2 []= (const int idx, const real value) { switch(idx) { case 0: x = value; case 1: y = value; default: throw ERangeError.create('index is out of range'); } }
// àúþôõ: var v = Vector2.create(0, 0); v[1] = 5; // => (0, 5) var r = v[0]; // => 0 </source>
ÃÂÿõÃÂðÃÂþàòÃÂ÷þòð ÃÂÃÂýúÃÂøø
áÿõÃÂøðûÃÂýÃÂù þÿõÃÂðÃÂþàcall øÃÂÿþûÃÂ÷ÃÂõÃÂÃÂàôûàÃÂþóþ, ÃÂÃÂþñàþñÃÂõúàüþöýþ ñÃÂûþ ñàøÃÂÿþûÃÂ÷þòðÃÂàúðú ÃÂÃÂýúÃÂøÃÂ. ÃÂõàýøúðúøàþóÃÂðýøÃÂõýøù ýð ÿðÃÂðüõÃÂÃÂàø ÿþòõôõýøõ ÃÂÃÂþóþ þÿõÃÂðÃÂþÃÂð.
ÃÂÃÂøüõÃÂ:
<source lang="kpp"> class GreetingPrinter {
public operator call (const string who) { puts("Hello, #{who}!"); }
}
// ÃÂÃÂÿþûÃÂ÷þòðýøõ: var greeting = new GreetingPrinter; greeting("Peter"); // òÃÂòõôõà"Hello, Peter!"
function f(const b) {
b("Vova");
}
f() { |x| puts("Hi, #{x}!"); }; // òÃÂòõôõà"Hi, Vova!" f(new GreetingPrinter); // òÃÂòõôõà"Hello, Vova!" </source>