CINXE.COM

Lua — Вікіпэдыя

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available" lang="be-tarask" dir="ltr"> <head> <meta charset="UTF-8"> <title>Lua — Вікіпэдыя</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )be_x_oldwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","студзень","люты","сакавік","красавік","травень","чэрвень","ліпень","жнівень","верасень","кастрычнік","лістапад","сьнежань"],"wgRequestId":"9eeac52d-7583-4fc4-a615-96301d75f5e9","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Lua","wgTitle":"Lua","wgCurRevisionId":2526406,"wgRevisionId":2526406,"wgArticleId":284767,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Мовы праграмаваньня, створаныя ў 1993 годзе","Прататыпна-арыентаваныя мовы праграмаваньня","Скрыптовыя мовы","Мовы з дынамічнай тыпізацыяй","Вольныя праграмы зь ліцэнзіяй МТІ","Бразыльскія вынаходніцтвы", "Кросплятформавыя вольныя праграмы","Вольныя кампілятары й інтэрпрэтатары","Вольныя бібліятэкі праграмаў","Вольныя праграмы на C"],"wgPageViewLanguage":"be-tarask","wgPageContentLanguage":"be-tarask","wgPageContentModel":"wikitext","wgRelevantPageName":"Lua","wgRelevantArticleId":284767,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"be-tarask","pageLanguageDir":"ltr","pageVariantFallbacks":"be-tarask"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":50000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false, "wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q207316","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready", "ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.blpEditNotice","ext.gadget.ReferenceTooltips","ext.gadget.wikibugs","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=be-tarask&amp;modules=ext.cite.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=be-tarask&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=be-tarask&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/1200px-Lua-Logo.svg.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="1200"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/800px-Lua-Logo.svg.png"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="800"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/640px-Lua-Logo.svg.png"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="640"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Lua — Вікіпэдыя"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//be-tarask.m.wikipedia.org/wiki/Lua"> <link rel="alternate" type="application/x-wiki" title="Рэдагаваць" href="/w/index.php?title=Lua&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Вікіпэдыя (be-tarask)"> <link rel="EditURI" type="application/rsd+xml" href="//be-tarask.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://be-tarask.wikipedia.org/wiki/Lua"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.be-x-old"> <link rel="alternate" type="application/atom+xml" title="Вікіпэдыя — Atom-стужка" href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%90%D0%BF%D0%BE%D1%88%D0%BD%D1%96%D1%8F_%D0%B7%D1%8C%D0%BC%D0%B5%D0%BD%D1%8B&amp;feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Lua rootpage-Lua skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Перайсьці да зьместу</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Сайт"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Галоўнае меню" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Галоўнае меню</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Галоўнае меню</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">перанесьці ў бакавую панэль</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">схаваць</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Навігацыя </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/%D0%93%D0%B0%D0%BB%D0%BE%D1%9E%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D0%B0" title="Наведаць галоўную старонку [z]" accesskey="z"><span>Галоўная старонка</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%92%D1%8B%D0%BF%D0%B0%D0%B4%D0%BA%D0%BE%D0%B2%D0%B0%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D0%B0" title="Паказаць выпадковы артыкул [x]" accesskey="x"><span>Выпадковы артыкул</span></a></li><li id="n-index" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%9F%D0%BE%D1%88%D1%83%D0%BA_%D0%BF%D0%B0_%D0%BA%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F%D1%85"><span>Рубрыкацыя</span></a></li><li id="n-featured" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%90%D0%B1%D1%80%D0%B0%D0%BD%D1%8B%D1%8F_%D0%B0%D1%80%D1%82%D1%8B%D0%BA%D1%83%D0%BB%D1%8B"><span>Абраныя артыкулы</span></a></li> </ul> </div> </div> <div id="p-participation" class="vector-menu mw-portlet mw-portlet-participation" > <div class="vector-menu-heading"> Удзел </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-bug_in_article" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%9F%D0%B0%D0%B2%D0%B5%D0%B4%D0%B0%D0%BC%D0%BB%D0%B5%D0%BD%D1%8C%D0%BD%D1%96_%D0%BF%D1%80%D0%B0_%D0%BF%D0%B0%D0%BC%D1%8B%D0%BB%D0%BA%D1%96"><span>Паведаміць пра памылку</span></a></li><li id="n-bad-image" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%9F%D0%B0%D0%B2%D0%B5%D0%B4%D0%B0%D0%BC%D0%BB%D0%B5%D0%BD%D1%8C%D0%BD%D1%96_%D0%BF%D1%80%D0%B0_%D0%BF%D0%B0%D0%BC%D1%8B%D0%BB%D0%BA%D1%96"><span>Паведаміць пра памылку</span></a></li><li id="n-forum" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC"><span>Форум</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%90%D0%BF%D0%BE%D1%88%D0%BD%D1%96%D1%8F_%D0%B7%D1%8C%D0%BC%D0%B5%D0%BD%D1%8B" title="Сьпіс апошніх зьменаў у Вікіпэдыі. [r]" accesskey="r"><span>Апошнія зьмены</span></a></li><li id="n-newpages" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%9D%D0%BE%D0%B2%D1%8B%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D1%96"><span>Новыя старонкі</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%94%D0%B0%D0%BF%D0%B0%D0%BC%D0%BE%D0%B3%D0%B0" title="Месца, каб пра ўсё даведацца"><span>Дапамога</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/%D0%93%D0%B0%D0%BB%D0%BE%D1%9E%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D0%B0" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Вікіпэдыя" src="/static/images/mobile/copyright/wikipedia-wordmark-be_x_old.svg" style="width: 7.5em; height: 1.3125em;"> <img class="mw-logo-tagline" alt="вольная энцыкляпэдыя" src="/static/images/mobile/copyright/wikipedia-tagline-be_x_old.svg" width="120" height="12" style="width: 7.5em; height: 0.75em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%9F%D0%BE%D1%88%D1%83%D0%BA" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Шукаць у Вікіпэдыі [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Пошук</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Пошук у Вікіпэдыі" aria-label="Пошук у Вікіпэдыі" autocapitalize="sentences" title="Шукаць у Вікіпэдыі [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Спэцыяльныя:Пошук"> </div> <button class="cdx-button cdx-search-input__end-button">Пошук</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Асабістыя прылады"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Выгляд"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page&#039;s font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Выгляд" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Выгляд</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_be-x-old.wikipedia.org&amp;uselang=be-tarask" class=""><span>Ахвяраваньні</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A1%D1%82%D0%B2%D0%B0%D1%80%D1%8B%D1%86%D1%8C_%D1%80%D0%B0%D1%85%D1%83%D0%BD%D0%B0%D0%BA&amp;returnto=Lua" title="Мы прапануем вам стварыць уліковы запіс і ўвайсьці, але гэта не абавязкова" class=""><span>Стварыць уліковы запіс</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A3%D0%B2%D0%B0%D1%85%D0%BE%D0%B4_%D1%83_%D1%81%D1%8B%D1%81%D1%82%D1%8D%D0%BC%D1%83&amp;returnto=Lua" title="Вас запрашаюць увайсьці, хаця гэта і неабавязкова. [o]" accesskey="o" class=""><span>Увайсьці</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Болей парамэтраў" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Асабістыя прылады" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Асабістыя прылады</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Карыстацкае мэню" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_be-x-old.wikipedia.org&amp;uselang=be-tarask"><span>Ахвяраваньні</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A1%D1%82%D0%B2%D0%B0%D1%80%D1%8B%D1%86%D1%8C_%D1%80%D0%B0%D1%85%D1%83%D0%BD%D0%B0%D0%BA&amp;returnto=Lua" title="Мы прапануем вам стварыць уліковы запіс і ўвайсьці, але гэта не абавязкова"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Стварыць уліковы запіс</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A3%D0%B2%D0%B0%D1%85%D0%BE%D0%B4_%D1%83_%D1%81%D1%8B%D1%81%D1%82%D1%8D%D0%BC%D1%83&amp;returnto=Lua" title="Вас запрашаюць увайсьці, хаця гэта і неабавязкова. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Увайсьці</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Старонкі для неаўтарызаваных рэдактараў <a href="/wiki/%D0%94%D0%B0%D0%BF%D0%B0%D0%BC%D0%BE%D0%B3%D0%B0:%D0%A3%D0%B2%D0%BE%D0%B4%D0%B7%D1%96%D0%BD%D1%8B" aria-label="Даведайцеся пра рэдагаваньне болей"><span>даведацца болей</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%9C%D0%BE%D0%B9_%D1%83%D0%BD%D1%91%D1%81%D0%B0%D0%BA" title="Сьпіс рэдагаваньняў, зробленых з гэтага IP-адрасу [y]" accesskey="y"><span>Унёсак</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%9C%D0%B0%D0%B5_%D1%80%D0%B0%D0%B7%D0%BC%D0%BE%D0%B2%D1%8B" title="Старонка гутарак пра рэдагаваньні, зробленыя з гэтага IP-адрасу [n]" accesskey="n"><span>Гутаркі</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Сайт"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Зьмест" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Зьмест</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">перанесьці ў бакавую панэль</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">схаваць</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Пачатак</div> </a> </li> <li id="toc-Гісторыя" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Гісторыя"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Гісторыя</span> </div> </a> <ul id="toc-Гісторыя-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Асаблівасьці" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Асаблівасьці"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Асаблівасьці</span> </div> </a> <button aria-controls="toc-Асаблівасьці-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Пераключыць падразьдзел Асаблівасьці</span> </button> <ul id="toc-Асаблівасьці-sublist" class="vector-toc-list"> <li id="toc-Сынтакс" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Сынтакс"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Сынтакс</span> </div> </a> <ul id="toc-Сынтакс-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Кіраваньне_патокам" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Кіраваньне_патокам"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Кіраваньне патокам</span> </div> </a> <ul id="toc-Кіраваньне_патокам-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Функцыі" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Функцыі"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>Функцыі</span> </div> </a> <ul id="toc-Функцыі-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Табліцы" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Табліцы"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4</span> <span>Табліцы</span> </div> </a> <ul id="toc-Табліцы-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Мэтатабліцы" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Мэтатабліцы"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.5</span> <span>Мэтатабліцы</span> </div> </a> <ul id="toc-Мэтатабліцы-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Аб’ектна-арыентаванае_праграмаванне" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Аб’ектна-арыентаванае_праграмаванне"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6</span> <span>Аб’ектна-арыентаванае праграмаванне</span> </div> </a> <ul id="toc-Аб’ектна-арыентаванае_праграмаванне-sublist" class="vector-toc-list"> <li id="toc-Спадкаваньне" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Спадкаваньне"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6.1</span> <span>Спадкаваньне</span> </div> </a> <ul id="toc-Спадкаваньне-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Рэалізацыя" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Рэалізацыя"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Рэалізацыя</span> </div> </a> <ul id="toc-Рэалізацыя-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-C_API" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#C_API"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>C API</span> </div> </a> <button aria-controls="toc-C_API-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Пераключыць падразьдзел C API</span> </button> <ul id="toc-C_API-sublist" class="vector-toc-list"> <li id="toc-Модулі" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Модулі"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>Модулі</span> </div> </a> <ul id="toc-Модулі-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Выкарыстанне" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Выкарыстанне"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Выкарыстанне</span> </div> </a> <ul id="toc-Выкарыстанне-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Крыніцы" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Крыніцы"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Крыніцы</span> </div> </a> <ul id="toc-Крыніцы-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Вонкавыя_спасылкі" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Вонкавыя_спасылкі"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Вонкавыя спасылкі</span> </div> </a> <ul id="toc-Вонкавыя_спасылкі-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Зьмест" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Схаваць/паказаць зьмест" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Схаваць/паказаць зьмест</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Lua</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Перайсьці да артыкула на іншай мове. Выбраць з: 71 language" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-71" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">71 мова</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D9%84%D9%88%D8%A7_(%D9%84%D8%BA%D8%A9_%D8%A8%D8%B1%D9%85%D8%AC%D8%A9)" title="لوا (لغة برمجة) — арабская" lang="ar" hreflang="ar" data-title="لوا (لغة برمجة)" data-language-autonym="العربية" data-language-local-name="арабская" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/Lua" title="Lua — азэрбайджанская" lang="az" hreflang="az" data-title="Lua" data-language-autonym="Azərbaycanca" data-language-local-name="азэрбайджанская" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://bn.wikipedia.org/wiki/%E0%A6%B2%E0%A7%81%E0%A6%AF%E0%A6%BC%E0%A6%BE_(%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A7%8B%E0%A6%97%E0%A7%8D%E0%A6%B0%E0%A6%BE%E0%A6%AE%E0%A6%BF%E0%A6%82_%E0%A6%AD%E0%A6%BE%E0%A6%B7%E0%A6%BE)" title="লুয়া (প্রোগ্রামিং ভাষা) — бэнгальская" lang="bn" hreflang="bn" data-title="লুয়া (প্রোগ্রামিং ভাষা)" data-language-autonym="বাংলা" data-language-local-name="бэнгальская" class="interlanguage-link-target"><span>বাংলা</span></a></li><li class="interlanguage-link interwiki-zh-min-nan mw-list-item"><a href="https://zh-min-nan.wikipedia.org/wiki/Lua" title="Lua — Minnan" lang="nan" hreflang="nan" data-title="Lua" data-language-autonym="閩南語 / Bân-lâm-gú" data-language-local-name="Minnan" class="interlanguage-link-target"><span>閩南語 / Bân-lâm-gú</span></a></li><li class="interlanguage-link interwiki-be mw-list-item"><a href="https://be.wikipedia.org/wiki/Lua_(%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D0%BD%D1%8F)" title="Lua (мова праграмавання) — беларуская" lang="be" hreflang="be" data-title="Lua (мова праграмавання)" data-language-autonym="Беларуская" data-language-local-name="беларуская" class="interlanguage-link-target"><span>Беларуская</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/Lua" title="Lua — баўгарская" lang="bg" hreflang="bg" data-title="Lua" data-language-autonym="Български" data-language-local-name="баўгарская" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-bs mw-list-item"><a href="https://bs.wikipedia.org/wiki/Lua_(programski_jezik)" title="Lua (programski jezik) — басьнійская" lang="bs" hreflang="bs" data-title="Lua (programski jezik)" data-language-autonym="Bosanski" data-language-local-name="басьнійская" class="interlanguage-link-target"><span>Bosanski</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Lua" title="Lua — каталёнская" lang="ca" hreflang="ca" data-title="Lua" data-language-autonym="Català" data-language-local-name="каталёнская" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Lua" title="Lua — чэская" lang="cs" hreflang="cs" data-title="Lua" data-language-autonym="Čeština" data-language-local-name="чэская" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Lua_(programmeringssprog)" title="Lua (programmeringssprog) — дацкая" lang="da" hreflang="da" data-title="Lua (programmeringssprog)" data-language-autonym="Dansk" data-language-local-name="дацкая" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Lua" title="Lua — нямецкая" lang="de" hreflang="de" data-title="Lua" data-language-autonym="Deutsch" data-language-local-name="нямецкая" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/Lua" title="Lua — эстонская" lang="et" hreflang="et" data-title="Lua" data-language-autonym="Eesti" data-language-local-name="эстонская" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/Lua" title="Lua — грэцкая" lang="el" hreflang="el" data-title="Lua" data-language-autonym="Ελληνικά" data-language-local-name="грэцкая" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Lua_(programming_language)" title="Lua (programming language) — ангельская" lang="en" hreflang="en" data-title="Lua (programming language)" data-language-autonym="English" data-language-local-name="ангельская" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Lua" title="Lua — гішпанская" lang="es" hreflang="es" data-title="Lua" data-language-autonym="Español" data-language-local-name="гішпанская" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-eo mw-list-item"><a href="https://eo.wikipedia.org/wiki/Lua" title="Lua — эспэранта" lang="eo" hreflang="eo" data-title="Lua" data-language-autonym="Esperanto" data-language-local-name="эспэранта" class="interlanguage-link-target"><span>Esperanto</span></a></li><li class="interlanguage-link interwiki-eu mw-list-item"><a href="https://eu.wikipedia.org/wiki/Lua_(programazio_lengoaia)" title="Lua (programazio lengoaia) — баскаўская" lang="eu" hreflang="eu" data-title="Lua (programazio lengoaia)" data-language-autonym="Euskara" data-language-local-name="баскаўская" class="interlanguage-link-target"><span>Euskara</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D9%84%D9%88%D8%A2_(%D8%B2%D8%A8%D8%A7%D9%86_%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%E2%80%8C%D9%86%D9%88%DB%8C%D8%B3%DB%8C)" title="لوآ (زبان برنامه‌نویسی) — пэрсыдзкая" lang="fa" hreflang="fa" data-title="لوآ (زبان برنامه‌نویسی)" data-language-autonym="فارسی" data-language-local-name="пэрсыдзкая" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Lua" title="Lua — француская" lang="fr" hreflang="fr" data-title="Lua" data-language-autonym="Français" data-language-local-name="француская" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-gl mw-list-item"><a href="https://gl.wikipedia.org/wiki/Lua_(linguaxe_de_programaci%C3%B3n)" title="Lua (linguaxe de programación) — галіцыйская" lang="gl" hreflang="gl" data-title="Lua (linguaxe de programación)" data-language-autonym="Galego" data-language-local-name="галіцыйская" class="interlanguage-link-target"><span>Galego</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EB%A3%A8%EC%95%84_(%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D_%EC%96%B8%EC%96%B4)" title="루아 (프로그래밍 언어) — карэйская" lang="ko" hreflang="ko" data-title="루아 (프로그래밍 언어)" data-language-autonym="한국어" data-language-local-name="карэйская" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikipedia.org/wiki/Lua_(%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B4%D5%A1%D5%B6_%D5%AC%D5%A5%D5%A6%D5%B8%D6%82)" title="Lua (ծրագրավորման լեզու) — армянская" lang="hy" hreflang="hy" data-title="Lua (ծրագրավորման լեզու)" data-language-autonym="Հայերեն" data-language-local-name="армянская" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikipedia.org/wiki/%E0%A4%B2%E0%A5%81%E0%A4%86_(%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A5%8B%E0%A4%97%E0%A5%8D%E0%A4%B0%E0%A4%BE%E0%A4%AE%E0%A4%A8_%E0%A4%AD%E0%A4%BE%E0%A4%B7%E0%A4%BE)" title="लुआ (प्रोग्रामन भाषा) — гіндзі" lang="hi" hreflang="hi" data-title="लुआ (प्रोग्रामन भाषा)" data-language-autonym="हिन्दी" data-language-local-name="гіндзі" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikipedia.org/wiki/Lua" title="Lua — харвацкая" lang="hr" hreflang="hr" data-title="Lua" data-language-autonym="Hrvatski" data-language-local-name="харвацкая" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-io mw-list-item"><a href="https://io.wikipedia.org/wiki/Lua_(programifo-linguo)" title="Lua (programifo-linguo) — ідзкая" lang="io" hreflang="io" data-title="Lua (programifo-linguo)" data-language-autonym="Ido" data-language-local-name="ідзкая" class="interlanguage-link-target"><span>Ido</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Lua_(bahasa_pemrograman)" title="Lua (bahasa pemrograman) — інданэзійская" lang="id" hreflang="id" data-title="Lua (bahasa pemrograman)" data-language-autonym="Bahasa Indonesia" data-language-local-name="інданэзійская" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-ia mw-list-item"><a href="https://ia.wikipedia.org/wiki/Lua_(linguage_de_programmation)" title="Lua (linguage de programmation) — інтэрлінгва" lang="ia" hreflang="ia" data-title="Lua (linguage de programmation)" data-language-autonym="Interlingua" data-language-local-name="інтэрлінгва" class="interlanguage-link-target"><span>Interlingua</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/Lua_(forritunarm%C3%A1l)" title="Lua (forritunarmál) — ісьляндзкая" lang="is" hreflang="is" data-title="Lua (forritunarmál)" data-language-autonym="Íslenska" data-language-local-name="ісьляндзкая" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Lua" title="Lua — італьянская" lang="it" hreflang="it" data-title="Lua" data-language-autonym="Italiano" data-language-local-name="італьянская" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%9C%D7%95%D7%90%D7%94_(%D7%A9%D7%A4%D7%AA_%D7%AA%D7%9B%D7%A0%D7%95%D7%AA)" title="לואה (שפת תכנות) — іўрыт" lang="he" hreflang="he" data-title="לואה (שפת תכנות)" data-language-autonym="עברית" data-language-local-name="іўрыт" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-ka mw-list-item"><a href="https://ka.wikipedia.org/wiki/%E1%83%9A%E1%83%A3%E1%83%90" title="ლუა — грузінская" lang="ka" hreflang="ka" data-title="ლუა" data-language-autonym="ქართული" data-language-local-name="грузінская" class="interlanguage-link-target"><span>ქართული</span></a></li><li class="interlanguage-link interwiki-sw mw-list-item"><a href="https://sw.wikipedia.org/wiki/Lua" title="Lua — суахілі" lang="sw" hreflang="sw" data-title="Lua" data-language-autonym="Kiswahili" data-language-local-name="суахілі" class="interlanguage-link-target"><span>Kiswahili</span></a></li><li class="interlanguage-link interwiki-la mw-list-item"><a href="https://la.wikipedia.org/wiki/Lua_(lingua_programmandi)" title="Lua (lingua programmandi) — лацінская" lang="la" hreflang="la" data-title="Lua (lingua programmandi)" data-language-autonym="Latina" data-language-local-name="лацінская" class="interlanguage-link-target"><span>Latina</span></a></li><li class="interlanguage-link interwiki-lv mw-list-item"><a href="https://lv.wikipedia.org/wiki/Lua" title="Lua — латыская" lang="lv" hreflang="lv" data-title="Lua" data-language-autonym="Latviešu" data-language-local-name="латыская" class="interlanguage-link-target"><span>Latviešu</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/Lua_(programoz%C3%A1si_nyelv)" title="Lua (programozási nyelv) — вугорская" lang="hu" hreflang="hu" data-title="Lua (programozási nyelv)" data-language-autonym="Magyar" data-language-local-name="вугорская" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%B2%E0%B5%82%E0%B4%85_(%E0%B4%AA%E0%B5%8D%E0%B4%B0%E0%B5%8B%E0%B4%97%E0%B5%8D%E0%B4%B0%E0%B4%BE%E0%B4%AE%E0%B4%BF%E0%B4%82%E0%B4%97%E0%B5%8D_%E0%B4%AD%E0%B4%BE%E0%B4%B7)" title="ലൂഅ (പ്രോഗ്രാമിംഗ് ഭാഷ) — малаяламская" lang="ml" hreflang="ml" data-title="ലൂഅ (പ്രോഗ്രാമിംഗ് ഭാഷ)" data-language-autonym="മലയാളം" data-language-local-name="малаяламская" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-ms mw-list-item"><a href="https://ms.wikipedia.org/wiki/Lua_(bahasa_pengaturcaraan)" title="Lua (bahasa pengaturcaraan) — малайская" lang="ms" hreflang="ms" data-title="Lua (bahasa pengaturcaraan)" data-language-autonym="Bahasa Melayu" data-language-local-name="малайская" class="interlanguage-link-target"><span>Bahasa Melayu</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Lua_(programmeertaal)" title="Lua (programmeertaal) — нідэрляндзкая" lang="nl" hreflang="nl" data-title="Lua (programmeertaal)" data-language-autonym="Nederlands" data-language-local-name="нідэрляндзкая" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/Lua" title="Lua — японская" lang="ja" hreflang="ja" data-title="Lua" data-language-autonym="日本語" data-language-local-name="японская" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikipedia.org/wiki/Lua" title="Lua — нарвэская (букмал)" lang="nb" hreflang="nb" data-title="Lua" data-language-autonym="Norsk bokmål" data-language-local-name="нарвэская (букмал)" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li><li class="interlanguage-link interwiki-or mw-list-item"><a href="https://or.wikipedia.org/wiki/%E0%AC%B2%E0%AD%81%E0%AC%86_(%E0%AC%AA%E0%AD%8D%E0%AC%B0%E0%AD%8B%E0%AC%97%E0%AD%8D%E0%AC%B0%E0%AC%BE%E0%AC%AE%E0%AC%BF%E0%AC%82_%E0%AC%AD%E0%AC%BE%E0%AC%B7%E0%AC%BE)" title="ଲୁଆ (ପ୍ରୋଗ୍ରାମିଂ ଭାଷା) — орыянская" lang="or" hreflang="or" data-title="ଲୁଆ (ପ୍ରୋଗ୍ରାମିଂ ଭାଷା)" data-language-autonym="ଓଡ଼ିଆ" data-language-local-name="орыянская" class="interlanguage-link-target"><span>ଓଡ଼ିଆ</span></a></li><li class="interlanguage-link interwiki-pa mw-list-item"><a href="https://pa.wikipedia.org/wiki/%E0%A8%B2%E0%A9%82%E0%A8%86_(%E0%A8%AA%E0%A9%8D%E0%A8%B0%E0%A9%8B%E0%A8%97%E0%A8%B0%E0%A8%BE%E0%A8%AE%E0%A8%BF%E0%A9%B0%E0%A8%97_%E0%A8%AD%E0%A8%BE%E0%A8%B8%E0%A8%BC%E0%A8%BE)" title="ਲੂਆ (ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ) — панджабская" lang="pa" hreflang="pa" data-title="ਲੂਆ (ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ)" data-language-autonym="ਪੰਜਾਬੀ" data-language-local-name="панджабская" class="interlanguage-link-target"><span>ਪੰਜਾਬੀ</span></a></li><li class="interlanguage-link interwiki-pnb mw-list-item"><a href="https://pnb.wikipedia.org/wiki/%D9%84%D9%88%D8%A7_(%D9%BE%D8%B1%D9%88%DA%AF%D8%B1%D8%A7%D9%85%D9%86%DA%AF_%D8%B2%D8%A8%D8%A7%D9%86)" title="لوا (پروگرامنگ زبان) — Western Punjabi" lang="pnb" hreflang="pnb" data-title="لوا (پروگرامنگ زبان)" data-language-autonym="پنجابی" data-language-local-name="Western Punjabi" class="interlanguage-link-target"><span>پنجابی</span></a></li><li class="interlanguage-link interwiki-km mw-list-item"><a href="https://km.wikipedia.org/wiki/%E1%9E%97%E1%9E%B6%E1%9E%9F%E1%9E%B6%E1%9E%80%E1%9E%98%E1%9F%92%E1%9E%98%E1%9E%9C%E1%9E%B7%E1%9E%92%E1%9E%B8_Lua" title="ភាសាកម្មវិធី Lua — кгмэрская" lang="km" hreflang="km" data-title="ភាសាកម្មវិធី Lua" data-language-autonym="ភាសាខ្មែរ" data-language-local-name="кгмэрская" class="interlanguage-link-target"><span>ភាសាខ្មែរ</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Lua" title="Lua — польская" lang="pl" hreflang="pl" data-title="Lua" data-language-autonym="Polski" data-language-local-name="польская" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Lua_(linguagem_de_programa%C3%A7%C3%A3o)" title="Lua (linguagem de programação) — партугальская" lang="pt" hreflang="pt" data-title="Lua (linguagem de programação)" data-language-autonym="Português" data-language-local-name="партугальская" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/Lua_(limbaj_de_programare)" title="Lua (limbaj de programare) — румынская" lang="ro" hreflang="ro" data-title="Lua (limbaj de programare)" data-language-autonym="Română" data-language-local-name="румынская" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-qu mw-list-item"><a href="https://qu.wikipedia.org/wiki/Lua_(wakichiy_simi)" title="Lua (wakichiy simi) — кечуа" lang="qu" hreflang="qu" data-title="Lua (wakichiy simi)" data-language-autonym="Runa Simi" data-language-local-name="кечуа" class="interlanguage-link-target"><span>Runa Simi</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/Lua" title="Lua — расейская" lang="ru" hreflang="ru" data-title="Lua" data-language-autonym="Русский" data-language-local-name="расейская" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sq mw-list-item"><a href="https://sq.wikipedia.org/wiki/Lua" title="Lua — альбанская" lang="sq" hreflang="sq" data-title="Lua" data-language-autonym="Shqip" data-language-local-name="альбанская" class="interlanguage-link-target"><span>Shqip</span></a></li><li class="interlanguage-link interwiki-si mw-list-item"><a href="https://si.wikipedia.org/wiki/%E0%B6%BD%E0%B7%94%E0%B7%80%E0%B7%8F_(%E0%B6%9A%E0%B7%8A%E2%80%8D%E0%B6%BB%E0%B6%B8%E0%B6%BD%E0%B7%9A%E0%B6%9B%E0%B6%B1_%E0%B6%B7%E0%B7%8F%E0%B7%82%E0%B7%8F%E0%B7%80)" title="ලුවා (ක්‍රමලේඛන භාෂාව) — сынгальская" lang="si" hreflang="si" data-title="ලුවා (ක්‍රමලේඛන භාෂාව)" data-language-autonym="සිංහල" data-language-local-name="сынгальская" class="interlanguage-link-target"><span>සිංහල</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Lua" title="Lua — спрошчаная ангельская" lang="en-simple" hreflang="en-simple" data-title="Lua" data-language-autonym="Simple English" data-language-local-name="спрошчаная ангельская" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/Lua" title="Lua — славацкая" lang="sk" hreflang="sk" data-title="Lua" data-language-autonym="Slovenčina" data-language-local-name="славацкая" class="interlanguage-link-target"><span>Slovenčina</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Lua_(programski_jezik)" title="Lua (programski jezik) — славенская" lang="sl" hreflang="sl" data-title="Lua (programski jezik)" data-language-autonym="Slovenščina" data-language-local-name="славенская" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-so mw-list-item"><a href="https://so.wikipedia.org/wiki/Lua" title="Lua — самалійская" lang="so" hreflang="so" data-title="Lua" data-language-autonym="Soomaaliga" data-language-local-name="самалійская" class="interlanguage-link-target"><span>Soomaaliga</span></a></li><li class="interlanguage-link interwiki-ckb mw-list-item"><a href="https://ckb.wikipedia.org/wiki/%D9%84%D9%88%D8%A7_(%D8%B2%D9%85%D8%A7%D9%86%DB%8C_%D9%BE%D8%B1%DB%86%DA%AF%D8%B1%D8%A7%D9%85%D8%B3%D8%A7%D8%B2%DB%8C)" title="لوا (زمانی پرۆگرامسازی) — цэнтральнакурдзкая" lang="ckb" hreflang="ckb" data-title="لوا (زمانی پرۆگرامسازی)" data-language-autonym="کوردی" data-language-local-name="цэнтральнакурдзкая" class="interlanguage-link-target"><span>کوردی</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/Lua_(programski_jezik)" title="Lua (programski jezik) — сэрбская" lang="sr" hreflang="sr" data-title="Lua (programski jezik)" data-language-autonym="Српски / srpski" data-language-local-name="сэрбская" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Lua" title="Lua — фінская" lang="fi" hreflang="fi" data-title="Lua" data-language-autonym="Suomi" data-language-local-name="фінская" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Lua" title="Lua — швэдзкая" lang="sv" hreflang="sv" data-title="Lua" data-language-autonym="Svenska" data-language-local-name="швэдзкая" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikipedia.org/wiki/%E0%AE%B2%E0%AF%82%E0%AE%B5%E0%AE%BE" title="லூவா — тамільская" lang="ta" hreflang="ta" data-title="லூவா" data-language-autonym="தமிழ்" data-language-local-name="тамільская" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B8%A5%E0%B8%B9%E0%B8%AD%E0%B8%B2" title="ภาษาลูอา — тайская" lang="th" hreflang="th" data-title="ภาษาลูอา" data-language-autonym="ไทย" data-language-local-name="тайская" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tg mw-list-item"><a href="https://tg.wikipedia.org/wiki/Lua" title="Lua — таджыцкая" lang="tg" hreflang="tg" data-title="Lua" data-language-autonym="Тоҷикӣ" data-language-local-name="таджыцкая" class="interlanguage-link-target"><span>Тоҷикӣ</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/Lua" title="Lua — турэцкая" lang="tr" hreflang="tr" data-title="Lua" data-language-autonym="Türkçe" data-language-local-name="турэцкая" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-udm mw-list-item"><a href="https://udm.wikipedia.org/wiki/Lua" title="Lua — удмурцкая" lang="udm" hreflang="udm" data-title="Lua" data-language-autonym="Удмурт" data-language-local-name="удмурцкая" class="interlanguage-link-target"><span>Удмурт</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/Lua" title="Lua — украінская" lang="uk" hreflang="uk" data-title="Lua" data-language-autonym="Українська" data-language-local-name="украінская" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D9%84%D9%88%D8%A7_(%D9%BE%D8%B1%D9%88%DA%AF%D8%B1%D8%A7%D9%85%D9%86%DA%AF_%D8%B2%D8%A8%D8%A7%D9%86)" title="لوا (پروگرامنگ زبان) — урду" lang="ur" hreflang="ur" data-title="لوا (پروگرامنگ زبان)" data-language-autonym="اردو" data-language-local-name="урду" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/Lua" title="Lua — віетнамская" lang="vi" hreflang="vi" data-title="Lua" data-language-autonym="Tiếng Việt" data-language-local-name="віетнамская" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-wuu mw-list-item"><a href="https://wuu.wikipedia.org/wiki/Lua" title="Lua — ву" lang="wuu" hreflang="wuu" data-title="Lua" data-language-autonym="吴语" data-language-local-name="ву" class="interlanguage-link-target"><span>吴语</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/Lua" title="Lua — кантонская" lang="yue" hreflang="yue" data-title="Lua" data-language-autonym="粵語" data-language-local-name="кантонская" class="interlanguage-link-target"><span>粵語</span></a></li><li class="interlanguage-link interwiki-diq mw-list-item"><a href="https://diq.wikipedia.org/wiki/Lua" title="Lua — Zazaki" lang="diq" hreflang="diq" data-title="Lua" data-language-autonym="Zazaki" data-language-local-name="Zazaki" class="interlanguage-link-target"><span>Zazaki</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/Lua" title="Lua — кітайская" lang="zh" hreflang="zh" data-title="Lua" data-language-autonym="中文" data-language-local-name="кітайская" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q207316#sitelinks-wikipedia" title="Рэдагаваць міжмоўныя спасылкі" class="wbc-editpage">Правіць спасылкі</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Прасторы назваў"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Lua" title="Паказаць зьмест старонкі [c]" accesskey="c"><span>Артыкул</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%D0%90%D0%B1%D0%BC%D0%B5%D1%80%D0%BA%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5:Lua&amp;action=edit&amp;redlink=1" rel="discussion" class="new" title="Абмеркаваньне зьместу старонкі (старонка не існуе) [t]" accesskey="t"><span>Абмеркаваньне</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Зьмяніць варыянт мовы" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">беларуская (тарашкевіца)</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Рэжымы"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Lua"><span>Чытаць</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Lua&amp;veaction=edit" title="Рэдагаваць гэтую старонку [v]" accesskey="v"><span>Рэдагаваць</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Lua&amp;action=edit" title="Рэдагаваць крынічны тэкст гэтай старонкі [e]" accesskey="e"><span>Рэдагаваць крыніцу</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Lua&amp;action=history" title="Мінулыя вэрсіі гэтай старонкі. [h]" accesskey="h"><span>Паказаць гісторыю</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Інструмэнты" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Інструмэнты</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Інструмэнты</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">перанесьці ў бакавую панэль</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">схаваць</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Болей вопцыяў" > <div class="vector-menu-heading"> Дзеяньні </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Lua"><span>Чытаць</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Lua&amp;veaction=edit" title="Рэдагаваць гэтую старонку [v]" accesskey="v"><span>Рэдагаваць</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Lua&amp;action=edit" title="Рэдагаваць крынічны тэкст гэтай старонкі [e]" accesskey="e"><span>Рэдагаваць крыніцу</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Lua&amp;action=history"><span>Паказаць гісторыю</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Агульныя </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A1%D0%BF%D0%B0%D1%81%D1%8B%D0%BB%D0%BA%D1%96_%D0%BD%D0%B0_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D1%83/Lua" title="Сьпіс усіх старонак, якія спасылаюцца на гэтую [j]" accesskey="j"><span>Спасылкі на старонку</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:RecentChangesLinked/Lua" rel="nofollow" title="Апошнія зьмены ў старонках, на якія спасылаецца гэтая старонка [k]" accesskey="k"><span>Зьвязаныя рэдагаваньні</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D1%96" title="Сьпіс усіх спэцыяльных старонак [q]" accesskey="q"><span>Спэцыяльныя старонкі</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Lua&amp;oldid=2526406" title="Сталая спасылка на гэтую вэрсію старонкі"><span>Сталая спасылка</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Lua&amp;action=info" title="Болей інфармацыі пра гэтую старонку"><span>Зьвесткі пра старонку</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:CiteThisPage&amp;page=Lua&amp;id=2526406&amp;wpFormIdentifier=titleform" title="Інфармацыя пра тое, як цытатаваць гэтую старонку"><span>Цытаваць старонку</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:UrlShortener&amp;url=https%3A%2F%2Fbe-tarask.wikipedia.org%2Fwiki%2FLua"><span>Атрымаць скарочаны URL-адрас</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:QrCode&amp;url=https%3A%2F%2Fbe-tarask.wikipedia.org%2Fwiki%2FLua"><span>Спампаваць QR-код</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Друк/экспарт </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:Book&amp;bookcmd=book_creator&amp;referer=Lua"><span>Стварыць кнігу</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:DownloadAsPdf&amp;page=Lua&amp;action=show-download-screen"><span>Загрузіць як PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Lua&amp;printable=yes" title="Вэрсія гэтай старонкі для друку [p]" accesskey="p"><span>Вэрсія для друку</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> У іншых праектах </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:Lua_(programming_language)" hreflang="en"><span>Вікісховішча</span></a></li><li class="wb-otherproject-link wb-otherproject-mediawiki mw-list-item"><a href="https://www.mediawiki.org/wiki/Lua" hreflang="en"><span>МэдыяВікі</span></a></li><li class="wb-otherproject-link wb-otherproject-meta mw-list-item"><a href="https://meta.wikimedia.org/wiki/Lua" hreflang="en"><span>Мэта-Вікі</span></a></li><li class="wb-otherproject-link wb-otherproject-wikifunctions mw-list-item"><a href="https://www.wikifunctions.org/wiki/Z620" hreflang="en"><span>Wikifunctions</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q207316" title="Спасылка на аб’ект у рэпазыторыі зьвестак [g]" accesskey="g"><span>Аб’ект Вікізьвестак</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Выгляд"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Выгляд</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">перанесьці ў бакавую панэль</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">схаваць</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">Зьвесткі зь Вікіпэдыі — вольнай энцыкляпэдыі</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="be-tarask" dir="ltr"><table class="infobox" cellspacing="3" style="width: 22em; text-align: left; font-size: 85%; line-height: 1.5em; width: 23em;"> <tbody><tr><td colspan="2" class="" style="padding-top: 1px; padding-bottom: 1px; text-align:center; font-size: 130%; font-weight: bold;">Lua</td></tr><tr><td colspan="2" class="" style="text-align:center;"> <span typeof="mw:File"><a href="/wiki/%D0%A4%D0%B0%D0%B9%D0%BB:Lua-Logo.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/128px-Lua-Logo.svg.png" decoding="async" width="128" height="128" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/192px-Lua-Logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/256px-Lua-Logo.svg.png 2x" data-file-width="947" data-file-height="947" /></a></span> </td></tr><tr><th style="padding:3px">Кляса языка:</th><td class="" style="padding:3px"> <a href="/w/index.php?title=%D0%A8%D0%BC%D0%B0%D1%82%D0%BF%D0%B0%D1%80%D0%B0%D0%B4%D1%8B%D0%B3%D0%BC%D0%B0%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Шматпарадыгмавая мова праграмаваньня (старонка не існуе)">Шматпарадыгмавая</a>: <a href="/wiki/%D0%A1%D0%BA%D1%80%D1%8B%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0" title="Скрыптовая мова">скрыптовая</a>, <a href="/wiki/%D0%86%D0%BC%D0%BF%D1%8D%D1%80%D0%B0%D1%82%D1%8B%D1%9E%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5" title="Імпэратыўнае праграмаваньне">імпэратыўная</a> (<a href="/wiki/%D0%9F%D1%80%D0%B0%D1%86%D1%8D%D0%B4%D1%83%D1%80%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5" title="Працэдурнае праграмаваньне">працэдурная</a>, <a href="/w/index.php?title=%D0%9F%D1%80%D0%B0%D1%82%D0%B0%D1%82%D1%8B%D0%BF%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Прататыпнае праграмаваньне (старонка не існуе)">прататыпная</a>, <a href="/wiki/%D0%90%D0%B1%27%D0%B5%D0%BA%D1%82%D0%BD%D0%B0-%D0%B0%D1%80%D1%8B%D0%B5%D0%BD%D1%82%D0%B0%D0%B2%D0%B0%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5" class="mw-redirect" title="Аб&#39;ектна-арыентаванае праграмаваньне">аб'ектна-арыентаваная</a>), <a href="/w/index.php?title=%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Функцыянальнае праграмаваньне (старонка не існуе)">функцыянаяльная</a>, <a href="/w/index.php?title=%D0%9C%D1%8D%D1%82%D0%B0%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Мэтапраграмаваньне (старонка не існуе)">падтрымлівае мэтапраграмаваньне</a>, <a href="/w/index.php?title=%D0%A0%D1%8D%D1%84%D0%BB%D0%B5%D0%BA%D1%82%D1%8B%D1%9E%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Рэфлектыўнае праграмаваньне (старонка не існуе)">рэфлектыўная</a></td></tr><tr><th style="padding:3px">Зьявілася ў:</th><td class="" style="padding:3px"> 1993 г.</td></tr><tr><th style="padding:3px">Аўтар(ы):</th><td class="" style="padding:3px"> Рабэрту Ерусалімскі<br />Луіс Энрыке дэ Фігуэйрэда<br />Вальдэмар Салес</td></tr><tr><th style="padding:3px"><a href="/wiki/%D0%A2%D1%8B%D0%BF_%D0%B4%D0%B0%D0%B4%D0%B7%D0%B5%D0%BD%D1%8B%D1%85" class="mw-redirect" title="Тып дадзеных">Тыпізацыя дадзеных</a>:</th><td class="" style="padding:3px"> <a href="/wiki/%D0%A1%D1%8B%D1%81%D1%82%D1%8D%D0%BC%D0%B0_%D1%82%D1%8B%D0%BF%D0%B0%D1%9E#Дынамічная_тыпізацыя" title="Сыстэма тыпаў">Дынамічная</a>, <a href="/wiki/%D0%9C%D0%BE%D1%86%D0%BD%D0%B0%D1%8F_%D0%B9_%D1%81%D0%BB%D0%B0%D0%B1%D0%B0%D1%8F_%D1%82%D1%8B%D0%BF%D1%96%D0%B7%D0%B0%D1%86%D1%8B%D1%8F" class="mw-redirect" title="Моцная й слабая тыпізацыя">слабая</a>, <a href="/wiki/%D0%9A%D0%B0%D1%87%D1%8B%D0%BD%D0%B0%D1%8F_%D1%82%D1%8B%D0%BF%D1%96%D0%B7%D0%B0%D1%86%D1%8B%D1%8F" title="Качыная тыпізацыя">качыная</a></td></tr><tr><th style="padding:3px">Рэалізацыі:</th><td class="" style="padding:3px"> <a rel="nofollow" class="external text" href="//www.lua.org/download.html">Lua</a>, <a href="/w/index.php?title=LuaJIT&amp;action=edit&amp;redlink=1" class="new" title="LuaJIT (старонка не існуе)">LuaJIT</a>, <a rel="nofollow" class="external text" href="//eliasdaler.github.io/luavela/">LuaVela</a>, <a rel="nofollow" class="external text" href="https://www.moonsharp.org/">MoonSharp</a>, <a rel="nofollow" class="external text" href="//luvit.io">Luvit</a>, <a rel="nofollow" class="external text" href="//www.luart.org">LuaRT</a>, <a rel="nofollow" class="external text" href="https://luau-lang.org">Lua<i>u</i></a></td></tr><tr><th style="padding:3px">Дыялекты:</th><td class="" style="padding:3px"> <a rel="nofollow" class="external text" href="http://metalua.luaforge.net/">Metalua</a>, <a rel="nofollow" class="external text" href="http://idle.thomaslauer.com">Idle</a>, <a rel="nofollow" class="external text" href="https://www.nongnu.org/gsl-shell/">GSL Shell</a></td></tr><tr><th style="padding:3px">Уплыў ад:</th><td class="" style="padding:3px"> <a href="/wiki/C%2B%2B" title="C++">C++</a>, <a href="/w/index.php?title=CLU_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="CLU (programming language) (старонка не існуе)">CLU</a>, <a href="/w/index.php?title=Modula-2&amp;action=edit&amp;redlink=1" class="new" title="Modula-2 (старонка не існуе)">Modula</a>, <a href="/w/index.php?title=Scheme_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Scheme (programming language) (старонка не існуе)">Scheme</a>, <a href="/w/index.php?title=SNOBOL&amp;action=edit&amp;redlink=1" class="new" title="SNOBOL (старонка не існуе)">SNOBOL</a></td></tr><tr><th style="padding:3px">Уплыў на:</th><td class="" style="padding:3px"> <a href="/w/index.php?title=GameMonkey_Script&amp;action=edit&amp;redlink=1" class="new" title="GameMonkey Script (старонка не існуе)">GameMonkey</a>, <a href="/w/index.php?title=Io_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Io (programming language) (старонка не існуе)">Io</a>, <a href="/w/index.php?title=Julia_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Julia (programming language) (старонка не існуе)">Julia</a>, MiniD, <a href="/w/index.php?title=Red_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Red (programming language) (старонка не існуе)">Red</a>, <a href="/w/index.php?title=Ring_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Ring (programming language) (старонка не існуе)">Ring</a>,<sup id="cite_ref-Мова_праграмаваньня_Ring_і_іншыя_мовы_1-0" class="reference"><a href="#cite_note-Мова_праграмаваньня_Ring_і_іншыя_мовы-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup> <a href="/w/index.php?title=Squirrel_(programming_language)&amp;action=edit&amp;redlink=1" class="new" title="Squirrel (programming language) (старонка не існуе)">Squirrel</a>, MoonScript, <a href="/w/index.php?title=C--&amp;action=edit&amp;redlink=1" class="new" title="C-- (старонка не існуе)">C--</a></td></tr><tr><th style="padding:3px"><a href="/wiki/%D0%90%D0%BF%D1%8D%D1%80%D0%B0%D1%86%D1%8B%D0%B9%D0%BD%D0%B0%D1%8F_%D1%81%D1%8B%D1%81%D1%82%D1%8D%D0%BC%D0%B0" title="Апэрацыйная сыстэма">АС</a>:</th><td class="" style="padding:3px"> <a href="/w/index.php?title=%D0%9A%D1%80%D0%BE%D1%81%D0%BF%D0%BB%D1%8F%D1%82%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D0%B2%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%BD%D0%B0%D0%B5_%D0%B7%D0%B0%D0%B1%D1%8F%D1%81%D1%8C%D0%BF%D1%8F%D1%87%D1%8D%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Кросплятформавае праграмнае забясьпячэньне (старонка не існуе)">Кросплятформавая</a></td></tr><tr><th style="padding:3px"><a href="/wiki/%D0%9B%D1%96%D1%86%D1%8D%D0%BD%D0%B7%D1%96%D1%8F" title="Ліцэнзія">Ліцэнзія</a>:</th><td class="" style="padding:3px"> <a href="/w/index.php?title=MIT_License&amp;action=edit&amp;redlink=1" class="new" title="MIT License (старонка не існуе)">MIT License</a></td></tr><tr><th style="padding:3px">Афіцыйная старонка:</th><td class="" style="padding:3px"> <a rel="nofollow" class="external text" href="//www.lua.org">www.lua.org</a></td></tr> </tbody></table> <p><b>Lua</b> (ад <a href="/wiki/%D0%9F%D0%B0%D1%80%D1%82%D1%83%D0%B3%D0%B0%D0%BB%D1%8C%D1%81%D0%BA%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0" title="Партугальская мова">партугальскага</a>: lua [ ˈlu(w)ɐ ] «луа», што значыць <a href="/wiki/%D0%9C%D0%B5%D1%81%D1%8F%D1%86_(%D1%81%D0%BF%D0%B0%D0%B4%D0%B0%D1%80%D0%BE%D0%B6%D0%BD%D1%96%D0%BA)" title="Месяц (спадарожнік)">Месяц</a>)&#160;— <a href="/w/index.php?title=%D0%92%D1%8B%D1%81%D0%BE%D0%BA%D0%B0%D1%9E%D0%B7%D1%80%D0%BE%D1%9E%D0%BD%D0%B5%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Высокаўзроўневая мова праграмаваньня (старонка не існуе)">высокаўзроўневая</a> <a href="/w/index.php?title=%D0%A8%D0%BC%D0%B0%D1%82%D0%BF%D0%B0%D1%80%D0%B0%D0%B4%D1%8B%D0%B3%D0%BC%D0%B0%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Шматпарадыгмавая мова праграмаваньня (старонка не існуе)">шматпарадыгмавая</a> <a href="/wiki/%D0%A1%D0%BA%D1%80%D1%8B%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0" title="Скрыптовая мова">скрыптовая</a> <a href="/wiki/%D0%9C%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F" title="Мова праграмаваньня">мова праграмаваньня</a><sup id="cite_ref-luaspe_2-0" class="reference"><a href="#cite_note-luaspe-2"><span class="cite-bracket">&#91;</span>2<span class="cite-bracket">&#93;</span></a></sup>. Lua з’яўляецца <a href="/w/index.php?title=%D0%9A%D1%80%D0%BE%D1%81%D0%BF%D0%BB%D1%8F%D1%82%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D0%B2%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%BD%D0%B0%D0%B5_%D0%B7%D0%B0%D0%B1%D0%B5%D1%81%D0%BF%D1%8F%D1%87%D1%8D%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Кросплятформавае праграмнае забеспячэньне (старонка не існуе)">кросплятформавай</a>, паколькі <a href="/w/index.php?title=%D0%86%D0%BD%D1%82%D1%8D%D1%80%D0%BF%D1%80%D1%8D%D1%82%D0%B0%D1%82%D0%B0%D1%80&amp;action=edit&amp;redlink=1" class="new" title="Інтэрпрэтатар (старонка не існуе)">інтэрпрэтатар</a> скампіляванага <a href="/w/index.php?title=%D0%91%D0%B0%D0%B9%D1%82-%D0%BA%D0%BE%D0%B4&amp;action=edit&amp;redlink=1" class="new" title="Байт-код (старонка не існуе)">байт-кода</a> напісаны на <a href="/wiki/ANSI_C" class="mw-redirect" title="ANSI C">ANSI C</a>,<sup id="cite_ref-luaabout_3-0" class="reference"><a href="#cite_note-luaabout-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup> і Lua мае адносна простае C <a href="/w/index.php?title=API&amp;action=edit&amp;redlink=1" class="new" title="API (старонка не існуе)">API</a> для ўбудаваньня яго ў дадаткі.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">&#91;</span>4<span class="cite-bracket">&#93;</span></a></sup> </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Гісторыя"><span id=".D0.93.D1.96.D1.81.D1.82.D0.BE.D1.80.D1.8B.D1.8F"></span>Гісторыя</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=1" title="Рэдагаваць сэкцыю «Гісторыя»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=1" title="Правіць зыходнік раздзела: Гісторыя"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Lua была створаная ў 1993 годзе Рабэрту Ерусалімскім, Луісам Энрыке дэ Фігуэйрэда і Вальдэмарам Салесам, удзельнікамі Tecgraf (Computer Graphics Technology Group&#160;— групы тэхналёгій кампутарнай графікі) у Папскім каталіцкім унівэрсытэце Рыа-ды-Жанейра ў Бразіліі. </p><p>З 1977 па 1992 год у Бразілія праводзіла палітыку жорсткіх <a href="/w/index.php?title=%D0%93%D0%B0%D0%BD%D0%B4%D0%BB%D1%91%D0%B2%D1%8B_%D0%B1%D0%B0%D1%80%27%D0%B5%D1%80&amp;action=edit&amp;redlink=1" class="new" title="Гандлёвы бар&#39;ер (старонка не існуе)">гандлёвых бар’ераў</a> (так званых рынкавых рэзэрваў) у дачыненьні да кампутарнага абсталяваньня і праграмнага забеспячэньня, мяркуючы, што Бразілія можа і павінна вырабляць іх сама. З-за чаго кліенты Tecgraf не маглі дазволіць сабе, ні палітычна, ні фінансава, купляць індывідуальнае праграмнае забеспячэньне з-за мяжы; згодна з рынкавым рэзэрвам, кліенты павінны былі б прайсьці праз складаны бюракратычны працэс, каб даказаць, што іх патрэбы не могуць быць задаволеныя бразільскімі кампаніямі. Гэта вымусіла Tecgraf ствараць неабходныя інструмэнты з нуля.<sup id="cite_ref-hopl2007_5-0" class="reference"><a href="#cite_note-hopl2007-5"><span class="cite-bracket">&#91;</span>5<span class="cite-bracket">&#93;</span></a></sup> </p><p>Папярэднікамі Lua былі мовы <i>SOL</i> (Simple Object Language&#160;— простая аб’ектная мова) і <i>DEL</i> (Data-Entry Language&#160;— мова ўводу даных).<sup id="cite_ref-luahist2001_6-0" class="reference"><a href="#cite_note-luahist2001-6"><span class="cite-bracket">&#91;</span>6<span class="cite-bracket">&#93;</span></a></sup> Яны былі незалежна распрацаваны ў Tecgraf у 1992—1993 гадах, каб дадаць некаторую гнуткасць у два розныя праекты (абодва былі інтэрактыўнымі графічнымі праграмамі для кампаніі Petrobras). У SOL і DEL не хапала структур кіравання патокам, і Petrobras адчувала ўсё большую патрэбу ў тым, каб дадаць да іх поўную магутнасць праграмаваньня. </p><p>Lua 1.0 была распрацаваны такім чынам, што яго канструктары аб’ектаў, якія ў той час крыху адрозьніваліся ад цяперашняга лёгкага і гнуткага стылю, уключалі сынтакс апісаньня даных SOL (адсюль назва Lua: <i>Sol</i> азначае «Сонца» на партугальскай мове, а <i>Lua</i> азначае «Месяц»). <a href="/w/index.php?title=%D0%A1%D1%8B%D0%BD%D1%82%D0%B0%D0%BA%D1%81_(%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F)&amp;action=edit&amp;redlink=1" class="new" title="Сынтакс (мова праграмаваньня) (старонка не існуе)">Сынтакс</a> Lua для структур кіраваньня ў асноўным быў запазычаны з <a href="/w/index.php?title=Modula&amp;action=edit&amp;redlink=1" class="new" title="Modula (старонка не існуе)">Modula</a> (<code>if</code>, <code>while</code>, <code>repeat</code> / <code>until</code>), але таксама паспытаў уплыў <a href="/w/index.php?title=CLU&amp;action=edit&amp;redlink=1" class="new" title="CLU (старонка не існуе)">CLU</a> (множныя прызначэнні і множныя вяртанні з функцый, як больш простая альтэрнатыва <a href="/w/index.php?title=%D0%A1%D0%BF%D0%B0%D1%81%D1%8B%D0%BB%D0%B0%D1%87%D0%BD%D1%8B_%D0%BF%D0%B0%D1%80%D0%B0%D0%BC%D0%B5%D1%82%D0%B0%D1%80&amp;action=edit&amp;redlink=1" class="new" title="Спасылачны параметар (старонка не існуе)">спасылачным параметрам</a> або яўным <a href="/w/index.php?title=%D0%A3%D0%BA%D0%B0%D0%B7%D0%B0%D0%BB%D1%8C%D0%BD%D1%96%D0%BA_(%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Указальнік (машыннае праграмаваньне) (старонка не існуе)">указальнікам</a>), <a href="/wiki/C%2B%2B" title="C++">C++</a> («выдатная ідэя дазволіць <a href="/w/index.php?title=%D0%9B%D1%8F%D0%BA%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D0%B7%D1%8C%D0%BC%D0%B5%D0%BD%D0%BD%D0%B0%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Лякальная зьменная (старонка не існуе)">лякальнай зьменнай</a> быць аб’яўленай толькі там, дзе яна патрэбна»), <a href="/w/index.php?title=SNOBOL&amp;action=edit&amp;redlink=1" class="new" title="SNOBOL (старонка не існуе)">SNOBOL</a> і <a href="/w/index.php?title=AWK&amp;action=edit&amp;redlink=1" class="new" title="AWK (старонка не існуе)">AWK</a> (<a href="/w/index.php?title=%D0%90%D1%81%D0%B0%D1%86%D1%8B%D1%8F%D1%86%D1%8B%D0%B9%D0%BD%D1%8B_%D0%BC%D0%B0%D1%81%D1%96%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Асацыяцыйны масіў (старонка не існуе)">асацыяцыйныя масівы</a>). У артыкуле, апублікаваным у <i>часопісе Dr. Dobb’s Journal</i>, стваральнікі Lua таксама сцвярджаюць, што <a href="/w/index.php?title=LISP&amp;action=edit&amp;redlink=1" class="new" title="LISP (старонка не існуе)">LISP</a> і <a href="/w/index.php?title=Scheme&amp;action=edit&amp;redlink=1" class="new" title="Scheme (старонка не існуе)">Scheme</a> з іх адзінай універсальнай структурай даных (<a href="/wiki/%D0%A1%D1%8C%D0%BF%D1%96%D1%81" title="Сьпіс">сьпісам</a>) паўплывалі на іх рашэньне выкарыстаць табліцу ў якасьці асноўнай структуры даных Lua.<sup id="cite_ref-ddj96_7-0" class="reference"><a href="#cite_note-ddj96-7"><span class="cite-bracket">&#91;</span>7<span class="cite-bracket">&#93;</span></a></sup> </p><p>Зь цягам часу сэмантыка Lua падвяргалася ўсё большаму ўплыву Scheme,<sup id="cite_ref-hopl2007_5-1" class="reference"><a href="#cite_note-hopl2007-5"><span class="cite-bracket">&#91;</span>5<span class="cite-bracket">&#93;</span></a></sup> асабліва з увядзеньнем <a href="/w/index.php?title=%D0%90%D0%BD%D0%B0%D0%BD%D1%96%D0%BC%D0%BD%D0%B0%D1%8F_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Ананімная функцыя (старонка не існуе)">ананімных функцый</a> і поўнага <a href="/w/index.php?title=%D0%90%D0%B1%D1%81%D1%8F%D0%B3_%D0%BF%D1%80%D1%8B%D0%B2%D1%8F%D0%B7%D0%BA%D1%96_%D1%96%D0%BC%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Абсяг прывязкі імя (старонка не існуе)">лексычнага абсягу</a>. У новых версіях Lua было дададзена некалькі функцый. </p><p>Lua да вэрсіі 5.0 выпускалася пад ліцэнзіяй, падобнай да ліцэнзіі BSD. Пачынаючы з вэрсіі 5.0 і далей, Lua распаўсюджваецца па ліцэнзіі MIT. Абедзьве дазваляюць карыстацца Lua бясплатна. </p> <div class="mw-heading mw-heading2"><h2 id="Асаблівасьці"><span id=".D0.90.D1.81.D0.B0.D0.B1.D0.BB.D1.96.D0.B2.D0.B0.D1.81.D1.8C.D1.86.D1.96"></span>Асаблівасьці</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=2" title="Рэдагаваць сэкцыю «Асаблівасьці»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=2" title="Правіць зыходнік раздзела: Асаблівасьці"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Lua звычайна апісваюць як <a href="/w/index.php?title=%D0%A8%D0%BC%D0%B0%D1%82%D0%BF%D0%B0%D1%80%D0%B0%D0%B4%D1%8B%D0%B3%D0%BC%D0%B0%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Шматпарадыгмавая мова праграмаваньня (старонка не існуе)">шматпарадыгмавую</a> мову, якая мае невялікую базавую функцыянальнасць, якая можа быць пашыраны ў адпаведнасьці з вырашаемай праблемай. Lua не мае яўнай падтрымкі <a href="/wiki/%D0%A1%D0%BF%D0%B0%D0%B4%D0%BA%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5_(%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)" title="Спадкаваньне (праграмаваньне)">спадкаваньня</a>, але дазваляе рэалізаваць яго з дапамогай <a href="/wiki/%D0%A3%D0%B4%D0%B7%D0%B5%D0%BB%D1%8C%D0%BD%D1%96%D0%BA:%D0%A5%D0%B0%D1%87%D0%B0%D0%BF%D1%83%D1%80%D1%8B/Lua#Мэтатабліцы" class="mw-redirect" title="Удзельнік:Хачапуры/Lua">мэтатабліц</a>. Аналягічным чынам Lua дае магчымасьць выкарыстоўваць <a href="/w/index.php?title=%D0%9F%D1%80%D0%B0%D1%81%D1%82%D0%BE%D1%80%D0%B0_%D1%96%D0%BC%D1%91%D0%BD%D0%B0%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Прастора імёнаў (старонка не існуе)">прасторы імёнаў</a>, <a href="/wiki/%D0%9A%D0%BB%D1%8F%D1%81%D0%B0_(%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)" title="Кляса (праграмаваньне)">клясы</a> і іншую функцыянальнасць; <a href="/w/index.php?title=%D0%9F%D0%B5%D1%80%D1%88%D0%B0%D0%BA%D0%BB%D1%8F%D1%81%D0%BD%D0%B0%D1%8F_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Першаклясная функцыя (старонка не існуе)">першаклясныя функцыі</a> дазваляюць выкарыстоўваць мноства мэтадаў <a href="/w/index.php?title=%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Функцыянальнае праграмаваньне (старонка не існуе)">функцыянальнага праграмавання</a>, а поўны <a href="/w/index.php?title=%D0%90%D0%B1%D1%81%D1%8F%D0%B3_%D0%BF%D1%80%D1%8B%D0%B2%D1%8F%D0%B7%D0%BA%D1%96_%D1%96%D0%BC%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Абсяг прывязкі імя (старонка не існуе)">лексычны абсяг</a> дазваляе схаваць дэталёвую інфармацыю для выкананьня <a href="/w/index.php?title=%D0%9F%D1%80%D1%8B%D0%BD%D1%86%D1%8B%D0%BF_%D0%BD%D0%B0%D0%B9%D0%BC%D0%B5%D0%BD%D1%88%D1%8B%D1%85_%D0%BF%D1%80%D1%8B%D0%B2%D1%96%D0%BB%D0%B5%D1%8F%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Прынцып найменшых прывілеяў (старонка не існуе)">прынцыпу найменшых прывілеяў</a>. </p><p>Увогуле, Lua імкнецца прадастаўляць простыя, гнуткія <a href="/w/index.php?title=%D0%9C%D1%8D%D1%82%D0%B0%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Мэтапраграмаваньне (старонка не існуе)">мэтафункцыі</a>, якія можна пашыраць па меры неабходнасці, а не набор функцый, характэрны для адной парадыгмы праграмаваньня. У выніку базавая мова выкарыстоўвае невялікі аб’ём памяці; скампіляваны <a href="/w/index.php?title=%D0%86%D0%BD%D1%82%D1%8D%D1%80%D0%BF%D1%80%D1%8D%D1%82%D0%B0%D1%82%D0%B0%D1%80&amp;action=edit&amp;redlink=1" class="new" title="Інтэрпрэтатар (старонка не існуе)">інтэрпрэтатар</a> займае толькі каля 247&#160;<a href="/wiki/%D0%9A%D1%96%D0%BB%D1%8F%D0%B1%D0%B0%D0%B9%D1%82" title="Кілябайт">kB</a><sup id="cite_ref-luaabout_3-1" class="reference"><a href="#cite_note-luaabout-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup>. </p><p>Як мова з <a href="/w/index.php?title=%D0%94%D1%8B%D0%BD%D0%B0%D0%BC%D1%96%D1%87%D0%BD%D0%B0%D1%8F_%D1%82%D1%8B%D0%BF%D1%96%D0%B7%D0%B0%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Дынамічная тыпізацыя (старонка не існуе)">дынамічнай тыпізацыяй</a>, прызначаная для выкарыстання ў якасці <a href="/wiki/%D0%A1%D0%BA%D1%80%D1%8B%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0" title="Скрыптовая мова">мовы сцэнарыяў</a>, Lua досыць кампактная, каб змясьціцца на розных хост-плятформах. Яна падтрымлівае толькі невялікую колькасць простых тыпаў даных, такіх як <a href="/w/index.php?title=%D0%91%D1%83%D0%BB%D0%B5%D0%B2%D1%8B_%D1%82%D1%8B%D0%BF_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85&amp;action=edit&amp;redlink=1" class="new" title="Булевы тып даных (старонка не існуе)">булевыя</a> значэньні, лічбы (па змаўчаньні з плаваючай кропкай падвойнай дакладнасьці і 64-бітныя <a href="/wiki/%D0%A6%D1%8D%D0%BB%D1%8B_%D0%BB%D1%96%D0%BA" title="Цэлы лік">цэлыя</a>) і <a href="/w/index.php?title=%D0%A0%D0%B0%D0%B4%D0%BE%D0%BA_(%D1%82%D1%8B%D0%BF_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Радок (тып даных) (старонка не існуе)">радкі</a>. Тыповыя структуры даных, такія як <a href="/w/index.php?title=%D0%9C%D0%B0%D1%81%D1%96%D1%9E_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Масіў (структура даных) (старонка не існуе)">масівы</a>, <a href="/w/index.php?title=%D0%A1%D1%8D%D1%82_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Сэт (структура даных) (старонка не існуе)">сэты</a>, <a href="/wiki/%D0%A1%D1%8C%D0%BF%D1%96%D1%81" title="Сьпіс">сьпісы</a> і <a href="/w/index.php?title=%D0%97%D0%B0%D0%BF%D1%96%D1%81_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Запіс (структура даных) (старонка не існуе)">запісы</a>, могуць быць прадстаўлены з дапамогай адзінай уласнай структуры даных Lua&#160;— табліцы, якая па сутнасьці з’яўляецца гетэрагенным <a href="/w/index.php?title=%D0%90%D1%81%D0%B0%D1%86%D1%8B%D1%8F%D1%82%D1%8B%D1%9E%D0%BD%D1%8B_%D0%BC%D0%B0%D1%81%D1%96%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Асацыятыўны масіў (старонка не існуе)">асацыятыўным масівам</a>. </p><p>Lua рэалізуе невялікі набор пашыраных функцый, такіх як <a href="/w/index.php?title=%D0%9F%D0%B5%D1%80%D1%88%D0%B0%D0%BA%D0%BB%D1%8F%D1%81%D0%BD%D0%B0%D1%8F_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Першаклясная функцыя (старонка не існуе)">першаклясныя функцыі</a>, <a href="/w/index.php?title=%D0%97%D0%B1%D0%BE%D1%80%D0%BA%D0%B0_%D1%81%D0%BC%D0%B5%D1%86%D1%8C%D1%86%D1%8F_(%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Зборка смецьця (машыннае праграмаваньне) (старонка не існуе)">зборка смецьця</a>, <a href="/w/index.php?title=%D0%97%D0%B0%D0%BC%D1%8B%D0%BA%D0%B0%D0%BD%D0%BD%D0%B5_(%D1%96%D0%BD%D1%84%D0%B0%D1%80%D0%BC%D0%B0%D1%82%D1%8B%D0%BA%D0%B0)&amp;action=edit&amp;redlink=1" class="new" title="Замыканне (інфарматыка) (старонка не існуе)">замыканьні</a>, правільныя <a href="/w/index.php?title=%D0%A5%D0%B2%D0%B0%D1%81%D1%82%D0%B0%D0%B2%D1%8B_%D0%B2%D1%8B%D0%BA%D0%BB%D1%96%D0%BA&amp;action=edit&amp;redlink=1" class="new" title="Хваставы выклік (старонка не існуе)">хваставыя выклікі</a>, <a href="/w/index.php?title=%D0%9F%D0%B5%D1%80%D0%B0%D1%9E%D1%82%D0%B2%D0%B0%D1%80%D1%8D%D0%BD%D1%8C%D0%BD%D0%B5_%D1%82%D1%8B%D0%BF%D1%83_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85&amp;action=edit&amp;redlink=1" class="new" title="Пераўтварэньне тыпу даных (старонка не існуе)">пераўтварэньне</a> (аўтаматычнае пераўтварэнне паміж радковымі і лікавымі значэннямі падчас выканання), <a href="/w/index.php?title=%D0%9A%D0%B0%D1%80%D1%83%D1%82%D1%8B%D0%BD%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Карутына (старонка не існуе)">карутыны</a> (кааператыўная шматзадачнасьць) і <a href="/w/index.php?title=%D0%94%D1%8B%D0%BD%D0%B0%D0%BC%D1%96%D1%87%D0%BD%D0%B0%D1%8F_%D0%B7%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Дынамічная загрузка (старонка не існуе)">дынамічная загрузка модуляў</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Сынтакс"><span id=".D0.A1.D1.8B.D0.BD.D1.82.D0.B0.D0.BA.D1.81"></span>Сынтакс</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=3" title="Рэдагаваць сэкцыю «Сынтакс»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=3" title="Правіць зыходнік раздзела: Сынтакс"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Клясычная <a href="/w/index.php?title=%22Hello,_World!%22_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="&quot;Hello, World!&quot; праграма (старонка не існуе)">"Hello, World!" праграма</a> можа быць запісана наступным чынам, з дужкамі або без:<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">&#91;</span>8<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="err">«</span><span class="n">Hello</span><span class="p">,</span> <span class="n">World</span><span class="err">!»</span><span class="p">)</span> </pre></div> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">print</span> <span class="err">«</span><span class="n">Hello</span><span class="p">,</span> <span class="n">World</span><span class="err">!»</span> </pre></div> <p><a href="/w/index.php?title=%D0%9A%D0%B0%D0%BC%D1%8D%D0%BD%D1%82%D0%B0%D1%80_(%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Камэнтар (машыннае праграмаваньне) (старонка не існуе)">Камэнтар</a> у Lua пачынаецца з падвойнага злучка і працягваецца да канца радка, падобна да <a href="/w/index.php?title=Ada&amp;action=edit&amp;redlink=1" class="new" title="Ada (старонка не існуе)">Ada</a>, <a href="/w/index.php?title=Eiffel&amp;action=edit&amp;redlink=1" class="new" title="Eiffel (старонка не існуе)">Eiffel</a>, <a href="/w/index.php?title=Haskell&amp;action=edit&amp;redlink=1" class="new" title="Haskell (старонка не існуе)">Haskell</a>, <a href="/wiki/Slovnaft" title="Slovnaft">SQL</a> і <a href="/w/index.php?title=VHDL&amp;action=edit&amp;redlink=1" class="new" title="VHDL (старонка не існуе)">VHDL</a>. Шматрадковыя камэнтары абмежаваныя падвойнымі квадратнымі дужкамі. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="err">—</span> <span class="err">аднарадковы</span> <span class="err">камэнтар</span> <span class="cm">--[[</span> <span class="cm"> шматрадковы </span> <span class="cm"> камэнтар</span> <span class="cm">]]</span> </pre></div> <p><span id="Прыклад_факторыял"></span>У наступным прыкладзе рэалізавана функцыя вылічэньня <a href="/w/index.php?title=%D0%A4%D0%B0%D0%BA%D1%82%D0%B0%D1%80%D1%8B%D1%8F%D0%BB&amp;action=edit&amp;redlink=1" class="new" title="Фактарыял (старонка не існуе)">фактарыялу</a>: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">function</span> <span class="nf">factorial</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="kd">local</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">1</span> <span class="kr">for</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> <span class="n">n</span> <span class="kr">do</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="o">*</span> <span class="n">i</span> <span class="kr">end</span> <span class="kr">return</span> <span class="n">x</span> <span class="kr">end</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Кіраваньне_патокам"><span id=".D0.9A.D1.96.D1.80.D0.B0.D0.B2.D0.B0.D0.BD.D1.8C.D0.BD.D0.B5_.D0.BF.D0.B0.D1.82.D0.BE.D0.BA.D0.B0.D0.BC"></span>Кіраваньне патокам</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=4" title="Рэдагаваць сэкцыю «Кіраваньне патокам»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=4" title="Правіць зыходнік раздзела: Кіраваньне патокам"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Lua мае адзіную канструкцыю <a href="/w/index.php?title=%D0%93%D0%B0%D0%BB%D1%96%D0%BD%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5_(%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Галінаваньне (машыннае праграмаваньне) (старонка не існуе)">галінаваньня</a>: <code>if then end</code> з неабавязковым <code>else</code> і <code>elseif then</code>. </p><p>Стандартны апэратар <code>if then end</code> патрабуе ўсіх трох ключавых слоў: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">if</span> <span class="err">умова</span> <span class="kr">then</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">end</span> </pre></div> <p>Ключавое слова <code>else</code> можа быць дададзена з суправаджальным блокам апэратараў для кіраваньня выкананнем, калі ўмова <code>if</code> вылічваецца як <code>false</code>: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">if</span> <span class="err">умова</span> <span class="kr">then</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">else</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">end</span> </pre></div> <p>Множны выбар рэалізуецца канструкцыяй <code>elseif then</code>: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">if</span> <span class="err">умова</span> <span class="kr">then</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">elseif</span> <span class="err">умова</span> <span class="kr">then</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">else</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">end</span> </pre></div> <p>Lua мае чатыры тыпы ўмоўных <a href="/w/index.php?title=%D0%A6%D1%8B%D0%BA%D0%BB%D1%8C_(%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Цыкль (машыннае праграмаваньне) (старонка не існуе)">цыкляў</a>: <code>while</code>, <code>repeat</code> (падобны на <code>do while</code>), лікавы <code>for</code> і агульны <code>for</code>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">while</span> <span class="err">умова</span> <span class="kr">do</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">end</span> <span class="kr">repeat</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">until</span> <span class="err">умова</span> <span class="kr">for</span> <span class="n">i</span> <span class="o">=</span> <span class="n">first</span><span class="p">,</span> <span class="n">last</span><span class="p">,</span> <span class="n">delta</span> <span class="kr">do</span> <span class="c1">-- delta можа быць адмоўнай, дазваляючы цыклу лічыць у зваротны бок</span> <span class="c1">-- сцьвярджэньне</span> <span class="kr">end</span> </pre></div> <p>Гэты <code>for</code> будзе перабіраць табліцу <code>_G</code> з выкарыстаньнем стандартнай функцыі ітэратараў <code>pairs</code> пакуль не верне <code>nil</code>: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="kr">in</span> <span class="nb">pairs</span><span class="p">(</span><span class="nb">_G</span><span class="p">)</span> <span class="kr">do</span> <span class="nb">print</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="kr">end</span> </pre></div> <p>Цыклі таксама могуць быць укладзенымі (змяшчацца ўнутры іншага цыкля). </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">local</span> <span class="n">grid</span> <span class="o">=</span> <span class="p">{</span> <span class="p">{</span> <span class="mi">11</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">13</span> <span class="p">},</span> <span class="p">{</span> <span class="mi">21</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">23</span> <span class="p">},</span> <span class="p">{</span> <span class="mi">31</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">33</span> <span class="p">}</span> <span class="p">}</span> <span class="kr">for</span> <span class="n">y</span><span class="p">,</span> <span class="n">row</span> <span class="kr">in</span> <span class="nb">pairs</span><span class="p">(</span><span class="n">grid</span><span class="p">)</span> <span class="kr">do</span> <span class="kr">for</span> <span class="n">x</span><span class="p">,</span> <span class="n">value</span> <span class="kr">in</span> <span class="nb">pairs</span><span class="p">(</span><span class="n">row</span><span class="p">)</span> <span class="kr">do</span> <span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="kr">end</span> <span class="kr">end</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Функцыі"><span id=".D0.A4.D1.83.D0.BD.D0.BA.D1.86.D1.8B.D1.96"></span>Функцыі</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=5" title="Рэдагаваць сэкцыю «Функцыі»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=5" title="Правіць зыходнік раздзела: Функцыі"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Абыходжаньне з функцыяй як сутнасьцю <a href="/w/index.php?title=%D0%9F%D0%B5%D1%80%D1%88%D0%B0%D0%BA%D0%BB%D1%8F%D1%81%D0%BD%D0%B0%D1%8F_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Першаклясная функцыя (старонка не існуе)">першае клясы</a> паказана ў наступным прыкладзе, дзе паводзіны функцыі <code>print</code> змененыя: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">do</span> <span class="c1">-- захоўваем функцыю print як oldprint</span> <span class="kd">local</span> <span class="n">oldprint</span> <span class="o">=</span> <span class="nb">print</span> <span class="kr">function</span> <span class="nf">print</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="c1">-- перанакіроўваем выклік print</span> <span class="n">oldprint</span><span class="p">(</span><span class="n">s</span> <span class="o">==</span> <span class="s2">&quot;foo&quot;</span> <span class="ow">and</span> <span class="s2">&quot;bar&quot;</span> <span class="ow">or</span> <span class="n">s</span><span class="p">)</span> <span class="kr">end</span> <span class="kr">end</span> </pre></div> <p>Любыя будучыя выклікі <code>print</code> цяпер будуць накіроўвацца праз новую функцыю, з-за <a href="/w/index.php?title=%D0%90%D0%B1%D1%81%D1%8F%D0%B3_%D0%BF%D1%80%D1%8B%D0%B2%D1%8F%D0%B7%D0%BA%D1%96_%D1%96%D0%BC%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Абсяг прывязкі імя (старонка не існуе)">лексычнага абсягу</a> Lua старая функцыя <code>print</code> будзе даступная толькі цераз новаю зьмененую <code>print</code>. </p><p>Lua таксама падтрымлівае <a href="/w/index.php?title=%D0%97%D0%B0%D0%BC%D1%8B%D0%BA%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5_(%D1%96%D0%BD%D1%84%D0%B0%D1%80%D0%BC%D0%B0%D1%82%D1%8B%D0%BA%D0%B0)&amp;action=edit&amp;redlink=1" class="new" title="Замыканьне (інфарматыка) (старонка не існуе)">замыканьні</a>, як паказана ніжэй: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kr">function</span> <span class="nf">addto</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1">-- вяртаем новую функцыю, якая дадае x да аргумента</span> <span class="kr">return</span> <span class="kr">function</span><span class="p">(</span><span class="n">y</span><span class="p">)</span> <span class="cm">--[[ Калі мы зьвяртаемся да зьменнай x па-за межамі яе абсягу, </span> <span class="cm"> Lua робіць замыканьне. ]]</span> <span class="kr">return</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span> <span class="kr">end</span> <span class="kr">end</span> <span class="n">fourplus</span> <span class="o">=</span> <span class="n">addto</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="nb">print</span><span class="p">(</span><span class="n">fourplus</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>&#160;<span class="err">—</span> <span class="err">друкуе</span> <span class="mi">7</span> </pre></div> <p>Новае замыканьне для зменнай <code>x</code> ствараецца кожны раз, калі выклікаецца <code>addto</code>, так што кожная новая вернутая ананімная функцыя будзе заўсёды мець доступ да ўласнага параметра <code>x</code>. </p> <div class="mw-heading mw-heading3"><h3 id="Табліцы"><span id=".D0.A2.D0.B0.D0.B1.D0.BB.D1.96.D1.86.D1.8B"></span>Табліцы</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=6" title="Рэдагаваць сэкцыю «Табліцы»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=6" title="Правіць зыходнік раздзела: Табліцы"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Табліца&#160;— адзіны убудаваны <a href="/w/index.php?title=%D0%A1%D0%BA%D0%BB%D0%B0%D0%B4%D0%B0%D0%BD%D1%8B_%D1%82%D1%8B%D0%BF_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85&amp;action=edit&amp;redlink=1" class="new" title="Складаны тып даных (старонка не існуе)">складаны тып даных</a> у Lua, аснова усіх тыпаў, ствараемых карыстальнікамі. Яна ўяўляе сабой асацыятыўны масіў з наданьнем аўтаматычнага лічбавага ключа і спецыяльнага сынтаксу. </p><p>Табліцы ствараюцца з дапамогай сынтаксу канструктара <code>{}</code>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">a_table</span> <span class="o">=</span> <span class="p">{}</span>&#160;<span class="err">—</span> <span class="err">новая</span> <span class="err">пустая</span> <span class="err">табліца</span> </pre></div> <p>Табліцы заўсёды перадаюцца па спасылцы. </p><p>Ключ (індэкс) можа быць любым значэньнем, нават функцыяй, але не <code>nil</code> і не <a href="/w/index.php?title=NaN&amp;action=edit&amp;redlink=1" class="new" title="NaN (старонка не існуе)">NaN</a>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="err">—</span> <span class="err">новая</span> <span class="err">табліца</span> <span class="err">з</span> <span class="err">адным</span> <span class="err">значэньнем</span> <span class="mi">10</span> <span class="err">па</span> <span class="err">ключу</span> <span class="err">«</span><span class="n">x</span><span class="err">»</span> <span class="n">a_table</span> <span class="o">=</span> <span class="p">{</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">10</span> <span class="p">}</span> <span class="err">—</span> <span class="err">друкуе</span> <span class="err">значэньне</span> <span class="err">па</span> <span class="err">ключу</span> <span class="err">«</span><span class="n">x</span><span class="err">»</span><span class="p">,</span> <span class="err">у</span> <span class="err">гэтым</span> <span class="err">выпадку</span> <span class="mi">10</span> <span class="nb">print</span><span class="p">(</span><span class="n">a_table</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">])</span> <span class="n">b_table</span> <span class="o">=</span> <span class="n">a_table</span> <span class="err">—</span> <span class="err">значэньне</span> <span class="err">у</span> <span class="err">табліцы</span> <span class="err">зьменена</span> <span class="err">на</span> <span class="mi">20</span> <span class="n">b_table</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">20</span> <span class="err">—</span> <span class="err">друкуе</span> <span class="mi">20</span> <span class="nb">print</span><span class="p">(</span><span class="n">b_table</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">])</span> <span class="err">—</span> <span class="err">таксама</span> <span class="err">друкуе</span> <span class="mi">20</span><span class="p">,</span> <span class="err">таму</span> <span class="err">што</span> <span class="n">a_table</span> <span class="err">і</span> <span class="n">b_table</span> <span class="err">спасылаюцца</span> <span class="err">на</span> <span class="err">тую</span> <span class="err">самую</span> <span class="err">табліцу</span> <span class="nb">print</span><span class="p">(</span><span class="n">a_table</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">])</span> </pre></div> <p>Табліца часта ўжываецца як структура (або <a href="/w/index.php?title=%D0%97%D0%B0%D0%BF%D1%96%D1%81_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Запіс (структура даных) (старонка не існуе)">запіс</a>), выкарыстоўваючы <a href="/w/index.php?title=%D0%A0%D0%B0%D0%B4%D0%BE%D0%BA_(%D1%82%D1%8B%D0%BF_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Радок (тып даных) (старонка не існуе)">радкі</a> ў якасці ключоў. Паколькі такое выкарыстанне вельмі распаўсюджана, Lua мае спецыяльны сынтакс для доступу да такіх палёў.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">&#91;</span>9<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">point</span> <span class="o">=</span> <span class="p">{</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="mi">20</span> <span class="p">}</span>&#160;<span class="err">—</span> <span class="err">новая</span> <span class="err">табліца</span> <span class="nb">print</span><span class="p">(</span><span class="n">point</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">])</span>&#160;<span class="err">—</span> <span class="err">друкуе</span> <span class="mi">10</span> <span class="err">—</span> <span class="err">Тое</span> <span class="err">самае</span> <span class="err">што</span> <span class="err">і</span> <span class="err">радок</span> <span class="err">вышэй</span><span class="p">.</span> <span class="err">Кропкавая</span> <span class="err">натацыя</span> <span class="err">карацейшая</span> <span class="err">і</span> <span class="err">больш</span> <span class="err">простая</span> <span class="err">для</span> <span class="err">ўспрыманьня</span><span class="p">.</span> <span class="nb">print</span><span class="p">(</span><span class="n">point</span><span class="p">.</span><span class="n">x</span><span class="p">)</span> </pre></div> <p>Табліца можа падысьці у якасьці <a href="/w/index.php?title=%D0%9F%D1%80%D0%B0%D1%81%D1%82%D0%BE%D1%80%D0%B0_%D1%96%D0%BC%D1%91%D0%BD%D0%B0%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Прастора імёнаў (старонка не існуе)">прасторы імёнаў</a>, калі захоўваць у ёй функцыі. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">Point</span> <span class="o">=</span> <span class="p">{}</span> <span class="n">Point</span><span class="p">.</span><span class="n">new</span> <span class="o">=</span> <span class="kr">function</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="c1">-- вяртае { [&quot;x&quot;] = x, [&quot;y&quot;] = y }</span> <span class="kr">return</span> <span class="p">{</span><span class="n">x</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">y</span><span class="p">}</span> <span class="kr">end</span> <span class="n">Point</span><span class="p">.</span><span class="n">set_x</span> <span class="o">=</span> <span class="kr">function</span><span class="p">(</span><span class="n">point</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span> <span class="c1">-- point[&quot;x&quot;] = x</span> <span class="n">point</span><span class="p">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="kr">end</span> </pre></div> <p>Элементам табліцы аўтаматычна надаюцца лічбавыя ключы, што дазваляе выкарыстоўваць табліцы як <a href="/w/index.php?title=%D0%9C%D0%B0%D1%81%D1%96%D1%9E_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D1%8B%D1%85)&amp;action=edit&amp;redlink=1" class="new" title="Масіў (структура даных) (старонка не існуе)">масівы</a>. Першы аўтаматычны індэкс роўны 1, а не 0, як у многіх іншых мовах праграмавання (але яўны індэкс 0 магчымы). </p><p>Лічбавы ключ <code>1</code> не тое самае што радковы ключ <code>"1"</code>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="err">—</span> <span class="err">індэксы</span> <span class="err">задаюцца</span> <span class="err">аўтаматычна</span> <span class="n">array</span> <span class="o">=</span> <span class="p">{</span> <span class="err">«</span><span class="n">a</span><span class="err">»</span><span class="p">,</span> <span class="err">«</span><span class="n">b</span><span class="err">»</span><span class="p">,</span> <span class="err">«</span><span class="n">c</span><span class="err">»</span><span class="p">,</span> <span class="err">«</span><span class="n">d</span><span class="err">»</span> <span class="p">}</span> <span class="err">—</span> <span class="err">Друкуе</span> <span class="err">«</span><span class="n">b</span><span class="err">»</span><span class="p">.</span> <span class="err">Аўтаматычныя</span> <span class="err">індэксы</span> <span class="err">ў</span> <span class="n">Lua</span> <span class="err">пачынаюцца</span> <span class="err">з</span> <span class="mf">1.</span> <span class="nb">print</span><span class="p">(</span><span class="n">array</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span> <span class="err">—</span> <span class="err">Друкуе</span> <span class="mf">4.</span> <span class="o">#</span>&#160;<span class="err">—</span> <span class="err">апэратар</span> <span class="err">памеру</span> <span class="err">для</span> <span class="err">табліц</span> <span class="err">і</span> <span class="err">радкоў</span><span class="p">.</span> <span class="nb">print</span><span class="p">(</span><span class="o">#</span><span class="n">array</span><span class="p">)</span> <span class="err">—</span> <span class="err">нуль</span>&#160;<span class="err">—</span> <span class="err">дазволены</span> <span class="err">індэкс</span> <span class="n">array</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="err">«</span><span class="n">z</span><span class="err">»</span> <span class="err">—</span> <span class="err">Усё</span> <span class="err">яшчэ</span> <span class="err">друкуе</span> <span class="mi">4</span><span class="p">,</span> <span class="err">так</span> <span class="err">як</span> <span class="err">масівы</span> <span class="n">Lua</span> <span class="err">індэксуюцца</span> <span class="err">з</span> <span class="mf">1.</span> <span class="nb">print</span><span class="p">(</span><span class="o">#</span><span class="n">array</span><span class="p">)</span> </pre></div> <p>Памер табліцы <code>t</code> вызначаецца як любы цэлы індэкс <code>n</code> такі што <code>t[n]</code> не <code>nil</code> і <code>t[n+1]</code> роўны <code>nil</code>; акрамя таго, калі <code>t[1]</code> <code>nil</code>, <code>n</code> можа быць роўным нулю. Для рэгулярнага масіва зь ненулявымі значэньнямі ад 1 да дадзенага <code>n</code> яго памер дакладна роўны <code>n</code>, індэксу яго апошняга значэння. Калі масіў мае «дзіркі» (нулявыя значэнні паміж іншымі значэннямі, выдатнымі ад нуля), то <code>#t</code> можа быць любым з індэксаў, які непасрэдна папярэднічае <code>nil</code> значэнню (гэта значыць, ён можа разглядаць любое такое нулявое значэнне як канец масіва).<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">&#91;</span>10<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">ExampleTable</span> <span class="o">=</span> <span class="p">{</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">},</span> <span class="p">{</span><span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">}</span> <span class="p">}</span> <span class="nb">print</span><span class="p">(</span><span class="n">ExampleTable</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">3</span><span class="p">])</span>&#160;<span class="err">—</span> <span class="err">друкуе</span> <span class="err">«</span><span class="mi">3</span><span class="err">»</span> <span class="nb">print</span><span class="p">(</span><span class="n">ExampleTable</span><span class="p">[</span><span class="mi">2</span><span class="p">][</span><span class="mi">4</span><span class="p">])</span>&#160;<span class="err">—</span> <span class="err">друкуе</span> <span class="err">«</span><span class="mi">8</span><span class="err">»</span> </pre></div> <p>Табліца можа быць масівам аб’ектаў. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="err">—</span> <span class="err">канструктар</span> <span class="n">Point</span> <span class="kr">function</span> <span class="nf">Point</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="c1">-- вяртаецца новы аб&#39;ект</span> <span class="kr">return</span> <span class="p">{</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">y</span> <span class="p">}</span> <span class="kr">end</span> <span class="err">—</span> <span class="err">ствараецца</span> <span class="err">масіў</span> <span class="err">кропак</span> <span class="n">array</span> <span class="o">=</span> <span class="p">{</span> <span class="n">Point</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">),</span> <span class="n">Point</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="mi">40</span><span class="p">),</span> <span class="n">Point</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span> <span class="mi">60</span><span class="p">)</span> <span class="p">}</span> <span class="err">—</span> <span class="err">друкуе</span> <span class="mi">40</span> <span class="nb">print</span><span class="p">(</span><span class="n">array</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="n">y</span><span class="p">)</span> </pre></div> <p>Выкарыстаньне хэш-табліцы для эмуляцыі масіва звычайна павольней, чым выкарыстаньне фактычнага масіва; аднак табліцы Lua аптымізаваны для выкарыстаньня ў якасці масіваў, каб пазбегнуць гэтай праблемы.<sup id="cite_ref-lobject_h_array_11-0" class="reference"><a href="#cite_note-lobject_h_array-11"><span class="cite-bracket">&#91;</span>11<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading3"><h3 id="Мэтатабліцы"><span id=".D0.9C.D1.8D.D1.82.D0.B0.D1.82.D0.B0.D0.B1.D0.BB.D1.96.D1.86.D1.8B"></span>Мэтатабліцы</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=7" title="Рэдагаваць сэкцыю «Мэтатабліцы»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=7" title="Правіць зыходнік раздзела: Мэтатабліцы"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Пашыраемая сэмантыка з’яўляецца ключавой асаблівасцю Lua, а канцэпцыя мэтатабліцы дазваляе гібкую наладу табліц. У наступным прыкладзе дэманструецца «бясконцая» табліца. Для любога <code>n</code> <code>fibs[n]</code> дасць <code>n</code>-ы <a href="/w/index.php?title=%D0%9B%D1%96%D0%BA_%D0%A4%D1%96%D0%B1%D0%B0%D0%BD%D0%B0%D1%87%D1%8B&amp;action=edit&amp;redlink=1" class="new" title="Лік Фібаначы (старонка не існуе)">лік Фібаначы</a> з дапамогай <a href="/w/index.php?title=%D0%94%D1%8B%D0%BD%D0%B0%D0%BC%D1%96%D1%87%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Дынамічнае праграмаваньне (старонка не існуе)">дынамічнага праграмаваньня</a> і <a href="/w/index.php?title=%D0%9C%D1%8D%D0%BC%D0%B0%D1%96%D0%B7%D0%B0%D1%86%D1%8B%D1%8F&amp;action=edit&amp;redlink=1" class="new" title="Мэмаізацыя (старонка не існуе)">мэмаізацыі</a>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="err">—</span> <span class="err">пачатковыя</span> <span class="err">значэньні</span> <span class="n">fibs</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="err">і</span> <span class="n">fibs</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span> <span class="n">fibs</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span> <span class="p">}</span> <span class="nb">setmetatable</span><span class="p">(</span><span class="n">fibs</span><span class="p">,</span> <span class="p">{</span> <span class="c1">-- __index - спецыяльная функцыя Lua, якая выклікаецца калі табліца не мае пазначанага ключа</span> <span class="n">__index</span> <span class="o">=</span> <span class="kr">function</span><span class="p">(</span><span class="n">values</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span> <span class="c1">-- вылічаем і запамінаем fibs[n]</span> <span class="n">values</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="o">=</span> <span class="n">values</span><span class="p">[</span><span class="n">n</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">values</span><span class="p">[</span><span class="n">n</span> <span class="o">-</span> <span class="mi">2</span><span class="p">]</span> <span class="kr">return</span> <span class="n">values</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="kr">end</span> <span class="p">})</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Аб’ектна-арыентаванае_праграмаванне"><span id=".D0.90.D0.B1.E2.80.99.D0.B5.D0.BA.D1.82.D0.BD.D0.B0-.D0.B0.D1.80.D1.8B.D0.B5.D0.BD.D1.82.D0.B0.D0.B2.D0.B0.D0.BD.D0.B0.D0.B5_.D0.BF.D1.80.D0.B0.D0.B3.D1.80.D0.B0.D0.BC.D0.B0.D0.B2.D0.B0.D0.BD.D0.BD.D0.B5"></span>Аб’ектна-арыентаванае праграмаванне</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=8" title="Рэдагаваць сэкцыю «Аб’ектна-арыентаванае праграмаванне»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=8" title="Правіць зыходнік раздзела: Аб’ектна-арыентаванае праграмаванне"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Нягледзячы на тое, што Lua не мае ўбудаванай канцэпцыі <a href="/wiki/%D0%9A%D0%BB%D1%8F%D1%81%D0%B0_(%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)" title="Кляса (праграмаваньне)">клясаў</a>, <a href="/wiki/%D0%90%D0%B1%E2%80%99%D0%B5%D0%BA%D1%82%D0%BD%D0%B0-%D0%B0%D1%80%D1%8B%D0%B5%D0%BD%D1%82%D0%B0%D0%B2%D0%B0%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5" title="Аб’ектна-арыентаванае праграмаваньне">аб’ектна-арыентаванае праграмаванне</a> можа эмулявацца з дапамогай функцый і табліц. Аб’ект фармуецца шляхам размяшчэння мэтадаў і палёў у табліцы. <a href="/w/index.php?title=%D0%A1%D0%BF%D0%B0%D0%B4%D0%BA%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5_(%D0%B0%D0%B1%27%D0%B5%D0%BA%D1%82%D0%BD%D0%B0-%D0%B0%D1%80%D1%8B%D0%B5%D0%BD%D1%82%D0%B0%D0%B2%D0%B0%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5)&amp;action=edit&amp;redlink=1" class="new" title="Спадкаваньне (аб&#39;ектна-арыентаванае праграмаваньне) (старонка не існуе)">Спадкаваньне</a> (як адзінкавае, так і множнае) можа быць рэалізавана з дапамогай мэтатабліц, дэлегуючы неіснуючыя мэтады і палі бацькоўскаму аб’екту. </p><p>У гэтым выпадку такога паняцця як «кляса» не існуе; хутчэй, гэта падобна да <a href="/w/index.php?title=%D0%9F%D1%80%D0%B0%D1%82%D0%B0%D1%82%D1%8B%D0%BF%D0%BD%D0%B0%D0%B5_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5&amp;action=edit&amp;redlink=1" class="new" title="Прататыпнае праграмаваньне (старонка не існуе)">прататыпнага спадкаваньня</a>, як у <a href="/w/index.php?title=Self&amp;action=edit&amp;redlink=1" class="new" title="Self (старонка не існуе)">Self</a> або <a href="/wiki/JavaScript" title="JavaScript">JavaScript</a>. Новыя аб’екты ствараюцца альбо <a href="/w/index.php?title=%D0%A4%D0%B0%D0%B1%D1%80%D1%8B%D1%87%D0%BD%D1%8B_%D0%BC%D1%8D%D1%82%D0%B0%D0%B4&amp;action=edit&amp;redlink=1" class="new" title="Фабрычны мэтад (старонка не існуе)">фабрычным мэтадам</a> (які стварае новыя аб’екты з нуля), альбо шляхам кланаваньня існуючага аб’екта. </p><p>Стварэнне простага аб’екта, які апісвае <a href="/wiki/%D0%92%D1%8D%D0%BA%D1%82%D0%B0%D1%80" title="Вэктар">вэктар</a>: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">local</span> <span class="n">Vector</span> <span class="o">=</span> <span class="p">{}</span> <span class="kd">local</span> <span class="n">VectorMeta</span> <span class="o">=</span> <span class="p">{</span> <span class="n">__index</span> <span class="o">=</span> <span class="n">Vector</span> <span class="p">}</span> <span class="err">—</span> <span class="err">Канструктар</span> <span class="err">клясы</span> <span class="n">Vector</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="kr">return</span> <span class="nb">setmetatable</span><span class="p">({</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">z</span> <span class="p">},</span> <span class="n">VectorMeta</span><span class="p">)</span> <span class="kr">end</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">.</span><span class="nf">magnitude</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="kr">return</span> <span class="nb">math.sqrt</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">x</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">y</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">z</span><span class="o">^</span><span class="mi">2</span><span class="p">)</span> <span class="kr">end</span> <span class="err">—</span> <span class="err">стварэньне</span> <span class="err">новага</span> <span class="err">вэктара</span> <span class="kd">local</span> <span class="n">vec</span> <span class="o">=</span> <span class="n">Vector</span><span class="p">.</span><span class="n">new</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="err">—</span> <span class="err">выклік</span> <span class="err">мэтада</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">.</span><span class="n">magnitude</span><span class="p">(</span><span class="n">vec</span><span class="p">))</span> <span class="err">—</span> <span class="err">доступ</span> <span class="err">да</span> <span class="err">поля</span> <span class="n">x</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">.</span><span class="n">x</span><span class="p">)</span> </pre></div> <p>Тут <code>setmetatable</code> загадвае Lua шукаць элемент у табліцы <code>Vector</code>, калі ён адсутнічае ў табліцы <code>vec</code>. <code>vec.magnitude</code>, тое самае што і <code>vec["magnitude"]</code>, спачатку шукае элемент <code>magnitude</code> у табліцы <code>vec</code>. Табліца <code>vec</code> не мае элемента <code>magnitude</code>, але яе мэтатабліца дэлегуе элемент <code>magnitude</code> ў табліцу <code>Vector</code>, калі ён не знойдзены ў табліцы <code>vec</code>. </p><p>Lua мае некаторы <a href="/w/index.php?title=%D0%A1%D1%8B%D0%BD%D1%82%D0%B0%D0%BA%D1%81%D1%8B%D1%87%D0%BD%D1%8B_%D1%86%D1%83%D0%BA%D0%B0%D1%80&amp;action=edit&amp;redlink=1" class="new" title="Сынтаксычны цукар (старонка не існуе)">сынтаксычны цукар</a> для палягчэньня апісаньня клясы. Каб аб’явіць функцыі-члены ўнутры табліцы-прататыпа, можна выкарыстоўваць <code>function table:func(args)</code>, што эквівалентнае <code>function table.func(self, args)</code>. Для выкліку мэтадаў клясы таксама можа выкарыстоўваць двукроп’е: <code>object:func(args)</code>, тое самае <code>object.func(object, args)</code>. </p><p>Улічваючы гэта, вось адпаведны клас з <code>:</code> сынтаксычным цукрам: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">local</span> <span class="n">Vector</span> <span class="o">=</span> <span class="p">{}</span> <span class="n">Vector</span><span class="p">.</span><span class="n">__index</span> <span class="o">=</span> <span class="n">Vector</span> <span class="err">—</span> <span class="err">Канструктар</span> <span class="err">клясы</span> <span class="n">Vector</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">:</span><span class="nf">new</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="cm">--[[ Так як мэтад створаны пры дапамозе двукроп&#39;я, </span> <span class="cm"> &quot;self&quot; няяўна перадаецца як першы аргумэнт. ]]</span> <span class="kr">return</span> <span class="nb">setmetatable</span><span class="p">({</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">z</span> <span class="p">},</span> <span class="n">self</span><span class="p">)</span> <span class="kr">end</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">:</span><span class="nf">magnitude</span><span class="p">()</span> <span class="kr">return</span> <span class="nb">math.sqrt</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">x</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">y</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">z</span><span class="o">^</span><span class="mi">2</span><span class="p">)</span> <span class="kr">end</span> <span class="err">—</span> <span class="err">новы</span> <span class="err">вэктар</span> <span class="kd">local</span> <span class="n">vec</span> <span class="o">=</span> <span class="n">Vector</span><span class="p">:</span><span class="n">new</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="err">—</span> <span class="err">выклік</span> <span class="err">мэтада</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">:</span><span class="n">magnitude</span><span class="p">())</span> <span class="err">—</span> <span class="err">доступ</span> <span class="err">да</span> <span class="err">поля</span> <span class="err">«</span><span class="n">x</span><span class="err">»</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">.</span><span class="n">x</span><span class="p">)</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Спадкаваньне"><span id=".D0.A1.D0.BF.D0.B0.D0.B4.D0.BA.D0.B0.D0.B2.D0.B0.D0.BD.D1.8C.D0.BD.D0.B5"></span>Спадкаваньне</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=9" title="Рэдагаваць сэкцыю «Спадкаваньне»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=9" title="Правіць зыходнік раздзела: Спадкаваньне"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Спадкаваньне у Lua таксама магчыма з дапамогай мэтатабліц.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">&#91;</span>12<span class="cite-bracket">&#93;</span></a></sup> У наступным прыкладзе апэрацыя памнажэньня вэктара на канстанту рэалізаваная ў вытворнай клясе. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">local</span> <span class="n">Vector</span> <span class="o">=</span> <span class="p">{}</span> <span class="n">Vector</span><span class="p">.</span><span class="n">__index</span> <span class="o">=</span> <span class="n">Vector</span> <span class="c1">--- канструктар клясы Vector</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">:</span><span class="nf">new</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="cm">--[[ Тут self спасылаецца на тую клясу, мэтад якой выклікаецца. </span> <span class="cm"> У вытворнай клясе self будзе гэтай самай вытворнай клясай,</span> <span class="cm"> у клясе Vector self будзе Vector. ]]</span> <span class="kr">return</span> <span class="nb">setmetatable</span><span class="p">({</span> <span class="n">x</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">z</span> <span class="p">},</span> <span class="n">self</span><span class="p">)</span> <span class="kr">end</span> <span class="kr">function</span> <span class="nc">Vector</span><span class="p">:</span><span class="nf">magnitude</span><span class="p">()</span> <span class="kr">return</span> <span class="nb">math.sqrt</span><span class="p">(</span><span class="n">self</span><span class="p">.</span><span class="n">x</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">y</span><span class="o">^</span><span class="mi">2</span> <span class="o">+</span> <span class="n">self</span><span class="p">.</span><span class="n">z</span><span class="o">^</span><span class="mi">2</span><span class="p">)</span> <span class="kr">end</span> <span class="kd">local</span> <span class="n">VectorMult</span> <span class="o">=</span> <span class="p">{}</span> <span class="n">VectorMult</span><span class="p">.</span><span class="n">__index</span> <span class="o">=</span> <span class="n">VectorMult</span> <span class="err">—</span> <span class="err">пазначаем</span> <span class="n">VectorMult</span> <span class="err">нашчадкам</span> <span class="err">клясы</span> <span class="n">Vector</span> <span class="nb">setmetatable</span><span class="p">(</span><span class="n">VectorMult</span><span class="p">,</span> <span class="n">Vector</span><span class="p">)</span> <span class="kr">function</span> <span class="nc">VectorMult</span><span class="p">:</span><span class="nf">multiply</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="n">self</span><span class="p">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">x</span> <span class="o">*</span> <span class="n">value</span> <span class="n">self</span><span class="p">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">y</span> <span class="o">*</span> <span class="n">value</span> <span class="n">self</span><span class="p">.</span><span class="n">z</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">z</span> <span class="o">*</span> <span class="n">value</span> <span class="kr">return</span> <span class="n">self</span> <span class="kr">end</span> <span class="err">—</span> <span class="err">ствараем</span> <span class="err">новы</span> <span class="err">вэктар</span> <span class="kd">local</span> <span class="n">vec</span> <span class="o">=</span> <span class="n">VectorMult</span><span class="p">:</span><span class="n">new</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="err">—</span> <span class="err">выклікаем</span> <span class="err">мэтад</span><span class="p">,</span> <span class="err">друкуе</span> <span class="mi">1</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">:</span><span class="n">magnitude</span><span class="p">())</span> <span class="err">—</span> <span class="err">звяртаемся</span> <span class="err">да</span> <span class="err">поля</span> <span class="n">y</span><span class="p">,</span> <span class="err">друкуе</span> <span class="mi">1</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">.</span><span class="n">y</span><span class="p">)</span> <span class="err">—</span> <span class="err">памнажаем</span> <span class="err">усе</span> <span class="err">складаныя</span> <span class="err">вэктару</span> <span class="err">на</span> <span class="mi">2</span> <span class="n">vec</span><span class="p">:</span><span class="n">multiply</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="err">—</span> <span class="err">зноў</span> <span class="err">звяртаемся</span> <span class="err">да</span> <span class="err">поля</span> <span class="n">y</span><span class="p">,</span> <span class="err">атрымоўваем</span> <span class="mi">2</span> <span class="nb">print</span><span class="p">(</span><span class="n">vec</span><span class="p">.</span><span class="n">y</span><span class="p">)</span> </pre></div> <p>Lua таксама падтрымлівае <a href="/wiki/%D0%9C%D0%BD%D0%BE%D0%B6%D0%BD%D0%B0%D0%B5_%D1%81%D0%BF%D0%B0%D0%B4%D0%BA%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D0%B5" title="Множнае спадкаваньне">множнае спадкаваньне</a>; <code>__index</code> можа быць функцыяй або табліцай.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">&#91;</span>13<span class="cite-bracket">&#93;</span></a></sup> <a href="/w/index.php?title=%D0%9F%D0%B5%D1%80%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0_%D0%B0%D0%BF%D1%8D%D1%80%D0%B0%D1%82%D0%B0%D1%80%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Перагрузка апэратара (старонка не існуе)">Перагрузка апэратара</a> таксама можа быць зроблена; мэтатабліцы Lua могуць мець такія элементы, як <code>__add</code>, <code>__sub</code> і гэтак далей.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">&#91;</span>14<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Рэалізацыя"><span id=".D0.A0.D1.8D.D0.B0.D0.BB.D1.96.D0.B7.D0.B0.D1.86.D1.8B.D1.8F"></span>Рэалізацыя</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=10" title="Рэдагаваць сэкцыю «Рэалізацыя»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=10" title="Правіць зыходнік раздзела: Рэалізацыя"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Праграма на Lua не <a href="/w/index.php?title=%D0%86%D0%BD%D1%82%D1%8D%D1%80%D0%BF%D1%80%D1%8D%D1%82%D1%83%D0%B5%D0%BC%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Інтэрпрэтуемая мова (старонка не існуе)">інтэрпрэтуецца</a> непасрэдна з тэкставага файла, а <a href="/wiki/%D0%9A%D0%B0%D0%BC%D0%BF%D1%96%D0%BB%D1%8F%D1%82%D0%B0%D1%80" title="Кампілятар">кампілююцца</a> ў байт-код, які потым запускаецца на <a href="/w/index.php?title=%D0%92%D1%96%D1%80%D1%82%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Віртуальная машына (старонка не існуе)">віртуальнай машыне</a> Lua. Увесь працэс звычайна нябачны для карыстальніка і выконваецца падчас працы. Кампіляцыя можа быць выкананы загадзя, каб паскорыць загрузку або, прыбраўшы кампілятар, паменшыць аб’ём памяці хост-асяродьдзя. Кампіляцыя магчыма таксама ўнутры праграмы на Lua з выкарыстаньнем функцыі <code>dump</code> з бібліятэкі радкоў альбо адной з функцый <code>load/loadstring/loadfile</code>.<sup id="cite_ref-luaspe_2-1" class="reference"><a href="#cite_note-luaspe-2"><span class="cite-bracket">&#91;</span>2<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-luaabout_3-2" class="reference"><a href="#cite_note-luaabout-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup> </p><p>У адрозненьне ад большасьці віртуальных машын (якія звычайна <a href="/w/index.php?title=%D0%A1%D1%82%D1%8D%D0%BA%D0%B0%D0%B2%D1%8B%D1%8F_%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Стэкавыя машына (старонка не існуе)">стэкавыя</a>), віртуальная машына Lua <a href="/w/index.php?title=%D0%A0%D1%8D%D0%B3%D1%96%D1%81%D1%82%D1%80%D0%B0%D0%B2%D0%B0%D1%8F_%D0%BC%D0%B0%D1%88%D1%8B%D0%BD%D0%B0&amp;action=edit&amp;redlink=1" class="new" title="Рэгістравая машына (старонка не існуе)">рэгістравая</a> і больш нагадвае рэальную апаратную канструкцыю. Рэгістравая архітэктура пазбягае празмернага капіравання значэнняў і памяншае агульную колькасць інструкцый на функцыю. Віртуальная машына Lua 5 з’яўляецца адной з першых чыста рэгістравых віртуальных машын, якія атрымалі шырокае прымяненьне.<sup id="cite_ref-lua5impl_15-0" class="reference"><a href="#cite_note-lua5impl-15"><span class="cite-bracket">&#91;</span>15<span class="cite-bracket">&#93;</span></a></sup> </p><p>Наступны прыклад&#160;— гэта байт-код функцыі фактарыялу, рэалізаванай <a href="#Прыклад_факторыял">вышэй</a> (згодна з кампілятарам <code>luac</code> 5.1):<sup id="cite_ref-luavm51instr_16-0" class="reference"><a href="#cite_note-luavm51instr-16"><span class="cite-bracket">&#91;</span>16<span class="cite-bracket">&#93;</span></a></sup> </p> <pre>function &lt;factorial.lua:1,7&gt; (9 instructions, 36 bytes at 0x8063c60) 1 param, 6 slots, 0 upvalues, 6 locals, 2 constants, 0 functions 1 [2] LOADK 1 -1 ; 1 2 [3] LOADK 2 -2 ; 2 3 [3] MOVE 3 0 4 [3] LOADK 4 -1 ; 1 5 [3] FORPREP 2 1 &#160;; to 7 6 [4] MUL 1 1 5 7 [3] FORLOOP 2 -2 ; to 6 8 [6] RETURN 1 2 9 [7] RETURN 0 1 </pre> <div class="mw-heading mw-heading2"><h2 id="C_API">C API</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=11" title="Рэдагаваць сэкцыю «C API»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=11" title="Правіць зыходнік раздзела: C API"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Lua была распрацавана з мэтай убудаваньня ў іншыя праграмы, дзеля гэтага яна распаўсюджваецца разам з <a href="/wiki/C_(%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F)" title="C (мова праграмаваньня)">C</a> <a href="/w/index.php?title=API&amp;action=edit&amp;redlink=1" class="new" title="API (старонка не існуе)">API</a>. Які складаецца з дзвюх частак: ядро Lua і дапаможнай бібліятэкі Lua.<sup id="cite_ref-luarefman_17-0" class="reference"><a href="#cite_note-luarefman-17"><span class="cite-bracket">&#91;</span>17<span class="cite-bracket">&#93;</span></a></sup> Апошняя складаецца ў асноўным з макрасаў прэпрацэсара, якія дапамагаюць са складанымі таблічнымі апэрацыямі. </p><p>Lua C API заснаваны на <a href="/wiki/%D0%A1%D1%82%D1%8D%D0%BA" title="Стэк">стэку</a>. Lua забяспечвае функцыі для праштурхоўваньня і выцягваньня большасьці простых тыпаў даных C (цэлыя лікі, плывучыя і&#160;г.&#160;д.) у стэк і са стэку, а таксама функцыі для маніпуляваньня табліцамі праз стэк. Стэк Lua некалькі адрозніваецца ад традыцыйнага; напрыклад, яго можна непасрэдна праіндэксаваць. Адмоўныя індэксы паказваюць зрушэнні ад вяршыні стэка. Напрыклад, −1 з’яўляецца верхнім (апошняе значэньне), у той час як дадатныя індэксы паказваюць зрушэньні ад ніжняга (самае старое значэньне). Маршалінг даных паміж функцыямі C і Lua таксама выконваецца з дапамогай стэка. Каб выклікаць функцыю Lua, аргументы зьмяшчаюцца ў стэк, а затым <code>lua_call</code> выкарыстоўваецца для выкліку Lua функцыі. Пры напісаньні функцыі C для непасрэднага выкліку з Lua аргументы счытваюцца са стэку. </p><p>Вось прыклад выкліку функцыі Lua з C: </p> <div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">#</span><span class="w"> </span><span class="cp">include</span><span class="w"> </span><span class="cpf">&lt;stdio.h&gt;</span> <span class="c1">// галоўная бібліятэка Lua (lua_*)</span> <span class="cp">#</span><span class="w"> </span><span class="cp">include</span><span class="w"> </span><span class="cpf">&lt;lua.h&gt;</span> <span class="c1">// дапаможная бібліятэка Lua (luaL_*)</span> <span class="cp">#</span><span class="w"> </span><span class="cp">include</span><span class="w"> </span><span class="cpf">&lt;lauxlib.h&gt;</span> <span class="kt">int</span><span class="w"> </span><span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span> <span class="w"> </span><span class="c1">// пачынае працу з Lua</span> <span class="w"> </span><span class="n">lua_State</span><span class="w"> </span><span class="o">*</span><span class="n">L</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">luaL_newstate</span><span class="p">();</span> <span class="w"> </span><span class="c1">// загадваем Lua выканаць радок кода, які стварае функцыю foo</span> <span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">luaL_dostring</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;function foo (x,y) return x+y end&quot;</span><span class="p">))</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="n">lua_close</span><span class="p">(</span><span class="n">L</span><span class="p">);</span> <span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">-1</span><span class="p">;</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="c1">// захоўваем адрас функцыі foo і лікі 5 і 3 у стэку Lua</span> <span class="w"> </span><span class="n">lua_getglobal</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;foo&quot;</span><span class="p">);</span> <span class="w"> </span><span class="n">lua_pushinteger</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">);</span> <span class="w"> </span><span class="n">lua_pushinteger</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">);</span> <span class="w"> </span><span class="c1">// выклікаем функцыю foo з 2 аргумэнтамі і адным зваротным значэньнем</span> <span class="w"> </span><span class="n">lua_call</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span> <span class="w"> </span><span class="c1">// друкуем тое, што знаходзіцца на вяршыні стэку</span> <span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">&quot;Result: %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">lua_tointeger</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="mi">-1</span><span class="p">));</span> <span class="w"> </span><span class="c1">// вяртаем стэк у першапачатковы стан</span> <span class="w"> </span><span class="n">lua_pop</span><span class="p">(</span><span class="n">L</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span> <span class="w"> </span><span class="c1">// завяршаем працу з Lua</span> <span class="w"> </span><span class="n">lua_close</span><span class="p">(</span><span class="n">L</span><span class="p">);</span> <span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div> <p>Запуск гэтага прыклада дае: </p> <div class="mw-highlight mw-highlight-lang-console mw-content-ltr" dir="ltr"><pre><span></span><span class="gp">$ </span>cc<span class="w"> </span>-o<span class="w"> </span>example<span class="w"> </span>example.c<span class="w"> </span>-llua <span class="gp">$ </span>./example <span class="go">Result: 8</span> </pre></div> <p>C API таксама забясьпечвае некаторыя спецыяльныя табліцы, разьмешчаныя ў розных «псэўдаіндэксах» у стэку Lua. У <code>LUA_GLOBALSINDEX</code> да Lua 5.2<sup id="cite_ref-Changes_in_the_API,_Lua_5.2_manual_18-0" class="reference"><a href="#cite_note-Changes_in_the_API,_Lua_5.2_manual-18"><span class="cite-bracket">&#91;</span>18<span class="cite-bracket">&#93;</span></a></sup> знаходзілася глабальная табліца <code>_G</code>, якая з’яўляецца асноўнай <a href="/w/index.php?title=%D0%9F%D1%80%D0%B0%D1%81%D1%82%D0%BE%D1%80%D0%B0_%D1%96%D0%BC%D1%91%D0%BD%D0%B0%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Прастора імёнаў (старонка не існуе)">прасторай імёнаў</a>. Існуе таксама рэестар, размешчаны ў <code>LUA_REGISTRYINDEX</code>, дзе праграмы на C могуць захоўваць даныя Lua для пазьнейшага выкарыстаньня. </p> <div class="mw-heading mw-heading3"><h3 id="Модулі"><span id=".D0.9C.D0.BE.D0.B4.D1.83.D0.BB.D1.96"></span>Модулі</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=12" title="Рэдагаваць сэкцыю «Модулі»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=12" title="Правіць зыходнік раздзела: Модулі"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Акрамя стандартных бібліятэчных (асноўных) модуляў, можна пісаць пашырэнні з дапамогаю Lua API. Скрыпты Lua могуць загружаць модулі пашырэньня з дапамогаю <code>require</code>,<sup id="cite_ref-luarefman_17-1" class="reference"><a href="#cite_note-luarefman-17"><span class="cite-bracket">&#91;</span>17<span class="cite-bracket">&#93;</span></a></sup> гэтак жа, як стандартныя модулі самой Lua, або з дапамогаю <code>package.loadlib</code>.<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">&#91;</span>19<span class="cite-bracket">&#93;</span></a></sup> Калі бібліятэка C загружаецца праз <code>require('foo')</code> Lua выклікае функцыю <code>luaopen_foo</code>, якая дзейнічае як любая функцыя C, якую можна выклікаць з Lua, і звычайна вяртае табліцу, запоўненую мэтадамі. Модулі Lua, вядомыя пад назваю <i>rocks,</i> даступная праз сістэму кіраваньня пакетамі LuaRocks.<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">&#91;</span>20<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Выкарыстанне"><span id=".D0.92.D1.8B.D0.BA.D0.B0.D1.80.D1.8B.D1.81.D1.82.D0.B0.D0.BD.D0.BD.D0.B5"></span>Выкарыстанне</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=13" title="Рэдагаваць сэкцыю «Выкарыстанне»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=13" title="Правіць зыходнік раздзела: Выкарыстанне"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Lua шырока выкарыстоўваецца ў якасці <a href="/wiki/%D0%A1%D0%BA%D1%80%D1%8B%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B2%D0%B0" title="Скрыптовая мова">мовы сцэнарыяў</a> у <a href="/w/index.php?title=%D0%A0%D0%B0%D1%81%D0%BF%D1%80%D0%B0%D1%86%D0%BE%D1%9E%D0%BA%D0%B0_%D0%B2%D1%96%D0%B4%D1%8D%D0%B0%D0%B3%D1%83%D0%BB%D1%8C%D0%BD%D1%8F%D1%9E&amp;action=edit&amp;redlink=1" class="new" title="Распрацоўка відэагульняў (старонка не існуе)">распрацоўцы відэагульняў</a>, галоўным чынам дзякуючы сваёй лёгкасьці ўбудаваньня, хуткаму выкананьню і кароткаму працэсу навучаньня.<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">&#91;</span>21<span class="cite-bracket">&#93;</span></a></sup> Сярод вядомых гульняў, якія выкарыстоўваюць Lua, <i><a href="/w/index.php?title=Roblox&amp;action=edit&amp;redlink=1" class="new" title="Roblox (старонка не існуе)">Roblox</a></i>,<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">&#91;</span>22<span class="cite-bracket">&#93;</span></a></sup> <i><a href="/w/index.php?title=Garry%27s_Mod&amp;action=edit&amp;redlink=1" class="new" title="Garry&#39;s Mod (старонка не існуе)">Garry's Mod</a></i>, <i><a href="/w/index.php?title=World_of_Warcraft&amp;action=edit&amp;redlink=1" class="new" title="World of Warcraft (старонка не існуе)">World of Warcraft</a></i>, <i><a href="/w/index.php?title=Payday_2&amp;action=edit&amp;redlink=1" class="new" title="Payday 2 (старонка не існуе)">Payday 2</a></i>, <i><a href="/w/index.php?title=Phantasy_Star_Online_2&amp;action=edit&amp;redlink=1" class="new" title="Phantasy Star Online 2 (старонка не існуе)">Phantasy Star Online 2</a></i>, <i><a href="/w/index.php?title=Dota_2&amp;action=edit&amp;redlink=1" class="new" title="Dota 2 (старонка не існуе)">Dota 2</a></i>, <i><a href="/w/index.php?title=Crysis&amp;action=edit&amp;redlink=1" class="new" title="Crysis (старонка не існуе)">Crysis</a></i><sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">&#91;</span>23<span class="cite-bracket">&#93;</span></a></sup> і многія іншыя. Некаторыя гульні маюць мадыфікацыі, якія падтрымліваюць Lua, напрыклад, ComputerCraft для <i><a href="/wiki/Minecraft" title="Minecraft">Minecraft</a></i>. Акрамя таго, Lua таксама выкарыстоўваецца ў праграмным забеспячэньні, не звязаным з відэагульнямі, такім як <a href="/w/index.php?title=Adobe_Lightroom&amp;action=edit&amp;redlink=1" class="new" title="Adobe Lightroom (старонка не існуе)">Adobe Lightroom</a>, <a href="/w/index.php?title=Moho&amp;action=edit&amp;redlink=1" class="new" title="Moho (старонка не існуе)">Moho</a>, <a href="/w/index.php?title=IClone&amp;action=edit&amp;redlink=1" class="new" title="IClone (старонка не існуе)">iClone</a>, <a href="/w/index.php?title=Aerospike&amp;action=edit&amp;redlink=1" class="new" title="Aerospike (старонка не існуе)">Aerospike</a> і пэўным сістэмным праграмным забеспячэнні ў <a href="/wiki/FreeBSD" title="FreeBSD">FreeBSD</a> і <a href="/wiki/NetBSD" title="NetBSD">NetBSD</a>, а таксама выкарыстоўваецца ў якасці шаблённай мовы сцэнарыяў у <a href="/wiki/%D0%9C%D1%8D%D0%B4%D1%8B%D1%8F%D0%92%D1%96%D0%BA%D1%96" title="МэдыяВікі">МэдыяВікі</a> з выкарыстаннем пашырэння Scribunto.<sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">&#91;</span>24<span class="cite-bracket">&#93;</span></a></sup> </p><p>У 2003 годзе апытанне, праведзенае GameDev.net, паказала, што Lua была самай папулярнай мовай сцэнарыяў для праграмаваньня гульняў. 12 студзеня 2012 года Lua быў абвешчаны пераможцам прэміі Front Line Award 2011 ад часопіса <i>Game Developer</i> у катэгорыі «Сродкі праграмавання». </p><p>Вялікая колькасць негульнявых дадаткаў таксама выкарыстоўвае Lua у якасці мовы сцэнарыяў. Напрыклад, <a href="/w/index.php?title=LuaTeX&amp;action=edit&amp;redlink=1" class="new" title="LuaTeX (старонка не існуе)">LuaTeX</a>, <a href="/w/index.php?title=Redis&amp;action=edit&amp;redlink=1" class="new" title="Redis (старонка не існуе)">Redis</a>, <a href="/w/index.php?title=ScyllaDB&amp;action=edit&amp;redlink=1" class="new" title="ScyllaDB (старонка не існуе)">ScyllaDB</a>, <a href="/w/index.php?title=Neovim&amp;action=edit&amp;redlink=1" class="new" title="Neovim (старонка не існуе)">Neovim</a>, <a href="/w/index.php?title=Nginx&amp;action=edit&amp;redlink=1" class="new" title="Nginx (старонка не існуе)">Nginx</a> і <a href="/w/index.php?title=Wireshark&amp;action=edit&amp;redlink=1" class="new" title="Wireshark (старонка не існуе)">Wireshark</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Крыніцы"><span id=".D0.9A.D1.80.D1.8B.D0.BD.D1.96.D1.86.D1.8B"></span>Крыніцы</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=14" title="Рэдагаваць сэкцыю «Крыніцы»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=14" title="Правіць зыходнік раздзела: Крыніцы"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="references-small" style="font-size:85%; -moz-column-count:30em; column-count:30em; -webkit-column-count:30em; list-style-type: decimal;"><ol class="references"> <li id="cite_note-Мова_праграмаваньня_Ring_і_іншыя_мовы-1"><b><a href="#cite_ref-Мова_праграмаваньня_Ring_і_іншыя_мовы_1-0">^</a></b> <span class="reference-text"><cite style="font-style: normal;">Ring Team&#32;(5 December 2017)&#32;<a rel="nofollow" class="external text" href="http://ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages">Мова праграмаваньня Ring і іншыя мовы</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>ring-lang.net</i>&#32;<small><span title="Архіўная копія дакумэнта, даступная нават пасьля страты доступу да арыгінальнай спасылкі"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20181225175312/http://ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages">Архіўная копія</a>&#32;ад 25 December 2018&#160;г.</span></small></cite></span> </li> <li id="cite_note-luaspe-2">^ <a href="#cite_ref-luaspe_2-0"><sup><i><b>а</b></i></sup></a> <a href="#cite_ref-luaspe_2-1"><sup><i><b>б</b></i></sup></a> <span class="reference-text"><span class="citation"><i>Рабэрту Ерусалімскі, Луіс Энрыке дэ Фігуэйрэда, Вальдэмар Салес</i>&#160;<a rel="nofollow" class="external text" href="https://www.lua.org/spe.html">Пашыраемая мова пашырэньняў Lua</a>&#32;&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small> = Lua—An Extensible Extension Language // <i>Software: Practice and Experience</i>. — June 1996. — Т.&#160;26. — С.&#160;635–652. — <a href="/wiki/DOI" class="mw-redirect" title="DOI">DOI</a>:<a rel="nofollow" class="external text" href="https://dx.doi.org/10.1002%2F%28SICI%291097-024X%28199606%2926%3A6%3C635%3A%3AAID-SPE26%3E3.0.CO%3B2-P">10.1002/(SICI)1097-024X(199606)26:6&lt;635::AID-SPE26&gt;3.0.CO;2-P</a></span></span> </li> <li id="cite_note-luaabout-3">^ <a href="#cite_ref-luaabout_3-0"><sup><i><b>а</b></i></sup></a> <a href="#cite_ref-luaabout_3-1"><sup><i><b>б</b></i></sup></a> <a href="#cite_ref-luaabout_3-2"><sup><i><b>в</b></i></sup></a> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/about.html#why">Пра Lua</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org.</cite></span> </li> <li id="cite_note-4"><b><a href="#cite_ref-4">^</a></b> <span class="reference-text"><cite style="font-style: normal;">Юры Тахцееў&#32;(21 April 2013)&#32;<a rel="nofollow" class="external text" href="https://www.foreignaffairs.com/articles/139332/yuri-takhteyev/from-brazil-to-wikipedia?page=2">З Бразыліі ў Вікіпэдыю</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>Foreign Affairs</i></cite></span> </li> <li id="cite_note-hopl2007-5">^ <a href="#cite_ref-hopl2007_5-0"><sup><i><b>а</b></i></sup></a> <a href="#cite_ref-hopl2007_5-1"><sup><i><b>б</b></i></sup></a> <span class="reference-text"><span class="citation"><i>Рабэрту Ерусалімскі, Луіс Энрыке дэ Фігуэйрэда, Вальдэмар Салес</i> <a rel="nofollow" class="external text" href="https://www.acm.org/sigs/sigplan/hopl">Эвалюцыя Lua</a> = The evolution of Lua. — 2007. — С.&#160;2–1–2–26. — <a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:BookSources/978-1-59593-766-7" title="Спэцыяльныя:BookSources/978-1-59593-766-7">ISBN <span class="nowrap">978-1-59593-766-7</span></a></span></span> </li> <li id="cite_note-luahist2001-6"><b><a href="#cite_ref-luahist2001_6-0">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/history.html">Эвалюцыя мовы пашырэньня: гісторыя Lua</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org&#160;(2001).</cite></span> </li> <li id="cite_note-ddj96-7"><b><a href="#cite_ref-ddj96_7-0">^</a></b> <span class="reference-text"><span class="citation"><i>Рабэрту Ерусалімскі, Луіс Энрыке дэ Фігуэйрэда, Вальдэмар Салес</i>&#160;<a rel="nofollow" class="external text" href="https://www.lua.org/ddj.html">Скрыптовая мова Lua. Як некалькі мэтафункцый вырашаюць шмат праблем</a>&#32;&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small> = Lua: an Extensible Embedded Language. A few metamechanisms replace a host of features // <i>Dr. Dobb's Journal</i>. — December 1996. — Т.&#160;21. — С.&#160;26–33.</span></span> </li> <li id="cite_note-8"><b><a href="#cite_ref-8">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/pil/1.html">Праграмаваньне з Lua: 1</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small></cite></span> </li> <li id="cite_note-9"><b><a href="#cite_ref-9">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/manual/5.1/manual.html#2.3">Даведачны дапаможнік Lua 5.1</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org&#160;(2014).</cite></span> </li> <li id="cite_note-10"><b><a href="#cite_ref-10">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/manual/5.1/manual.html#2.5.5">Даведачны дапаможнік Lua 5.1</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org&#160;(2012).</cite></span> </li> <li id="cite_note-lobject_h_array-11"><b><a href="#cite_ref-lobject_h_array_11-0">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/source/5.1/lobject.h.html#array">Зыходны код Lua 5.1</a>.&#32;www.lua.org&#160;(2006).</cite></span> </li> <li id="cite_note-12"><b><a href="#cite_ref-12">^</a></b> <span class="reference-text"><span class="citation"><i>Рабэрту Ерусалімскі</i> Праграмаваньне з Lua, 4-е выданьне = Programming in Lua, 4th Edition. — С.&#160;165.</span></span> </li> <li id="cite_note-13"><b><a href="#cite_ref-13">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/pil/16.3.html">Праграмаваньне з Lua: 16.3</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org&#160;(2021-09-16).</cite></span> </li> <li id="cite_note-14"><b><a href="#cite_ref-14">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="http://lua-users.org/wiki/MetamethodsTutorial">Практычны ўрок па мэтамэтадам</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<small><span title="Архіўная копія дакумэнта, даступная нават пасьля страты доступу да арыгінальнай спасылкі"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20210916182214/http://lua-users.org/wiki/MetamethodsTutorial">Архіўная копія</a>&#32;ад Sep 16, 2021&#160;г.</span></small></cite></span> </li> <li id="cite_note-lua5impl-15"><b><a href="#cite_ref-lua5impl_15-0">^</a></b> <span class="reference-text"><span class="citation"><i>Рабэрту Ерусалімскі, Луіс Энрыке дэ Фігуэйрэда, Вальдэмар Салес</i>&#160;<a rel="nofollow" class="external text" href="http://www.jucs.org/jucs_11_7/the_implementation_of_lua/jucs_11_7_1159_1176_defigueiredo.html">Рэалізацыя Lua 5.0</a>&#32;&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small> = The implementation of Lua 5.0 // <i>J. Of Universal Comp. Sci.</i>. — 2005. — В.&#160;10.3217/jucs-011-07-1159. — Т.&#160;11. — С.&#160;1159–1176.</span></span> </li> <li id="cite_note-luavm51instr-16"><b><a href="#cite_ref-luavm51instr_16-0">^</a></b> <span class="reference-text"><cite style="font-style: normal;">Кэйн-Гонг Ман&#32;(2006)&#32;<a rel="nofollow" class="external text" href="https://talk.pokitto.com/uploads/default/original/2X/7/716c67a0b5b1636cbc4dc1fec232ca2536cb74d1.pdf">Кароткія ўводзіны ў набор камандаў віртуальнае машыны Lua 5.1</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small></cite></span> </li> <li id="cite_note-luarefman-17">^ <a href="#cite_ref-luarefman_17-0"><sup><i><b>а</b></i></sup></a> <a href="#cite_ref-luarefman_17-1"><sup><i><b>б</b></i></sup></a> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/manual/5.2/">Даведачны дапаможнік Lua 5.2</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;www.lua.org.</cite></span> </li> <li id="cite_note-Changes_in_the_API,_Lua_5.2_manual-18"><b><a href="#cite_ref-Changes_in_the_API,_Lua_5.2_manual_18-0">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/manual/5.2/manual.html#8.3">Зьмены ў API</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>Даведачны дапаможнік Lua 5.2</i>.&#32;www.lua.org.</cite></span> </li> <li id="cite_note-19"><b><a href="#cite_ref-19">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://www.lua.org/manual/5.4/manual.html#pdf-package.loadlib">Даведачны дапаможнік Lua 5.4</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>www.lua.org</i></cite></span> </li> <li id="cite_note-20"><b><a href="#cite_ref-20">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://luarocks.org/">LuaRocks</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>.&#32;luarocks.org.</cite></span> </li> <li id="cite_note-21"><b><a href="#cite_ref-21">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://stackoverflow.com/questions/38338/why-is-lua-considered-a-game-language">Чаму Lua лічыцца мовай для відэа-гульняў?</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>Stack Overflow</i>&#32;<small><span title="Архіўная копія дакумэнта, даступная нават пасьля страты доступу да арыгінальнай спасылкі"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20130820131611/http://stackoverflow.com/questions/38338/why-is-lua-considered-a-game-language">Архіўная копія</a>&#32;ад 20 August 2013&#160;г.</span></small></cite></span> </li> <li id="cite_note-22"><b><a href="#cite_ref-22">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://luau-lang.org/why.html">Чаму Lua<i>u</i>?</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>luau-lang.org</i></cite></span> </li> <li id="cite_note-23"><b><a href="#cite_ref-23">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://crymp.net/thread?id=347">Уводзіны ў модынг сэрвэра Crysis</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>crymp.net</i></cite></span> </li> <li id="cite_note-24"><b><a href="#cite_ref-24">^</a></b> <span class="reference-text"><cite style="font-style: normal;">&#32;<a rel="nofollow" class="external text" href="https://wow.gamepedia.com/Lua_functions">Прызначэньне Lua</a>&#160;<small class="ref-info" style="cursor:help;" title="ангельскай мовай">(анг.)</small>&#32;<i>wow.gamepedia.com</i></cite></span> </li> </ol> </div> <div class="mw-heading mw-heading2"><h2 id="Вонкавыя_спасылкі"><span id=".D0.92.D0.BE.D0.BD.D0.BA.D0.B0.D0.B2.D1.8B.D1.8F_.D1.81.D0.BF.D0.B0.D1.81.D1.8B.D0.BB.D0.BA.D1.96"></span>Вонкавыя спасылкі</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Lua&amp;veaction=edit&amp;section=15" title="Рэдагаваць сэкцыю «Вонкавыя спасылкі»" class="mw-editsection-visualeditor"><span>рэдагаваць</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Lua&amp;action=edit&amp;section=15" title="Правіць зыходнік раздзела: Вонкавыя спасылкі"><span>рэдагаваць крыніцу</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a rel="nofollow" class="external text" href="//www.lua.org">Афіцыйная старонка</a></li> <li><a rel="nofollow" class="external text" href="https://luarocks.org/">Lua Rocks&#160;— Пакетны мэнэджар</a></li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐6b7f745dd4‐9b862 Cached time: 20241125092323 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.270 seconds Real time usage: 2.069 seconds Preprocessor visited node count: 4474/1000000 Post‐expand include size: 52603/2097152 bytes Template argument size: 19193/2097152 bytes Highest expansion depth: 14/100 Expensive parser function count: 26/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 59855/5000000 bytes Lua time usage: 0.007/10.000 seconds Lua memory usage: 631851/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 1874.195 1 -total 6.77% 126.973 1 Шаблён:Reflist 2.94% 55.045 19 Шаблён:Cite_web 1.82% 34.161 2 Шаблён:Cite_book 1.73% 32.450 1 Шаблён:Anchor 1.34% 25.140 1 Шаблён:ISBN 1.33% 24.985 2 Шаблён:Ref-en-US 1.31% 24.583 1 Шаблён:Мова_праграмаваньня 1.06% 19.895 1 Шаблён:Картка 0.89% 16.758 3 Шаблён:Cite_journal --> <!-- Saved in parser cache with key be_x_oldwiki:pcache:idhash:284767-0!canonical and timestamp 20241125092323 and revision id 2526406. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Атрымана з «<a dir="ltr" href="https://be-tarask.wikipedia.org/w/index.php?title=Lua&amp;oldid=2526406">https://be-tarask.wikipedia.org/w/index.php?title=Lua&amp;oldid=2526406</a>»</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/%D0%A1%D0%BF%D1%8D%D1%86%D1%8B%D1%8F%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F:%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%96" title="Спэцыяльныя:Катэгорыі">Катэгорыі</a>: <ul><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%9C%D0%BE%D0%B2%D1%8B_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F,_%D1%81%D1%82%D0%B2%D0%BE%D1%80%D0%B0%D0%BD%D1%8B%D1%8F_%D1%9E_1993_%D0%B3%D0%BE%D0%B4%D0%B7%D0%B5" title="Катэгорыя:Мовы праграмаваньня, створаныя ў 1993 годзе">Мовы праграмаваньня, створаныя ў 1993 годзе</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%9F%D1%80%D0%B0%D1%82%D0%B0%D1%82%D1%8B%D0%BF%D0%BD%D0%B0-%D0%B0%D1%80%D1%8B%D0%B5%D0%BD%D1%82%D0%B0%D0%B2%D0%B0%D0%BD%D1%8B%D1%8F_%D0%BC%D0%BE%D0%B2%D1%8B_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D0%B2%D0%B0%D0%BD%D1%8C%D0%BD%D1%8F" title="Катэгорыя:Прататыпна-арыентаваныя мовы праграмаваньня">Прататыпна-арыентаваныя мовы праграмаваньня</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%A1%D0%BA%D1%80%D1%8B%D0%BF%D1%82%D0%BE%D0%B2%D1%8B%D1%8F_%D0%BC%D0%BE%D0%B2%D1%8B" title="Катэгорыя:Скрыптовыя мовы">Скрыптовыя мовы</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%9C%D0%BE%D0%B2%D1%8B_%D0%B7_%D0%B4%D1%8B%D0%BD%D0%B0%D0%BC%D1%96%D1%87%D0%BD%D0%B0%D0%B9_%D1%82%D1%8B%D0%BF%D1%96%D0%B7%D0%B0%D1%86%D1%8B%D1%8F%D0%B9" title="Катэгорыя:Мовы з дынамічнай тыпізацыяй">Мовы з дынамічнай тыпізацыяй</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%92%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D1%8B_%D0%B7%D1%8C_%D0%BB%D1%96%D1%86%D1%8D%D0%BD%D0%B7%D1%96%D1%8F%D0%B9_%D0%9C%D0%A2%D0%86" title="Катэгорыя:Вольныя праграмы зь ліцэнзіяй МТІ">Вольныя праграмы зь ліцэнзіяй МТІ</a></li><li><a href="/w/index.php?title=%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%91%D1%80%D0%B0%D0%B7%D1%8B%D0%BB%D1%8C%D1%81%D0%BA%D1%96%D1%8F_%D0%B2%D1%8B%D0%BD%D0%B0%D1%85%D0%BE%D0%B4%D0%BD%D1%96%D1%86%D1%82%D0%B2%D1%8B&amp;action=edit&amp;redlink=1" class="new" title="Катэгорыя:Бразыльскія вынаходніцтвы (старонка не існуе)">Бразыльскія вынаходніцтвы</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%9A%D1%80%D0%BE%D1%81%D0%BF%D0%BB%D1%8F%D1%82%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D0%B2%D1%8B%D1%8F_%D0%B2%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D1%8B" title="Катэгорыя:Кросплятформавыя вольныя праграмы">Кросплятформавыя вольныя праграмы</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%92%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D0%BA%D0%B0%D0%BC%D0%BF%D1%96%D0%BB%D1%8F%D1%82%D0%B0%D1%80%D1%8B_%D0%B9_%D1%96%D0%BD%D1%82%D1%8D%D1%80%D0%BF%D1%80%D1%8D%D1%82%D0%B0%D1%82%D0%B0%D1%80%D1%8B" title="Катэгорыя:Вольныя кампілятары й інтэрпрэтатары">Вольныя кампілятары й інтэрпрэтатары</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%92%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D0%B1%D1%96%D0%B1%D0%BB%D1%96%D1%8F%D1%82%D1%8D%D0%BA%D1%96_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D0%B0%D1%9E" title="Катэгорыя:Вольныя бібліятэкі праграмаў">Вольныя бібліятэкі праграмаў</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D1%8D%D0%B3%D0%BE%D1%80%D1%8B%D1%8F:%D0%92%D0%BE%D0%BB%D1%8C%D0%BD%D1%8B%D1%8F_%D0%BF%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D0%BC%D1%8B_%D0%BD%D0%B0_C" title="Катэгорыя:Вольныя праграмы на C">Вольныя праграмы на C</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Гэтая старонка апошні раз рэдагавалася 17 ліпеня 2024 году ў 13:52.</li> <li id="footer-info-copyright">Гэты тэкст даступны на ўмовах <a rel="nofollow" class="external text" href="//creativecommons.org/licenses/by-sa/4.0/deed.be">ліцэнзіі Creative Commons Attribution/Share-Alike 4.0</a>; у асобных выпадках могуць ужывацца дадатковыя ўмовы. <span class="noprint">Глядзіце падрабязнасьці ва <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use/be-tarask">Ўмовах выкарыстаньня</a>.</span><br />Wikipedia&#174; — зарэгістраваны гандлёвы знак <a rel="nofollow" class="external text" href="https://wikimediafoundation.org">Wikimedia Foundation, Inc.</a>, некамэрцыйнай арганізацыі.<br /></li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Палітыка прыватнасьці</a></li> <li id="footer-places-about"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%9F%D1%80%D0%B0_%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8E">Пра Вікіпэдыю</a></li> <li id="footer-places-disclaimers"><a href="/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D1%8D%D0%B4%D1%8B%D1%8F:%D0%90%D0%B4%D0%BC%D0%BE%D0%B2%D0%B0_%D0%B0%D0%B4_%D0%B0%D0%B4%D0%BA%D0%B0%D0%B7%D0%BD%D0%B0%D1%81%D1%8C%D1%86%D1%96">Адмова ад адказнасьці</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Кодэкс паводзінаў</a></li> <li id="footer-places-developers"><a href="https://www.mediawiki.org/wiki/How_to_contribute/be-tarask">Распрацоўнікі</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/be-tarask.wikipedia.org">Статыстыка</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Заява пра маркёр</a></li> <li id="footer-places-mobileview"><a href="//be-tarask.m.wikipedia.org/w/index.php?title=Lua&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Мабільная вэрсія</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-694cf4987f-mv7zs","wgBackendResponseTime":163,"wgPageParseReport":{"limitreport":{"cputime":"0.270","walltime":"2.069","ppvisitednodes":{"value":4474,"limit":1000000},"postexpandincludesize":{"value":52603,"limit":2097152},"templateargumentsize":{"value":19193,"limit":2097152},"expansiondepth":{"value":14,"limit":100},"expensivefunctioncount":{"value":26,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":59855,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 1874.195 1 -total"," 6.77% 126.973 1 Шаблён:Reflist"," 2.94% 55.045 19 Шаблён:Cite_web"," 1.82% 34.161 2 Шаблён:Cite_book"," 1.73% 32.450 1 Шаблён:Anchor"," 1.34% 25.140 1 Шаблён:ISBN"," 1.33% 24.985 2 Шаблён:Ref-en-US"," 1.31% 24.583 1 Шаблён:Мова_праграмаваньня"," 1.06% 19.895 1 Шаблён:Картка"," 0.89% 16.758 3 Шаблён:Cite_journal"]},"scribunto":{"limitreport-timeusage":{"value":"0.007","limit":"10.000"},"limitreport-memusage":{"value":631851,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-6b7f745dd4-9b862","timestamp":"20241125092323","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Lua","url":"https:\/\/be-tarask.wikipedia.org\/wiki\/Lua","sameAs":"http:\/\/www.wikidata.org\/entity\/Q207316","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q207316","author":{"@type":"Organization","name":"\u0423\u0434\u0437\u0435\u043b\u044c\u043d\u0456\u043a\u0456 \u043f\u0440\u0430\u0435\u043a\u0442\u0430\u045e \u0412\u0456\u043a\u0456\u043c\u0435\u0434\u044b\u044f"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2024-06-15T17:31:11Z","dateModified":"2024-07-17T10:52:16Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/c\/cf\/Lua-Logo.svg","headline":"\u043c\u043e\u0432\u0430 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0430\u0432\u0430\u043d\u044c\u043d\u044f"}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10