From 02bb0589676523e37471fa799c8c05e0b26bf285 Mon Sep 17 00:00:00 2001 From: MaHdi Date: Fri, 3 Sep 2021 12:01:37 +0430 Subject: [PATCH 01/33] Translate a part of article --- .../03-closure/article.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index 199887063..9b1892bba 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -1,22 +1,22 @@ -# Variable scope, closure +# محدوده متغیر، closure -JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created at any moment, passed as an argument to another function, and then called from a totally different place of code later. +جاوااسکریپت یک زبان بسیار تابع محور است. این زبان به ما آزادی زیادی می‌دهد. یک تابع می‌تواند در هر لحظه ساخته شود، به عنوان آرگومان به تابع دیگری داده شود و سپس بعدا در یک جای کاملا متفاوت از کد فراخوانی شود. -We already know that a function can access variables outside of it ("outer" variables). +ما از قبل می‌دانیم که یک تابع می‌تواند به متغیرهای بیرون از خودش دسترسی داشته باشد (متغیرهای «بیرونی»). -But what happens if outer variables change since a function is created? Will the function get newer values or the old ones? +اما اگر متغیرهای بیرونی از زمانی که یک تابع ساخته شد تغییر کنند چه اتفاقی می‌افتد؟ آیا تابع مقدارهای جدید را دریافت می‌کند یا قدیمی‌ها را؟ -And what if a function is passed along as a parameter and called from another place of code, will it get access to outer variables at the new place? +و اگر یک تابع به عنوان یک پارامتر رد و بدل شود و جای دیگری از کد فراخوانی شود، آیا به متغیرهای بیرونی در جای جدید دسترسی پیدا می‌کند؟ -Let's expand our knowledge to understand these scenarios and more complex ones. +بیایید دانش خود را گسترده‌تر کنیم تا این سناریوها و پیچیده‌تر از اینها را درک کنیم. -```smart header="We'll talk about `let/const` variables here" -In JavaScript, there are 3 ways to declare a variable: `let`, `const` (the modern ones), and `var` (the remnant of the past). +```smart header="اینجا ما درباره متغیرهای `let/const` حرف می‌زنیم" +در جاوااسکریپت، 3 راه برای تعریف یک متغیر وجود دارد: `let`، `const` (این دو روش مدرن هستند) و `var` (که از گذشته باقی مانده است). -- In this article we'll use `let` variables in examples. -- Variables, declared with `const`, behave the same, so this article is about `const` too. -- The old `var` has some notable differences, they will be covered in the article . +- در این مقاله ما از متغیرهای `let` در مثال‌ها استفاده می‌کنیم. +- متغیرهایی که با `const` تعریف شوند، رفتار مشابهی دارند پس این مقاله درباره `const` هم هست. +- `var` قدیمی چند تفاوت قابل توجه دارد که در مقاله پوشش داده می‌شوند. ``` ## Code blocks From c804c164f49d616e1932ca952d8b6dbb40365fe6 Mon Sep 17 00:00:00 2001 From: MaHdi Date: Fri, 3 Sep 2021 12:41:23 +0430 Subject: [PATCH 02/33] Translate a part of article --- .../03-closure/article.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index 9b1892bba..36efaccf4 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -1,7 +1,7 @@ # محدوده متغیر، closure -جاوااسکریپت یک زبان بسیار تابع محور است. این زبان به ما آزادی زیادی می‌دهد. یک تابع می‌تواند در هر لحظه ساخته شود، به عنوان آرگومان به تابع دیگری داده شود و سپس بعدا در یک جای کاملا متفاوت از کد فراخوانی شود. +جاوااسکریپت یک زبان بسیار تابع‌محور است. این زبان به ما آزادی زیادی می‌دهد. یک تابع می‌تواند در هر لحظه ساخته شود، به عنوان آرگومان به تابع دیگری داده شود و سپس بعدا در یک جای کاملا متفاوت از کد فراخوانی شود. ما از قبل می‌دانیم که یک تابع می‌تواند به متغیرهای بیرون از خودش دسترسی داشته باشد (متغیرهای «بیرونی»). @@ -19,17 +19,17 @@ - `var` قدیمی چند تفاوت قابل توجه دارد که در مقاله پوشش داده می‌شوند. ``` -## Code blocks +## بلوک‌های کد -If a variable is declared inside a code block `{...}`, it's only visible inside that block. +اگر یک متغیر درون بلوک کد `{...}` تعریف شود، فقط درون همان بلوک قابل رویت است. -For example: +برای مثال: ```js run { - // do some job with local variables that should not be seen outside + // یک کار با متغیرهای محلی که از بیرون نباید شناخته شوند انجام دهید - let message = "Hello"; // only visible in this block + let message = "Hello"; // فقط درون این بلوک قابل رویت است alert(message); // Hello } @@ -37,31 +37,31 @@ For example: alert(message); // Error: message is not defined ``` -We can use this to isolate a piece of code that does its own task, with variables that only belong to it: +ما می‌توانیم از این خاصیت برای ایزوله کردن یک قطعه از کد که دارای متغیرهایی است که فقط به آن تعلق دارند و کار خودش را انجام می‌دهد استفاده کنیم: ```js run { - // show message + // نمایش پیام let message = "Hello"; alert(message); } { - // show another message + // نمایش پیامی دیگر let message = "Goodbye"; alert(message); } ``` -````smart header="There'd be an error without blocks" -Please note, without separate blocks there would be an error, if we use `let` with the existing variable name: +````smart header="بدون وجود بلوک‌ها ارور ایجاد خواهد شد" +لطفا در نظر داشته باشید که بدون بلوک‌های جدا اگر ما از `let` همراه با یک متغیر موجود استفاده کنیم، یک ارور ایجاد خواهد شد. ```js run -// show message +// نمایش پیام let message = "Hello"; alert(message); -// show another message +// نمایش پیامی دیگر *!* let message = "Goodbye"; // Error: variable already declared */!* @@ -69,7 +69,7 @@ alert(message); ``` ```` -For `if`, `for`, `while` and so on, variables declared in `{...}` are also only visible inside: +برای `if`، `for`، `while` و بقیه، متغیرهایی که درون `{...}` تعریف شده باشند تنها درون آنها قابل رویت هستند: ```js run if (true) { @@ -78,25 +78,25 @@ if (true) { alert(phrase); // Hello! } -alert(phrase); // Error, no such variable! +alert(phrase); // !ارور، چنین متغیری وجود ندارد ``` -Here, after `if` finishes, the `alert` below won't see the `phrase`, hence the error. +اینجا، بعد از اینکه `if` تمام می‌شود، `alert` متغیر `phrase` را نمی‌بیند و به همین دلیل ارور ایجاد می‌شود. -That's great, as it allows us to create block-local variables, specific to an `if` branch. +این عالی است چون به ما اجازه می‌دهد که متغیرهایی در سطح بلوک محلی بسازیم که به یک شاخه `if` اختصاص دارند. -The similar thing holds true for `for` and `while` loops: +همین موضوع برای حلقه‌های `for` و `while` هم صادق است: ```js run for (let i = 0; i < 3; i++) { - // the variable i is only visible inside this for - alert(i); // 0, then 1, then 2 + // قابل رویت است for فقط درون این حلقه i متغیر + alert(i); // اول 0، سپس 1، سپس 2 } -alert(i); // Error, no such variable +alert(i); // ارور، چنین متغیری وجود ندارد ``` -Visually, `let i` is outside of `{...}`. But the `for` construct is special here: the variable, declared inside it, is considered a part of the block. +از لحاظ ظاهری، `let i` بیرون از `{...}` است. اما اینجا ساختار `for` خاص است: متغیری که درون آن ساخته شود، جزئی از بلوک کد فرض می‌شود. ## Nested functions From 1da9b01255d707ade5d21932134486c18c0bb07d Mon Sep 17 00:00:00 2001 From: MaHdi Date: Fri, 3 Sep 2021 12:47:40 +0430 Subject: [PATCH 03/33] Translate some error messages The error messages written as comments are not exactly what the browser shows us, so I decided to translate them. --- 1-js/06-advanced-functions/03-closure/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index 36efaccf4..c6654319c 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -34,7 +34,7 @@ alert(message); // Hello } -alert(message); // Error: message is not defined +alert(message); // تعریف نشده است message :ارور ``` ما می‌توانیم از این خاصیت برای ایزوله کردن یک قطعه از کد که دارای متغیرهایی است که فقط به آن تعلق دارند و کار خودش را انجام می‌دهد استفاده کنیم: @@ -63,7 +63,7 @@ alert(message); // نمایش پیامی دیگر *!* -let message = "Goodbye"; // Error: variable already declared +let message = "Goodbye"; // ارور: متغیر از قبل تعریف شده است */!* alert(message); ``` From 8e30e70d551444a79fa9277cb7bc8c9510207fb5 Mon Sep 17 00:00:00 2001 From: MaHdi Date: Sat, 4 Sep 2021 12:55:27 +0430 Subject: [PATCH 04/33] Translate a part of article --- .../03-closure/article.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index c6654319c..c2a4f9a10 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -98,33 +98,33 @@ alert(i); // ارور، چنین متغیری وجود ندارد از لحاظ ظاهری، `let i` بیرون از `{...}` است. اما اینجا ساختار `for` خاص است: متغیری که درون آن ساخته شود، جزئی از بلوک کد فرض می‌شود. -## Nested functions +## تابع‌های تودرتو -A function is called "nested" when it is created inside another function. +به تابعی که درون تابع دیگری ساخته شود «تودرتو» گفته می‌شود. -It is easily possible to do this with JavaScript. +این کار را به راحتی در جاوااسکریپت می‌توان انجام داد. -We can use it to organize our code, like this: +می‌توانیم از آن برای سازماندهی کد خود استفاده کنیم، مثلا اینگونه: ```js function sayHiBye(firstName, lastName) { - // helper nested function to use below + // تابع کمک کننده که پایین‌تر استفاده می‌شود function getFullName() { return firstName + " " + lastName; } - alert( "Hello, " + getFullName() ); - alert( "Bye, " + getFullName() ); + alert( "سلام " + getFullName() ); + alert( "خداحافظ " + getFullName() ); } ``` -Here the *nested* function `getFullName()` is made for convenience. It can access the outer variables and so can return the full name. Nested functions are quite common in JavaScript. +اینجا تابع *تودرتو* `getFullName()` برای راحتی استفاده شده است. این تابع می‌تواند به متغیرهای بیرونی دسترسی داشته باشد پس می‌تواند اسم کامل را برگرداند. تابع‌های تودرتو در جاوااسکریپت بسیار رایج هستند. -What's much more interesting, a nested function can be returned: either as a property of a new object or as a result by itself. It can then be used somewhere else. No matter where, it still has access to the same outer variables. +یک چیز جالب‌تر این است که یک تابع تودرتو می‌تواند برگردانده شود: حالا یا به عنوان یک ویژگی از شیءای جدید یا خودش به عنوان نتیجه برگردانده شود. بعدا می‌تواند در جایی دیگر مورد استفاده قرار بگیرد. مهم نیست کجا باشد، هنوز هم به متغیرهای بیرونی یکسان دسترسی دارد. -Below, `makeCounter` creates the "counter" function that returns the next number on each invocation: +در کد پایین، `makeCounter` تابع «شمارنده» را می‌سازد که با هر بار فراخوانی عدد بعدی را برمی‌گرداند: ```js run function makeCounter() { @@ -142,11 +142,11 @@ alert( counter() ); // 1 alert( counter() ); // 2 ``` -Despite being simple, slightly modified variants of that code have practical uses, for instance, as a [random number generator](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) to generate random values for automated tests. +علاوه بر اینکه ساده است، گونه‌هایی که نسبت به آن کد کمی تغییر کرده‌اند موارد استفاده کاربردی‌ای دارند، برای مثال یک [سازنده عدد تصادفی](https://fa.wikipedia.org/wiki/مولد_اعداد_شبه_تصادفی) تا برای آزمایش‌های خودکار مقدارهای تصادفی تولید کند. -How does this work? If we create multiple counters, will they be independent? What's going on with the variables here? +این چگونه کار می‌کند؟ اگر ما چند شمارنده بسازیم، آیا آنها مستقل خواهند بود؟ چه چیزی در حال رخ دادن روی متغیرها است؟ -Understanding such things is great for the overall knowledge of JavaScript and beneficial for more complex scenarios. So let's go a bit in-depth. +درک چنین چیزهایی برای دانش کلی از جاوااسکریپت و سناریوهای پیچیده‌تر خوب است. پس بیایید کمی عمیق‌تر شویم. ## Lexical Environment From a030eca72d302bc1cbf18995b1c55c3f96dab537 Mon Sep 17 00:00:00 2001 From: MaHdi Date: Sat, 4 Sep 2021 15:18:10 +0430 Subject: [PATCH 05/33] Translate a part of article --- .../03-closure/article.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index c2a4f9a10..cf5b4aa7a 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -148,58 +148,58 @@ alert( counter() ); // 2 درک چنین چیزهایی برای دانش کلی از جاوااسکریپت و سناریوهای پیچیده‌تر خوب است. پس بیایید کمی عمیق‌تر شویم. -## Lexical Environment +## محیط لغوی (Lexical Environment) -```warn header="Here be dragons!" -The in-depth technical explanation lies ahead. +```warn header="مطالب ناشناخته‌ای وجود دارند!" +توضیحات عمیق فنی را ادامه می‌خوانید. -As far as I'd like to avoid low-level language details, any understanding without them would be lacking and incomplete, so get ready. +هر چقدر که می‌خواهم از جزئیات سطح پایین زبان دوری کنم، هرگونه درکی بدون آنها کمبود دارد و کامل نیست، پس آماده باشید. ``` -For clarity, the explanation is split into multiple steps. +برای واضح بودن، توضیحات به چند مرحله تقسیم شده‌اند. -### Step 1. Variables +### مرحله 1. متغیرها -In JavaScript, every running function, code block `{...}`, and the script as a whole have an internal (hidden) associated object known as the *Lexical Environment*. +در جاوااسکریپت، هر تابع در حال اجرا، بلوک کد `{...}` و تمام اسکریپت، یک شیء درونی (پنهان) اختصاص یافته دارد که به عنوان *محیط لغوی* شناخته می‌شود. -The Lexical Environment object consists of two parts: +شیء محیط لغوی شامل دو بخش است: -1. *Environment Record* -- an object that stores all local variables as its properties (and some other information like the value of `this`). -2. A reference to the *outer lexical environment*, the one associated with the outer code. +1. *ذخایر محیط (Environment Record)* -- یک شیء که تمام متغیرهای محلی را به عنوان ویژگی‌های خود (و اطلاعات دیگری مانند مقدار `this`) ذخیره می‌کند. +2. یک رجوع به *محیط لغوی بیرونی (outer)*، محیطی که به کد بیرونی اختصاص دارد. -**A "variable" is just a property of the special internal object, `Environment Record`. "To get or change a variable" means "to get or change a property of that object".** +**یک «متغیر» فقط یک ویژگی از شیء خاص درونی `Environment Record` است. «دریافت یا تغییر یک متغیر» به معنی «دریافت یا تغییر یک ویژگی از آن شیء» است.** -In this simple code without functions, there is only one Lexical Environment: +در این کد ساده که تابعی ندارد، تنها یک محیط لغوی وجود دارد: ![lexical environment](lexical-environment-global.svg) -This is the so-called *global* Lexical Environment, associated with the whole script. +این همان محیط لغوی *گلوبال* است که به تمام کد اختصاص یافته. -On the picture above, the rectangle means Environment Record (variable store) and the arrow means the outer reference. The global Lexical Environment has no outer reference, that's why the arrow points to `null`. +در تصویر بالا، مستطیل به معنای ذخایر محیط (ذخایر متغیر) است و کمان به معنی مرجع بیرونی. محیط لغوی گلوبال مرجع بیرونی ندارد و به همین دلیل است که کمان به `null` اشاره می‌کند. -As the code starts executing and goes on, the Lexical Environment changes. +همانطور که کد شروع به اجرا شدن می‌کند و ادامه می‌یابد، محیط لغوی تغییر می‌کند. -Here's a little bit longer code: +یک کد طولانی‌تر را اینجا داریم: ![lexical environment](closure-variable-phrase.svg) -Rectangles on the right-hand side demonstrate how the global Lexical Environment changes during the execution: +مستطیل‌های سمت راست نشان می‌دهند که محیط لغوی گلوبال در حین اجرا شدن چگونه تغییر می‌کند: -1. When the script starts, the Lexical Environment is pre-populated with all declared variables. - - Initially, they are in the "Uninitialized" state. That's a special internal state, it means that the engine knows about the variable, but it cannot be referenced until it has been declared with `let`. It's almost the same as if the variable didn't exist. -2. Then `let phrase` definition appears. There's no assignment yet, so its value is `undefined`. We can use the variable from this point forward. -3. `phrase` is assigned a value. -4. `phrase` changes the value. +1. زمانی که اسکریپت شروع می‌کند، محیط لغوی از تمام متغیرهای تعریف شده پر می‌شود. + - در ابتدا، آنها در حالت «بدون مقدار اولیه (Uninitialized)» هستند. این یک حالت درونی خاص است و به این معنی است که موتور درباره متغیر آگاه است اما تا زمانی که با `let` تعریف شود نمی‌توان به آن رجوع کرد. تقریبا مانند این است که متغیر وجود ندارد. +2. تعریف `let phrase` نمایان می‌شود. هنوز مقداردهی نشده است، پس مقدار آنها `undefined` است. ما می‌توانیم از اینجا به بعد از متغیر استفاده کنیم. +3. `phrase` یک مقدار گرفته است. +4. `phrase` مقدار را تغییر می‌دهد. -Everything looks simple for now, right? +تا اینجا همه چیز ساده بنظر می‌رسد نه؟ -- A variable is a property of a special internal object, associated with the currently executing block/function/script. -- Working with variables is actually working with the properties of that object. +- یک متغیر، ویژگی یک شیء خاص درونی است که به بلوک/تابع/اسکریپتی که در حال اجرا است اختصاص یافته. +- کارکردن با متغیرها در واقع کارکردن با ویژگی‌های آن شیء است. -```smart header="Lexical Environment is a specification object" -"Lexical Environment" is a specification object: it only exists "theoretically" in the [language specification](https://tc39.es/ecma262/#sec-lexical-environments) to describe how things work. We can't get this object in our code and manipulate it directly. +```smart header="محیط لغوی یک شیء درون مشخصات است" +«محیط لغوی» یک شیء درون مشخصات است: این شیء فقط «به صورت تئوری» در [مشخصات زبان](https://tc39.es/ecma262/#sec-lexical-environments) وجود دارد تا چگونگی کارکردن چیزها را توصیف کند. ما نمی‌توانیم این شیء را در کدمان دریافت کنیم و آن را به صورت مستقیم دستکاری کنیم. -JavaScript engines also may optimize it, discard variables that are unused to save memory and perform other internal tricks, as long as the visible behavior remains as described. + تا آنجایی که رفتار قابل مشاهده همانطور که توصیف شد باقی بماند، موتورهای جاوااسکریپت ممکن است آن را بهینه کنند مثلا برای صرفه‌جویی در اشغال حافظه متغیرهایی که استفاده نمی‌شوند را حذف کنند و ترفندهای درونی دیگری را اجرا کنند. ``` ### Step 2. Function Declarations From efb7c91a1f6783c1056db975c64dc67606c3131f Mon Sep 17 00:00:00 2001 From: MaHdi Date: Sun, 5 Sep 2021 13:05:35 +0430 Subject: [PATCH 06/33] Translate a part of article --- 1-js/06-advanced-functions/03-closure/article.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index cf5b4aa7a..f42283e77 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -202,21 +202,21 @@ alert( counter() ); // 2 تا آنجایی که رفتار قابل مشاهده همانطور که توصیف شد باقی بماند، موتورهای جاوااسکریپت ممکن است آن را بهینه کنند مثلا برای صرفه‌جویی در اشغال حافظه متغیرهایی که استفاده نمی‌شوند را حذف کنند و ترفندهای درونی دیگری را اجرا کنند. ``` -### Step 2. Function Declarations +### مرحله 2. Function Declaration -A function is also a value, like a variable. +یک تابع هم مانند یک متغیر، مقدار است. -**The difference is that a Function Declaration is instantly fully initialized.** +**تفاوت اینجاست که Function Declaration سریعا به طور کامل مقداردهی می‌شوند.** -When a Lexical Environment is created, a Function Declaration immediately becomes a ready-to-use function (unlike `let`, that is unusable till the declaration). +زمانی که یک محیط لغوی ساخته می‌شود، یک Function Declaration سریعا به یک تابع آماده استفاده تبدیل می‌شود (برخلاف `let` که تا زمان تعریف آن در کد غیر قابل استفاده است). -That's why we can use a function, declared as Function Declaration, even before the declaration itself. +به همین دلیل است که از تابعی که به صورت Function Declaration تعریف شده باشد، حتی قبل از رسیدن به تعریف آن می‌توانیم استفاده کنیم. -For example, here's the initial state of the global Lexical Environment when we add a function: +برای مثال، زمانی که ما یک تابع اضافه می‌کنیم وضعیت اولیه محیط لغوی گلوبال اینگونه است: ![](closure-function-declaration.svg) -Naturally, this behavior only applies to Function Declarations, not Function Expressions where we assign a function to a variable, such as `let say = function(name)...`. +طبیعتا، این رفتار فقط برای Function Declarations است نه برای اعلان تابع Expression که ما یک متغیر را برابر با یک تابع قرار می‌دهیم مانند `let say = function(name)...`. ### Step 3. Inner and outer Lexical Environment From b42081902ff523794c68889e307fc291ec0a133c Mon Sep 17 00:00:00 2001 From: MaHdi Date: Mon, 6 Sep 2021 14:28:25 +0430 Subject: [PATCH 07/33] Translate a part of article --- .../03-closure/article.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/1-js/06-advanced-functions/03-closure/article.md b/1-js/06-advanced-functions/03-closure/article.md index f42283e77..5fc8fedd7 100644 --- a/1-js/06-advanced-functions/03-closure/article.md +++ b/1-js/06-advanced-functions/03-closure/article.md @@ -218,11 +218,11 @@ alert( counter() ); // 2 طبیعتا، این رفتار فقط برای Function Declarations است نه برای اعلان تابع Expression که ما یک متغیر را برابر با یک تابع قرار می‌دهیم مانند `let say = function(name)...`. -### Step 3. Inner and outer Lexical Environment +### مرحله 3. محیط‌های لغوی درونی و بیرونی -When a function runs, at the beginning of the call, a new Lexical Environment is created automatically to store local variables and parameters of the call. +زمانی که یک تابع اجرا می‌شود، در ابتدای فراخوانی، به طور خودکار یک محیط لغوی جدید برای ذخیره متغیرهای محلی و پارامترهای فراخوانی ایجاد می‌شود. -For instance, for `say("John")`, it looks like this (the execution is at the line, labelled with an arrow): +برای مثال، برای `say("John)"` اینگونه بنظر می‌رسد (فرایند اجرا شدن در خطی است که با کمان نشانه گذاری شده است):