From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78531 Path: news.gmane.org!not-for-mail From: Sietse Brouwer Newsgroups: gmane.comp.tex.context Subject: Re: Frozen callback. Date: Tue, 2 Oct 2012 14:02:24 +0200 Message-ID: References: <20121001200255.GC5059@phlegethon.router_intern> <506AA030.90705@wxs.nl> 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 1349179399 15394 80.91.229.3 (2 Oct 2012 12:03:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2012 12:03:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 02 14:03:23 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJ1Bs-0006LF-HT for gctc-ntg-context-518@m.gmane.org; Tue, 02 Oct 2012 14:03:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D3D331020C; Tue, 2 Oct 2012 14:03:02 +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 YK9Se7xVsnK6; Tue, 2 Oct 2012 14:03:01 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 10131101F3; Tue, 2 Oct 2012 14:03:01 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0040D101F3 for ; Tue, 2 Oct 2012 14:02:59 +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 R0Xa9sp4pRkU for ; Tue, 2 Oct 2012 14:02:49 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 9BEBC101F2 for ; Tue, 2 Oct 2012 14:02:49 +0200 (CEST) Original-Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q92C2jnv030284 for ; Tue, 2 Oct 2012 14:02:45 +0200 Original-Received: by ied10 with SMTP id 10so18185881ied.14 for ; Tue, 02 Oct 2012 05:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Hz08o3PLE+sUdmk62ydzTlkP3hWXd+lAR/Y6pkdcp1k=; b=jTE66KWv56UAp8ohV72gWSC+XbnKk2f3AVwJW3mP15jUoZxM2rzsNa0k/adaIWXmzy 9tiY96w7fWOFCD3p9Gtm0ICPXmPz07KeDkO6HbtHHTWKTfYKuE6ALzByTOxA/CcrzV1J Jb/u+gisFTS9NgWMuTSADmlHeYpcnTy5Vgudqs6laGKPndGji2ESqqEaqGfpnNcuqefW Y1TI67OtkoDenN8mAhj4VJg0d03E1RlCcv+SQX7ELzmLb/16qtd6CbFT+eix5mfwCvwx CKCcWoyNBe2fMvaD6gDYRNMuZUZciTThe4YNVQqZwt1Ncx+FXVaRkuY5RCyLTpqupQgx /9Ag== Original-Received: by 10.42.43.1 with SMTP id v1mr13546754ice.23.1349179365018; Tue, 02 Oct 2012 05:02:45 -0700 (PDT) Original-Received: by 10.64.31.67 with HTTP; Tue, 2 Oct 2012 05:02:24 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.223.169; 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: 0NI6c2Jmc - 78597c71c318 - 20121002 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:78531 Archived-At: Hello, Andre! Andre Caldas wrote: >> function document.MyCharacterMess(str,filename) > > What is this "str"? This is a function that takes two variables; the first one it calls 'str', the second one 'filename'. Example: function f(a, b) return a/b end function(8,2) --> 4, not 0.25 I do not know what sort of str and filename are being passed to document.MyCharacterMess. (To all the action functions in utilities.sequencers.appendaction, in fact). >> if file.nameonly(filename) == "ward" then >> str = table.concat(string.totable(str,"."), " + ") > What is this doing? file.nameonly strips path and extenstion, e.g. file.nameonly('a/b/cod.doc') returns 'cod'. You can see the file.* functions in l-file.lua. string.totable splits a string, and returns the pieces as an array. In this case, the string is split at the periods. table.concat combines a table into a string, optionally putting a string (" + ", in this case) where the pieces join. so the `str = ...` line turns "Hello. I am Sam. You are also Sam." into "Hello + I am Sam + You are also Sam" or "hello.txt" into "hello + txt" > Why is "document.MyCharacterMess" a string? Isn't it less error-prone > to use the function itself, instead of its name? No idea. Cheers, and good luck, Sietse ___________________________________________________________________________________ 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 ___________________________________________________________________________________