[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: dostring(...) on the Mac
- From: lhf (Luiz Henrique de Figueiredo)
- Date: Tue, 20 Jan 1998 10:49:14 -0200
>From kleiser@online.no Mon Jan 19 21:37:46 1998
>lua_dostring's. After a few more minutes it was clear: When you use
>lua_dofile's, the Carriage Returns in the Mac files get translated into
>Linefeeds; when you use lua_dostring's, they don't. For some reason Lua
That's correct and that's what an ANSI C compiler for the Mac should do.
In C, you should *always* use \n as a line separator in strings.
>dostring("print(1)\r$debug\rprint(2)")
>prin syntax error;$d
>Active Stack:
> function dostring [in file (C)]
> main of (dostring) >> dostring("print(1)\r at line 1
I get the very same error when I run your example code on a Sun,
which uses \n as end-of-line.
So, the error is correct and expected.
>It think a few words on this LF/CR/separator subject would be fine in the
>Lua documentation ;)
Like I said, you should *always* use \n as a line separator in strings,
as if you were going to write them out.
--lhf