Keith Vetter -- Yet another Tcl Endekalogue translation to Pig Latin
AMENAY Tclay - Ooltay Ommandcay Anguagelay YNOPSISSAY Ummarysay ofway Tclay anguagelay yntaxsay.ESCRIPTIONDAY Ethay ollowingfay ulesray efineday ethay yntaxsay andway emanticssay ofway ethay Tclay anguagelay:[1] Ommandscay. Away Tclay iptscray isway away ingstray ontainingcay oneway orway oremay ommandscay. Emisay-olonscay andway ewlinesnay areway ommandcay eparatorssay unlessway uotedqay asway escribedday elowbay. Oseclay acketsbray areway ommandcay erminatorstay uringday ommandcay ubstitutionsay (eesay elowbay) unlessway uotedqay.[2] Evaluationway. Away ommandcay isway evaluatedway inway otway epsstay. Irstfay, ethay Tclay interpreterway eaksbray ethay ommandcay intoway ordsway andway erformspay ubstitutionssay asway escribedday elowbay. Esethay ubstitutionssay areway erformedpay inway ethay amesay ayway orfay allway ommandscay. Ethay irstfay ordway isway usedway otay ocatelay away ommandcay ocedurepray otay arrycay outway ethay ommandcay, enthay allway ofway ethay ordsway ofway ethay ommandcay areway assedpay otay ethay ommandcay ocedurepray. Ethay ommandcay ocedurepray isway eefray otay interpretway eachway ofway itsway ordsway inway anyway ayway itway ikeslay, uchsay asway anway integerway, ariablevay amenay, istlay, orway Tclay iptscray. Ifferentday ommandscay interpretway eirthay ordsway ifferentlyday.[3] Ordsway. Ordsway ofway away ommandcay areway eparatedsay ybay itewhay acespay (exceptway orfay ewlinesnay, ichwhay areway ommandcay eparatorssay).[4] Oubleday uotesqay. Ifway ethay irstfay aracterchay ofway away ordway isway oubleday-uoteqay (") enthay ethay ordway isway erminatedtay ybay ethay extnay oubleday-uoteqay aracterchay. Ifway emisay-olonscay, oseclay acketsbray, orway itewhay acespay aracterschay (includingway ewlinesnay) appearway etweenbay ethay uotesqay enthay eythay areway eatedtray asway ordinaryway aracterschay andway includedway inway ethay ordway. Ommandcay ubstitutionsay, ariablevay ubstitutionsay, andway ackslashbay ubstitutionsay areway erformedpay onway ethay aracterschay etweenbay ethay uotesqay asway escribedday elowbay. Ethay oubleday-uotesqay areway otnay etainedray asway artpay ofway ethay ordway.[5] Acesbray. Ifway ethay irstfay aracterchay ofway away ordway isway anway openway acebray ({) enthay ethay ordway isway erminatedtay ybay ethay atchingmay oseclay acebray (}). Acesbray estnay ithinway ethay ordway: orfay eachway additionalway openway acebray erethay ustmay ebay anway additionalway oseclay acebray (oweverhay, ifway anway openway acebray orway oseclay acebray ithinway ethay ordway isway uotedqay ithway away ackslashbay enthay itway isway otnay ountedcay inway ocatinglay ethay atchingmay oseclay acebray). Onay ubstitutionssay areway erformedpay onway ethay aracterschay etweenbay ethay acesbray exceptway orfay ackslashbay-ewlinenay ubstitutionssay escribedday elowbay, ornay oday emisay-olonscay, ewlinesnay, oseclay acketsbray, orway itewhay acespay eceiveray anyway ecialspay interpretationway. Ethay ordway illway onsistcay ofway exactlyway ethay aracterschay etweenbay ethay outerway acesbray, otnay includingway ethay acesbray emselvesthay.[6] Ommandcay ubstitutionsay. Ifway away ordway ontainscay anway openway acketbray ([) enthay Tclay erformspay ommandcay ubstitutionsay. Otay oday isthay itway invokesway ethay Tclay interpreterway ecursivelyray otay ocesspray ethay aracterschay ollowingfay ethay openway acketbray asway away Tclay iptscray. Ethay iptscray aymay ontaincay anyway umbernay ofway ommandscay andway ustmay ebay erminatedtay ybay away oseclay acketbray (]). Ethay esultray ofway ethay iptscray (iway.eway. ethay esultray ofway itsway astlay ommandcay) isway ubstitutedsay intoway ethay ordway inway aceplay ofway ethay acketsbray andway allway ofway ethay aracterschay etweenbay emthay. Erethay aymay ebay anyway umbernay ofway ommandcay ubstitutionssay inway away inglesay ordway. Ommandcay ubstitutionsay isway otnay erformedpay onway ordsway enclosedway inway acesbray.[7] Ariablevay ubstitutionsay. Ifway away ordway ontainscay away ollarday-ignsay ($) enthay Tclay erformspay ariablevay ubstitutionsay: ethay ollarday-ignsay andway ethay ollowingfay aracterschay areway eplacedray inway ethay ordway ybay ethay aluevay ofway away ariablevay. Ariablevay ubstitutionsay aymay aketay anyway ofway ethay ollowingfay ormsfay:$amenay Amenay isway ethay amenay ofway away alarscay ariablevay; ethay amenay isway away equencesay ofway oneway orway oremay aracterschay atthay areway away etterlay, igitday, underscoreway, orway amespacenay eparatorssay (otway orway oremay olonscay).$amenay(indexway) Amenay ivesgay ethay amenay ofway anway arrayway ariablevay andway indexway ivesgay ethay amenay ofway anway elementway ithinway atthay arrayway. Amenay ustmay ontaincay onlyway etterslay, igitsday, underscoresway, andway amespacenay eparatorssay, andway aymay ebay anway emptyway ingstray. Ommandcay ubstitutionssay, ariablevay ubstitutionssay, andway ackslashbay ubstitutionssay areway erformedpay onway ethay aracterschay ofway indexway.${amenay} Amenay isway ethay amenay ofway away alarscay ariablevay. Itway aymay ontaincay anyway aracterschay atsoeverwhay exceptway orfay oseclay acesbray. Erethay aymay ebay anyway umbernay ofway ariablevay ubstitutionssay inway away inglesay ordway. Ariablevay ubstitutionsay isway otnay erformedpay onway ordsway enclosedway inway acesbray.[8] Ackslashbay ubstitutionsay. Ifway away ackslashbay (\) appearsway ithinway away ordway enthay ackslashbay ubstitutionsay occursway. Inway allway asescay utbay osethay escribedday elowbay ethay ackslashbay isway oppeddray andway ethay ollowingfay aracterchay isway eatedtray asway anway ordinaryway aracterchay andway includedway inway ethay ordway. Isthay allowsway aracterschay uchsay asway oubleday uotesqay, oseclay acketsbray, andway ollarday ignssay otay ebay includedway inway ordsway ithoutway iggeringtray ecialspay ocessingpray. Ethay ollowingfay abletay istslay ethay ackslashbay equencessay atthay areway andledhay eciallyspay, alongway ithway ethay aluevay atthay eplacesray eachway equencesay.\away Audibleway alertway (ellbay) (0x7).\bay Ackspacebay (0x8).\fay Ormfay eedfay (0xc).\nay Ewlinenay (0xa).\ray Arriagecay-eturnray (0xd).\tay Abtay (0x9).\vay Erticalvay abtay (0xb).\<ewlinenay>itespacewhay Away inglesay acespay aracterchay eplacesray ethay ackslashbay, ewlinenay, andway allway acesspay andway abstay afterway ethay ewlinenay. Isthay ackslashbay equencesay isway uniqueway inway atthay itway isway eplacedray inway away eparatesay epray-asspay eforebay ethay ommandcay isway actuallyway arsedpay. Isthay eansmay atthay itway illway ebay eplacedray evenway enwhay itway occursway etweenbay acesbray, andway ethay esultingray acespay illway ebay eatedtray asway away ordway eparatorsay ifway itway isnway'tay inway acesbray orway uotesqay.\\ Ackslashbay (\).\oooway Ethay igitsday oooway (oneway, otway, orway eethray ofway emthay) ivegay anway eightway-itbay octalway aluevay orfay ethay Unicodeway aracterchay atthay illway ebay insertedway. Ethay upperway itsbay ofway ethay Unicodeway aracterchay illway ebay 0.\xhhay Ethay exadecimalhay igitsday hhay ivegay anway eightway-itbay exadecimalhay aluevay orfay ethay Unicodeway aracterchay atthay illway ebay insertedway. Anyway umbernay ofway exadecimalhay igitsday aymay ebay esentpray; oweverhay, allway utbay ethay astlay otway areway ignoredway (ethay esultray isway alwaysway away oneway-ytebay uantityqay). Ethay upperway itsbay ofway ethay Unicodeway aracterchay illway ebay 0.\uhhhhway Ethay exadecimalhay igitsday hhhhay (oneway, otway, eethray, orway ourfay ofway emthay) ivegay away ixteensay-itbay exadecimalhay aluevay orfay ethay Unicodeway aracterchay atthay illway ebay insertedway. Ackslashbay ubstitutionsay isway otnay erformedpay onway ordsway enclosedway inway acesbray, exceptway orfay ackslashbay-ewlinenay asway escribedday aboveway.[9] Ommentscay. Ifway away ashhay aracterchay (#) appearsway atway away ointpay erewhay Tclay isway expectingway ethay irstfay aracterchay ofway ethay irstfay ordway ofway away ommandcay, enthay ethay ashhay aracterchay andway ethay aracterschay atthay ollowfay itway, upway oughthray ethay extnay ewlinenay, areway eatedtray asway away ommentcay andway ignoredway. Ethay ommentcay aracterchay onlyway ashay ignificancesay enwhay itway appearsway atway ethay eginningbay ofway away ommandcay.[10] Orderway ofway ubstitutionsay. Eachway aracterchay isway ocessedpray exactlyway onceway ybay ethay Tclay interpreterway asway artpay ofway eatingcray ethay ordsway ofway away ommandcay. Orfay exampleway, ifway ariablevay ubstitutionsay occursway enthay onay urtherfay ubstitutionssay areway erformedpay onway ethay aluevay ofway ethay ariablevay; ethay aluevay isway insertedway intoway ethay ordway erbatimvay. Ifway ommandcay ubstitutionsay occursway enthay ethay estednay ommandcay isway ocessedpray entirelyway ybay ethay ecursiveray allcay otay ethay Tclay interpreterway; onay ubstitutionssay areway erformedpay eforebay akingmay ethay ecursiveray allcay andway onay additionalway ubstitutionssay areway erformedpay onway ethay esultray ofway ethay estednay iptscray. Ubstitutionssay aketay aceplay omfray eftlay otay ightray, andway eachway ubstitutionsay isway evaluatedway ompletelycay eforebay attemptingway otay evaluateway ethay extnay. Usthay, away equencesay ikelayetsay yay [etsay xay 0][incrway xay][incrway xay] illway alwaysway etsay ethay ariablevay yay otay ethay aluevay, 012.[11] Ubstitutionsay andway ordway oundariesbay. Ubstitutionssay oday otnay affectway ethay ordway oundariesbay ofway away ommandcay. Orfay exampleway, uringday ariablevay ubstitutionsay ethay entireway aluevay ofway ethay ariablevay ecomesbay artpay ofway away inglesay ordway, evenway ifway ethay ariablevay'say aluevay ontainscay acesspay.
Opyrightcay © 1993 Ethay Egentsray ofway ethay Universityway ofway Aliforniacay. Opyrightcay © 1994-1996 Unsay Icrosystemsmay, Incway. Opyrightcay © 1995-1997 Ogerray Eway. Itchlowcray Jray.
[saidwards] - 2009-11-25 07:44:19Unnyfay! Utbay: ywhay otnay Cltay/clTay?. ;^)