* further experiments with lua
@ 2019-01-09 7:43 Thomas A. Schmitz
2019-01-09 8:47 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2019-01-09 7:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Hans,
I'm doing some further experiments with the utf and lpeg libraries. This
code fails, and I don't understand why:
local s = "Ä"
print(characters.uccode(s))
mtxrun --script test.lua
./test.lua:3: attempt to index global 'characters' (a nil value)
Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: further experiments with lua
2019-01-09 7:43 further experiments with lua Thomas A. Schmitz
@ 2019-01-09 8:47 ` Hans Hagen
2019-01-09 9:44 ` luigi scarso
2019-01-09 10:55 ` Thomas A. Schmitz
0 siblings, 2 replies; 4+ messages in thread
From: Hans Hagen @ 2019-01-09 8:47 UTC (permalink / raw)
To: mailing list for ConTeXt users, Thomas A. Schmitz
On 1/9/2019 8:43 AM, Thomas A. Schmitz wrote:
> Hi Hans,
>
> I'm doing some further experiments with the utf and lpeg libraries. This
> code fails, and I don't understand why:
>
> local s = "Ä"
>
> print(characters.uccode(s))
>
> mtxrun --script test.lua
>
> ./test.lua:3: attempt to index global 'characters' (a nil value)
mtxrun has al the basic modules in it but not the character ones
(thinking of it, i can add an autoload for that, maybe i should do that)
so you need:
require "char-ini"
local s = "Ä"
print(characters.uccode(s))
which will load char-def.lua (you really don't want that in mtxrun.lua
embedded) and char-ini.lua
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: further experiments with lua
2019-01-09 8:47 ` Hans Hagen
@ 2019-01-09 9:44 ` luigi scarso
2019-01-09 10:55 ` Thomas A. Schmitz
1 sibling, 0 replies; 4+ messages in thread
From: luigi scarso @ 2019-01-09 9:44 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz
[-- Attachment #1.1: Type: text/plain, Size: 264 bytes --]
On Wed, Jan 9, 2019 at 9:47 AM Hans Hagen <j.hagen@xs4all.nl> wrote:
>
> so you need:
>
> require "char-ini"
>
> local s = "Ä"
>
>
also
if not characters then
require("char-ini")
end
local s = "Ä"
print(characters.uccode(s))
--
luigi
[-- Attachment #1.2: Type: text/html, Size: 794 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: further experiments with lua
2019-01-09 8:47 ` Hans Hagen
2019-01-09 9:44 ` luigi scarso
@ 2019-01-09 10:55 ` Thomas A. Schmitz
1 sibling, 0 replies; 4+ messages in thread
From: Thomas A. Schmitz @ 2019-01-09 10:55 UTC (permalink / raw)
To: Hans Hagen, mailing list for ConTeXt users
On 1/9/19 9:47 AM, Hans Hagen wrote:
> mtxrun has al the basic modules in it but not the character ones
> (thinking of it, i can add an autoload for that, maybe i should do that)
>
> so you need:
>
> require "char-ini"
Hans, Luigi,
thanks a lot, that solves it! Maybe autoload or at least a small hint in
cld-mkiv.pdf?
Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-09 10:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 7:43 further experiments with lua Thomas A. Schmitz
2019-01-09 8:47 ` Hans Hagen
2019-01-09 9:44 ` luigi scarso
2019-01-09 10:55 ` Thomas A. Schmitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).