tandalone lua typically sees only one chunk (the file you pass on the
> > command
> > line) but embedded lua implementation often see (sometimes many) more
> > chunks.
> > In luatex’s case, each \directlua is a separate chunk (in ConTeXt, that
> > means every
> > \s
see (sometimes many) more chunks.
In luatex’s case, each \directlua is a separate chunk (in ConTeXt, that means
every
\startluacode block and every \ctxlua call is a separate chunk).
The only unusual thing here is that standalone lua silently quits and returns a
non-zero exit code to the shell,
times many) more chunks.
In luatex’s case, each \directlua is a separate chunk (in ConTeXt, that means
every
\startluacode block and every \ctxlua call is a separate chunk).
The only unusual thing here is that standalone lua silently quits and returns a
non-zero exit code to the shell, whereas lu
st do
>
> f = io.open(...)
> If f then ... else ... end
>
> Best wishes,
> Taco
Hi Taco!
Thank you again for your message!
My wish isn't to avoid error messages, if they are justified! In the case of my
MWE
I want to have a decision in my \startluacode ... \stopluacode e
Hi,
> On 14 Oct 2019, at 21:08, Rudolf Bahr wrote:
>
>
> 2. But in the case of an not existing file (BBB.lua) the known error message
> comes up
> again:
> "token call, execute: [ctxlua]:8: /home/sam/context-tests/BBB.lua: No such
> file or
>directory".
>This, of course, is true,
On Mon, Oct 14, 2019 at 07:19:53PM +0200, Hans Hagen wrote:
> On 10/14/2019 6:50 PM, Rudolf Bahr wrote:
> > THis MWE must be faulty, but where is the error?
> >
> > ====
> >
> > \startluacode
> >
> >
On 10/14/2019 6:50 PM, Rudolf Bahr wrote:
Dear List!
THis MWE must be faulty, but where is the error?
\startluacode
userdata = userdata or {}
function userdata.file_exists (name)
local name = name
local f= assert ( io.open
Hi,
> On 14 Oct 2019, at 18:51, Rudolf Bahr wrote:
>
>
> Dear List!
>
> THis MWE must be faulty, but where is the error?
>
> ===
> \lookupfile{"$HOME/context-tests/AAA.lua"}% "AAA.lua" intentionally does
> exist
$HOME is an actual lit
I suspect the double quotes are part of file names, hence files cannot be
found. Perhaps try remove them in macro argument.
Hope this helps
De : Rudolf Bahr
Envoyé le :lundi 14 octobre 2019 18:50
À : ntg-context@ntg.nl
Objet :[NTG-context] \ctxlua and \startluacode ... \stopluacode
Dear List
Dear List!
THis MWE must be faulty, but where is the error?
\startluacode
userdata = userdata or {}
function userdata.file_exists (name)
local name = name
local f= assert ( io.open ( name, "r" ))
if f then
On 4-9-2012 15:40, Marco Patzer wrote:
Hi,
the luacode environment chokes on macro names with underscores.
Example:
\starttext
\unprotect
\def\number_two{two}
\startluacode
userdata = userdata or { }
function userdata.number_one() context("one") end
-- works
userdata.
Am 04.09.2012 um 15:40 schrieb Marco Patzer :
> Hi,
>
> the luacode environment chokes on macro names with underscores.
> Example:
>
> \starttext
> \unprotect
>
> \def\number_two{two}
>
> \startluacode
> userdata = userdata or { }
> function u
Hi,
the luacode environment chokes on macro names with underscores.
Example:
\starttext
\unprotect
\def\number_two{two}
\startluacode
userdata = userdata or { }
function userdata.number_one() context("one") end
-- works
userdata.number_one()
-- fails
-- context.
Great, thank you very much Philipp.
I will also read this page you pointed and I should understand better Lua then.
http://wiki.contextgarden.net/table_manipulation
Mathieu
_
es are references. Using the “local” keyword, you generate a
local variable that still points to the original table. Instead,
you need to (deep) copy the table explicitly.
·
\starttext
\startluacode
function myFunc(arg)
local
int !
Mathieu
\starttext
\startluacode
function myFunc(arg)
local var = arg
var[1] = var[1] + 3
return var
end
local a = {1,2}
context("a = \\{")
context(a[1])
context(",\\;")
context(a[2])
context("\\}\\par")
context("\\blank"
On Sun, 3 Oct 2010, Hans Hagen wrote:
On 3-10-2010 1:46, Aditya Mahajan wrote:
Hi,
The following snippet
\startluacode
-- \undefined why should a comment matter
a = 10
\stopluacode
fails with
system > error on line 4 in file bug.tex: Undefined control sequence ...
-- \undefined
why sho
Hello,
my observation:
---
\starttext
AAA
\startluacode
a = 10
context(a)
-- a = 20
context(a)
\stopluacode
\stoptext
---
- works OK, 'AAA', '10' and '20' is printed.
If I modify the code:
---
\starttext
AAA
\startluacode
a
On 4-10-2010 9:19, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
(Sorry, I've written bad information, now correcting (*)...)
Hello,
my observation:
---
\starttext
AAA
\startluacode
a = 10
context(a)
-- a = 20
context(a)
\stopluacode
\stoptext
---
- works OK, 'AAA'
(Sorry, I've written bad information, now correcting (*)...)
Hello,
my observation:
---
\starttext
AAA
\startluacode
a = 10
context(a)
-- a = 20
context(a)
\stopluacode
\stoptext
---
- works OK, 'AAA', '10' and '10' (*
On 3-10-2010 1:46, Aditya Mahajan wrote:
Hi,
The following snippet
\startluacode
-- \undefined why should a comment matter
a = 10
\stopluacode
fails with
system > error on line 4 in file bug.tex: Undefined control sequence ...
-- \undefined
why should a comment matt a = 10
\dodostartluac
The problem is that there is no solution to write something expandable (because
\startluacode expands the content) which is required here.
> \starttext
>
> \bgroup\obeylines
> \gdef\texcomment#1
> {}
> \egroup
>
> \bgroup
> \let\letterhyphen=-
> \catcode`-=13
>
Am 03.10.2010 um 10:28 schrieb luigi scarso:
>> Bug or limitation?
> Limitation, but it should be doable to remedy in TeX.
Possible but is it worth the effort, when you start with “--” the percent
should also behave like in Lua etc.
\starttext
\bgroup\obeylines
\gdef\texcomment#1
{}
\egroup
On Sun, Oct 3, 2010 at 1:46 AM, Aditya Mahajan wrote:
> Hi,
>
> The following snippet
>
> \startluacode
> -- \undefined why should a comment matter
> a = 10
> \stopluacode
>
> fails with
>
> system > error on line 4 in file bug.tex: Undefined
Am 03.10.2010 um 01:46 schrieb Aditya Mahajan:
> Hi,
>
> The following snippet
>
> \startluacode
> -- \undefined why should a comment matter
> a = 10
> \stopluacode
>
> fails with
>
> system > error on line 4 in file bug.tex: Undefined
Am 03.10.2010 um 01:46 schrieb Aditya Mahajan:
> Hi,
>
> The following snippet
>
> \startluacode
> -- \undefined why should a comment matter
> a = 10
> \stopluacode
>
> fails with
>
> system > error on line 4 in file bug.tex: Undefined c
Hi,
The following snippet
\startluacode
-- \undefined why should a comment matter
a = 10
\stopluacode
fails with
system > error on line 4 in file bug.tex: Undefined control
sequence ...
-- \undefined
why should a comment matt a =
Jaroslav Hajtmar wrote:
Where is a problem? Is there any solutions with [[ ... ]]
Category codes, of course. :)
\startluacode leaves the backslash at category code 0, and expands
its argument so that you can use TeX macros inside the environment
(which is normally what is wanted). The
) then
script does work OK, but when string is inside \startluacode
\stopluacode environment, then does work only when
i use text string inside ' ' for example:
luastring='\\def\\texmacro\#1\{\\directlua\{luafunction(\#1)\}\}'
Script does not work when i use text inside
29 matches
Mail list logo