From ef2c2f94324daf44ae067ca784d24d469cdfeb20 Mon Sep 17 00:00:00 2001 From: Varun Saini <61795485+VarunSaini02@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:10:36 -0700 Subject: [PATCH] Add backlash escape sequence --- rfcs/require-by-string.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rfcs/require-by-string.md b/rfcs/require-by-string.md index 2350dbb0..ca498e9a 100644 --- a/rfcs/require-by-string.md +++ b/rfcs/require-by-string.md @@ -111,8 +111,9 @@ local MyModule = require("/MyLibrary/MyModule") local MyModule = require("C:/MyLibrary/MyModule") -- These also work, "\" is internally replaced with "/" -local MyModule = require("\MyLibrary\MyModule") -local MyModule = require("C:\MyLibrary\MyModule") +-- (In a string literal, we must use the escape sequence "\\") +local MyModule = require("\\MyLibrary\\MyModule") +local MyModule = require("C:\\MyLibrary\\MyModule") ``` Generally, absolute paths should not be used in regular code: if the location of a globally installed package changes, it can be a nuisance to find and change all require statements that reference the old absolute path.