lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Why does `load()` fail here?
From
: Rena <hyperhacker@
...
>
Date
: Fri, 22 Nov 2013 13:27:49 -0500
On Fri, Nov 22, 2013 at 1:26 PM, Dirk Laurie
<
dirk.laurie@gmail.com
>
wrote:
> code = "return '\n' "
> =load(code)
nil [string "return '..."]:1: unfinished string near '''
Because the \n is interpreted when you define the string constant containing the code, so load() is receiving:
return '
'
You need to either double the backslash or (probably more readable for long strings) use [[ ]] instead of " ".
--
Sent from my Game Boy.
References
:
Why does `load()` fail here?
,
Dirk Laurie
Prev by Date:
Why does `load()` fail here?
Next by Date:
Re: Why does `load()` fail here?
Previous by thread:
Why does `load()` fail here?
Next by thread:
Re: Why does `load()` fail here?
Index(es):
Date
Thread