From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70065 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: =?utf-8?b?RmluZGluZyB2YWx1ZXMg4oCL4oCLb2YgdGhlIGNv?= =?utf-8?q?ntext_macros_inside_Lua_functions_=28=3Dexpansion_inside_Lua_fu?= =?utf-8?b?bmN0aW9ucz8p?= Date: Sun, 17 Jul 2011 14:19:35 +0200 Message-ID: <37B73A08-F808-4120-AF73-D313BD575015@googlemail.com> References: <4E22CF21.9060603@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310905201 31290 80.91.229.12 (17 Jul 2011 12:20:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2011 12:20:01 +0000 (UTC) To: hajtmar@gyza.cz, mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 17 14:19:56 2011 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 1QiQKB-00038P-EW for gctc-ntg-context-518@m.gmane.org; Sun, 17 Jul 2011 14:19:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4EBF1CAE5F; Sun, 17 Jul 2011 14:19:54 +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 oIm0NlOvQK-U; Sun, 17 Jul 2011 14:19:51 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7DBA7CAE55; Sun, 17 Jul 2011 14:19:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 07C5FCAE55 for ; Sun, 17 Jul 2011 14:19:51 +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 46lXH1-Jwn+b for ; Sun, 17 Jul 2011 14:19:39 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 89DF4CAE51 for ; Sun, 17 Jul 2011 14:19:39 +0200 (CEST) Original-Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6HCJcVX019982 for ; Sun, 17 Jul 2011 14:19:39 +0200 Original-Received: by fxe23 with SMTP id 23so4638212fxe.15 for ; Sun, 17 Jul 2011 05:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=yQBPEMZLuXACI877ZtpvToyRYKILTZLOAfcysl1M9z8=; b=VfXu3yaUd9XRVmSSZ/7E2jHyqX3GuWF/LkPHBolNf91x1MNb34Zx7yayiPijDGe4su i54pbcB4yePiRiuptfMSZSoBc6pBGl0HJDls4W9cMRLV+WjsjowD5Z1ny6lsnNd9bIBn O6OjokNAIGE0f1nKCEaDHOZ+/u3guSYaLk+uo= Original-Received: by 10.223.145.7 with SMTP id b7mr4268136fav.56.1310905178475; Sun, 17 Jul 2011 05:19:38 -0700 (PDT) Original-Received: from [192.168.2.31] (p5482DC2B.dip.t-dialin.net [84.130.220.43]) by mx.google.com with ESMTPS id h10sm188564fai.43.2011.07.17.05.19.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 05:19:37 -0700 (PDT) In-Reply-To: <4E22CF21.9060603@gyza.cz> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.42; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rF90jCd6 - 4800db85b6be - 20110717 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:70065 Archived-At: Am 17.07.2011 um 14:01 schrieb Jaroslav Hajtmar: > Hello all, > > For several hours trying to find solutions of problem. > > My minimal example (I mention it at the end of email) for clear reasons show, that : > > 7 is not number. > 7 is number. > 7is not number. > 7is not number. > > In the first is argument '\value' negotiable to the value, in second it is not possible (but for clear reasons too). > > I would need to find from argument ie macro '\\value' in the LUA function its numerical value. > Is there any function that would do that? > > I need something as a function of context (...), which would, however, its output is not located into ConTeXt, but its result get to back to a Lua function or into variable. > It is something like the expansion of an existing ConTeXt macro to its value. \startluacode function test(arg) -- use thirddata namespace for real functions if type(tonumber(arg)) == "number" then if tonumber(arg) > 0 then context("The argument \\quotation{%s} is a positive number",arg) else context("The argument \\quotation{%s} is a negative number",arg) end else context("The argument \\quotation{%s} is a string.",arg) end end \stopluacode \starttext \ctxlua{test("7")} \ctxlua{test("-4")} \ctxlua{test("text")} \stoptext Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________