From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88694 Path: news.gmane.org!not-for-mail From: Michail Vidiassov Newsgroups: gmane.comp.tex.context Subject: lpdf.checkedkey has problem with false values Date: Mon, 15 Sep 2014 18:14:59 +0400 Message-ID: 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 1410790525 28541 80.91.229.3 (15 Sep 2014 14:15:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2014 14:15:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 15 16:15:21 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 1XTX3p-0002Yk-Fg for gctc-ntg-context-518@m.gmane.org; Mon, 15 Sep 2014 16:15:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0735610217 for ; Mon, 15 Sep 2014 16:15:21 +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 O8G7d-J2Etqu for ; Mon, 15 Sep 2014 16:15:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 460F610222 for ; Mon, 15 Sep 2014 16:15:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E60BD101E6 for ; Mon, 15 Sep 2014 16:15:08 +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 U1c9o2Hp79UT for ; Mon, 15 Sep 2014 16:15:02 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 569D1101E1 for ; Mon, 15 Sep 2014 16:15:02 +0200 (CEST) Original-Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s8FEExMg001257 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 15 Sep 2014 16:15:00 +0200 Original-Received: by mail-la0-f48.google.com with SMTP id ty20so4678040lab.21 for ; Mon, 15 Sep 2014 07:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iaas.msu.ru; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=rQjQ8CUMeC97S+RNMIselBe+CjokFuHueOuZNYP0hCA=; b=dDrG7jGqJIpJioO1ffTLzGRLV+VTao2VZx2uNL0A1vZPUq0h8tvqUXlbXbuCysfivY DTgd/eYNa8ZeYEpRaA4LCO2e08FLsDfO53TfoKXgvLik8x1cWvgQtnqSO9SdNcDwOvKm H+lkRKBTTH65j9S7eH6aNdTlkwT3VBSZ9k/mA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=rQjQ8CUMeC97S+RNMIselBe+CjokFuHueOuZNYP0hCA=; b=K49q+nUucxB3qNGHSmy9ACu6iIU+FK6++E/ltLp4aD+A1SnVl8GSNZTW1XxrzKs97D 3YjjlHU9oELH6WkNjXgSAnRNE0x3H4Tnz5JS1khXcuqkLRWvdKhwi7R1jlNKKyNIOyJY Y86LumhQ6x3FbQFHYfQ1ojRjK56qd9qUhTd36gTj1OxHtM1Xy+87QJfLl3E99QxfV7Ue LF1Yp3Af5Hs4Q3UCxX6xRvzuxvm+/4tRIqAhZ1LJMzHgX9spn4a2n1Y1YPC4KUH/k6Ae pcBrW55SOyMfvFORDQUVdnuKCM0FPKd8TjV01Oq28jA+qstGjVx8tz4J9b6QNcl6kuKK hj8Q== X-Gm-Message-State: ALoCoQng5XxhXXd/clV41nBgLg2OtgKBJqeDpp26Ck82/3ejjnYzBhzLycqdSfv8GGsVr+sRc+NJ X-Received: by 10.152.7.145 with SMTP id j17mr3997424laa.77.1410790499174; Mon, 15 Sep 2014 07:14:59 -0700 (PDT) Original-Received: by 10.112.137.38 with HTTP; Mon, 15 Sep 2014 07:14:59 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4010:c03::230; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RMPqeXjk - 632ab4bcd215 - 20140915 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:88694 Archived-At: 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? (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 io.write(text, " true \n") elseif bv == nil then 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 ___________________________________________________________________________________