From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64620 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: why lua? Date: Sat, 18 Dec 2010 12:03:22 +0100 Message-ID: <20101218110322.GB17742@aides> References: <20101217232724.GA17742@aides> <4D0BF64D.1090406@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2059836248==" X-Trace: dough.gmane.org 1292670219 11104 80.91.229.12 (18 Dec 2010 11:03:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Dec 2010 11:03:39 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 18 12:03:35 2010 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 1PTuZa-0006Pn-Tv for gctc-ntg-context-518@m.gmane.org; Sat, 18 Dec 2010 12:03:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C36F1CA925; Sat, 18 Dec 2010 12:03:33 +0100 (CET) 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 z+3My91jxT1y; Sat, 18 Dec 2010 12:03:30 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9C402CA91D; Sat, 18 Dec 2010 12:03:30 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B4196CA91D for ; Sat, 18 Dec 2010 12:03:28 +0100 (CET) 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 TuIV54gIC8Rt for ; Sat, 18 Dec 2010 12:03:26 +0100 (CET) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id 61C20C9A8A for ; Sat, 18 Dec 2010 12:03:26 +0100 (CET) Original-Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by filter2-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBIAiR7o030790 for ; Sat, 18 Dec 2010 11:44:28 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id oBIB3OIU024182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Dec 2010 12:03:24 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id oBIB3OHE011256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Dec 2010 12:03:24 +0100 Original-Received: from localhost (mnhm-4d01089e.pool.mediaWays.net [77.1.8.158]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id oBIB3M70018150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 18 Dec 2010 12:03:23 +0100 In-Reply-To: X-Operating-System: Linux aides 2.6.36-ARCH X-Polite-Request: "Please try to be nice, don't send html mail." User-Agent: Mutt/1.5.20 (2009-06-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.210.211; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0aDIyIrB1 - 07b2011ab09d - 20101218 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 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:64620 Archived-At: --===============2059836248== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V0207lvV8h4k8FAm" Content-Disposition: inline --V0207lvV8h4k8FAm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-12-18 <01:50:29>, Philipp A. wrote: > well, i just like it. and since i don=E2=80=99t know lua (well, that=E2= =80=99s not exactly > true, but i can=E2=80=99t write a normal sized script without looking thi= ngs up), > and tend to do things like i would do them in other languages i know. e.g= =2E: > how do you loop elegantly over table values? =E2=80=9Cfor k,v in pairs(t)= do print(v) > end=E2=80=9D creates a throwaway variable k, which doesn=E2=80=99t seem r= ight. some things Depending on whether you want to access the non-hashed content as well you might want to use the =E2=80=9Cnext=E2=80=9D iterator instead as i= t=E2=80=99s slightly faster (according to my tests, that is). You won=E2=80=99t get around the local variable, though; I have no clue and no time to check if it=E2=80=99s even technically feasible to iterate a hash table without accessing the hashes. > are totally counter-intuitive for me like tables beginning with index 1, = and > so on. Feels natural after some time, I guarantee. And you=E2=80=99ll never look the same way at a fencepost again =E2=80=A6 What you=E2=80=99ll miss most is all the nice shortcuts and syntactic sugar like =E2=80=9Csetdefault(k,[]).append(v)=E2=80=9D (two lines in Lua) = and the lazy handling of arrays, strings &c. as sequences that can be iterated over like it was all the same, and probably the error handling. Nothing you can=E2=80=99t live without. > > Anyhow, I don't like languages that need religious arguments to become > > popular. > or are you talking about lua having been invented at a catholic university > and thus being a product of a sect somehow? Never looked at it that way. There should be a =E2=80=9Cfun facts=E2=80=9D section on the wiki to list all the confusing mysteries surrounding context. Regards, Philipp PS: > kross is the project for bringing consistent scripting to KDE, and it is > just awesome, since it allows you to write stuff in the scripting language > of your choice. Apart from being OT, you can always switch to a window manager that uses your favorite scripting language instead -- mine has Lua inside which is a lot cleaner than doing configuration in e.g. bash or something. --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk0MlPoACgkQ02lYlJYWs9KmPACeIZjK+1TMh2mzhaCVEavaDwzB MoEAn32hxT1JgfwpiFD6O+iHNhPU03VR =2m3H -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm-- --===============2059836248== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============2059836248==--