From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88695 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: lpdf.checkedkey has problem with false values Date: Mon, 15 Sep 2014 16:59:56 +0200 Message-ID: <5416FEEC.7080704@gmx.net> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1410793237 4149 80.91.229.3 (15 Sep 2014 15:00:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2014 15:00:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 15 17:00:32 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XTXlV-0005l7-JU for gctc-ntg-context-518@m.gmane.org; Mon, 15 Sep 2014 17:00:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1626F10290 for ; Mon, 15 Sep 2014 17:00:29 +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 P-o9gTkgSQ6S for ; Mon, 15 Sep 2014 17:00:29 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4324210222 for ; Mon, 15 Sep 2014 17:00:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3C5E9101E6 for ; Mon, 15 Sep 2014 17:00:17 +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 FAUgvuFMcFqq for ; Mon, 15 Sep 2014 17:00:12 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 30459101E1 for ; Mon, 15 Sep 2014 17:00:02 +0200 (CEST) Original-Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s8FF006X017302 for ; Mon, 15 Sep 2014 17:00:01 +0200 Original-Received: from [192.168.178.31] ([37.201.225.130]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MXIov-1Xoapx241t-00WEwc for ; Mon, 15 Sep 2014 17:00:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 In-Reply-To: X-Provags-ID: V03:K0:c+nSHhAmh18VjYwxg744kMxRZA1iLYUdkTGQkz8RBZWsm2uiQl1 JrvpP3tqmnZahofC/5Yn65hkrIMqv2ISnBJy3q4ELlahPZJ/nnsJYnuWIo4heHEAu6eGn14 2X+6Yd/z6Af3N4djayczlFPw8+gJgu8svEDEt2bRXZoeH2ELkY7mfFS6BY8Z34OGOiZB0Gu +z9Ee5co1rjjeMhyHvFMg== X-UI-Out-Filterresults: notjunk:1; X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=212.227.15.15; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TMPr01uB - f7e8fbb506da - 20140915 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88695 Archived-At: Am 15.09.2014 um 16:14 schrieb Michail Vidiassov: > Dear Developers and All, > > lpdf.checkedkey routine from lpdf-ini.lua has problems with accessing > false boolean values, it returns them as nil. Is it by design or > neglect? More a lua design decision. 'nil' is equal to 'false' here, 'true' is equal to all that is not 'nil'. http://www.lua.org/pil/3.3.html > (I vaguely remember stumbling on this problems before, so there is a > chance that I have already got the answer, but have forgotten it.) > The minimal demo: > \starttext > \startluacode > local function writebool(bv,text) > if bv == true then if bv then > io.write(text, " true \n") > elseif bv == nil then else (if not bv then) HTH, Peter > io.write(text, " nil \n") > else > io.write(text, " false\n") > end > end > local a = {} > a["x"] = true > a["y"] = false > a["z"] = nil > writebool(lpdf.checkedkey(a,"x","boolean"),"lpdf.checkedkey(a,\"x\",\"boolean\")") > writebool(lpdf.checkedkey(a,"y","boolean"),"lpdf.checkedkey(a,\"y\",\"boolean\")") > writebool(lpdf.checkedkey(a,"z","boolean"),"lpdf.checkedkey(a,\"z\",\"boolean\")") > writebool(a.x,"a.x") > writebool(a.y,"a.y") > writebool(a.z,"a.z") > \stopluacode > TEST > \stoptext > > > It results in the following relevant output > > lpdf.checkedkey(a,"x","boolean") true > lpdf.checkedkey(a,"y","boolean") nil > lpdf.checkedkey(a,"z","boolean") nil > a.x true > a.y false > a.z nil > > Note that false value was read by checkedkey as nil. > > Sincerely, MIchail > ___________________________________________________________________________________ > 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 ___________________________________________________________________________________