From 9e7a95835ad88b49bd44157eec4f7e8c40bdf119 Mon Sep 17 00:00:00 2001 From: 4teapo Date: Sat, 24 Feb 2024 19:58:03 +0100 Subject: [PATCH] Small addition to motivation --- docs/syntax-shorthand-field-init.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/syntax-shorthand-field-init.md b/docs/syntax-shorthand-field-init.md index dc8e381..96de195 100644 --- a/docs/syntax-shorthand-field-init.md +++ b/docs/syntax-shorthand-field-init.md @@ -53,10 +53,11 @@ end return table.freeze(module) ``` -Using this method, the name of the returned table needs to be written (2 + n) times, where n is the -number of variables you export. Every exported variable also needs to be written at least one or -three times. Potentially three times because you may need to localize exported variables before -adding them to the returned table. An example of this would be the following. +Using this method, you lose localization of exported variables, which for example may have a +negative impact on performance. Furthermore, the name of the returned table needs to be written +(2 + n) times, where n is the number of variables you export. Every exported variable also needs to +be written at least one or three times. Potentially three times because you may need to localize +exported variables before adding them to the returned table. An example of this would be the following. ```lua local module = {}