From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59380 Path: news.gmane.org!not-for-mail From: Khaled Hosny Newsgroups: gmane.comp.tex.context Subject: Re: Lua in LuaLaTeX is diferent?? Date: Sun, 6 Jun 2010 16:00:37 +0300 Message-ID: <20100606130036.GA2978@khaled-laptop> References: <4C0AB151.4060808@gyza.cz> <4C0ADF3B.9030308@gyza.cz> <20100606024619.GA2630@khaled-laptop> <4C0B3CFB.7040800@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1275829252 27975 80.91.229.12 (6 Jun 2010 13:00:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Jun 2010 13:00:52 +0000 (UTC) Cc: mailing list for ConTeXt users To: Jaroslav Hajtmar Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 06 15:00:50 2010 connect(): No such file or directory Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OLFT8-00034M-67 for gctc-ntg-context-518@m.gmane.org; Sun, 06 Jun 2010 15:00:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D5C1FC9CD4; Sun, 6 Jun 2010 15:00:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8ZRyoUH4t7zS; Sun, 6 Jun 2010 15:00:45 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A964DC9CCB; Sun, 6 Jun 2010 15:00:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7A58BC9C3D for ; Sun, 6 Jun 2010 15:00:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9EzUdUFdcDMf for ; Sun, 6 Jun 2010 15:00:40 +0200 (CEST) Original-Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) by balder.ntg.nl (Postfix) with ESMTP id C8F87C9CCB for ; Sun, 6 Jun 2010 15:00:40 +0200 (CEST) Original-Received: by wwb24 with SMTP id 24so2119458wwb.14 for ; Sun, 06 Jun 2010 06:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=D6Ewiat0A8roQXOJkAYwIGrMXwNibnC/90hv5mPXdHw=; b=re3h8Fl/EjgFjSGJybv5X4DUriA/CIuILjBCAeYsH/unEf2IpP4LT9MBOOgGwCyAon EIIqE6xksTrDcRuTfY5TPgeV2z7rOA7K/wh72+hsKrTUy6kVNSRIqdpVykVBGUH3j40K URUXGyy/oflydXG7sTPdWQG9lWdsJ/GrLHDCc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Lbr2GXxQMBYLk03MHz8x0jYkG4qU6JREwV5sOtWfVNF9YTDkCl0nAb1uPacgYXhX9A zM+oRpFLEBwZJWevBOf7HHbg/KG/QBoxcRyyMY51ovHgdYATudBB5vY3H2bisMQx0bSE j2kUSFXxrdS609/SB7vEnyin90sRkXpOTqUKE= Original-Received: by 10.227.141.137 with SMTP id m9mr12486449wbu.202.1275829240494; Sun, 06 Jun 2010 06:00:40 -0700 (PDT) Original-Received: from localhost ([41.238.234.240]) by mx.google.com with ESMTPS id n31sm28528947wba.15.2010.06.06.06.00.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Jun 2010 06:00:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4C0B3CFB.7040800@gyza.cz> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:59380 Archived-At: Lualibs is available on CTAN, it is a repackages l-*.lua ConTeXt modules. On Sun, Jun 06, 2010 at 08:15:23AM +0200, Jaroslav Hajtmar wrote: > Thanks very much. > It is very unpleasant findings, but, it explains everything. > Can be detected using Lua whether application runs under LuaLaTeX or > LuaPlain and then load the library? > How can I retrieve LuaLib? Where can I get more information? I did > some Googling but without success. > Thanx Jaroslav > > > Dne 6.6.2010 4:46, Khaled Hosny napsal(a): > >On Sun, Jun 06, 2010 at 01:35:23AM +0200, Jaroslav Hajtmar wrote: > >>Hi, > >> > >>I am sending examples of functions: > >> > >>The first function is functional in ConTeXt MKIV even LuaLaTeX. > >> > >>-- Global variables for setup in library (it be used when glob. vars > >>Sep, Ld, Rd is not setting in main aplication): > >>UserCSVSeparator=';' > >>UserCSVLeftDelimiter='' > >>UserCSVRightDelimiter='' > >> > >> > >> > >> > >>function ParseCSVdata(s) > >> local Sep = (Sep == nil) and UserCSVSeparator or Sep > >> local Ld = (Ld == nil) and UserCSVLeftDelimiter or Ld > >> local Rd = (Rd == nil) and UserCSVRightDelimiter or Rd > >> if Ld ~= '' or Rd ~= '' then > >> local s=string.sub(s, string.find(s, Ld)+1, string.find(s, > >>Rd,-1)-1) > >> end > >> local fieldsep=tostring(Rd..Sep..Ld) > >> local result = {} > >> local from = 1 > >> local sep_from, sep_to = string.find( s, fieldsep, from ) > >> while sep_from do > >> table.insert( result, string.sub( s, from , sep_from-1 ) ) > >> from = sep_to + 1 > >> sep_from, sep_to = string.find( s, fieldsep, from ) > >> end > >> table.insert( result, string.sub( s, from ) ) > >> return result > >>end > >> > >> > >>The second is more universal, but it only works in ConTeXt MKIV. > >>LuaLaTeX report error: "attempt to call field 'split' (a nil value) ... ." > >> > >>function ParseCSVdata(string2parse, separator, leftdelimiter, > >>rightdelimiter) > >> Sep = (Sep == nil) and UserCSVSeparator or Sep > >> Ld = (Ld == nil) and UserCSVLeftDelimiter or Ld > >> Rd = (Rd == nil) and UserCSVRightDelimiter or Rd > >> local separator = (separator == nil) and Sep or separator > >> local leftdelimiter = (leftdelimiter == nil) and Ld or leftdelimiter > >> local rightdelimiter = (rightdelimiter == nil) and Rd or rightdelimiter > >> local result={} > >> if leftdelimiter ~= '' and rightdelimiter ~= '' then > >> string.gsub(string2parse, > >>leftdelimiter.."(.-)"..rightdelimiter, function(a) > >>table.insert(result,a) end ) > >> else > >> result=string.split(string2parse,separator) > >> end > >> return result > >>end > >> > >> > >>I would like to benefit from the second function, but I want the > >>application was applicable even LuaLaTeX > >You need the lualibs package, which imports some of the extended lua > >librarires from ConTeXt, since string.split() is not a standad lua > >function. > > > >Regards, > > Khaled > > > > > >>Thanx Jaroslav > >> > >> > >> > >> > >>Dne 5.6.2010 22:19, Jaroslav Hajtmar napsal(a): > >>>Hi, > >>>I did a Lua application for ConTeXt, and now I wanted to adapt it > >>>to work even LuaLaTeX. > >>>On what needs to be careful? Compiling by LuaLaTeX specific > >>>messages appear as if the Lua in LuaLaTeX didnt know some Lua > >>>commands (i.e. split, find .... ). > >>> > >>>On what needs to be careful generaly when programming applications > >>>for LuaLaTeX? > >>> > >>>Thanx Jaroslav > >>>___________________________________________________________________________________ > >>> > >>>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://tex.aanhet.net > >>>archive : http://foundry.supelec.fr/projects/contextrev/ > >>>wiki : http://contextgarden.net > >>>___________________________________________________________________________________ > >>> > >>> > >>___________________________________________________________________________________ > >>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://tex.aanhet.net > >>archive : http://foundry.supelec.fr/projects/contextrev/ > >>wiki : http://contextgarden.net > >>___________________________________________________________________________________ -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________