From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 78A211381F3 for ; Sun, 2 Jun 2013 07:29:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC116E08BA; Sun, 2 Jun 2013 07:29:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D16ECE0825 for ; Sun, 2 Jun 2013 07:29:35 +0000 (UTC) Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 02F7633E0FF; Sun, 2 Jun 2013 07:29:35 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: =?utf-8?q?Micha=C5=82_G=C3=B3rny?= Subject: Re: [gentoo-dev] evar_push/pop helpers Date: Sun, 2 Jun 2013 03:29:33 -0400 User-Agent: KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) Cc: gentoo-dev@lists.gentoo.org References: <201306012303.21261.vapier@gentoo.org> <201306020309.31841.vapier@gentoo.org> <20130602091653.2da17286@gentoo.org> In-Reply-To: <20130602091653.2da17286@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1426666.nVKE5CkuUR"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201306020329.34579.vapier@gentoo.org> X-Archives-Salt: e665b01a-f7ad-496b-b38e-2018984fc006 X-Archives-Hash: 8bf4d5b905625d980f88cdbec461f049 --nextPart1426666.nVKE5CkuUR Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 02 June 2013 03:16:53 Micha=C5=82 G=C3=B3rny wrote: > Dnia 2013-06-02, o godz. 03:09:31 Mike Frysinger napisa=C5=82(a): > > On Sunday 02 June 2013 02:51:34 Micha=C5=82 G=C3=B3rny wrote: > > > Dnia 2013-06-01, o godz. 23:03:20 Mike Frysinger napisa=C5=82(a): > > > > simple set of helpers to save/restore a variable in a limited secti= on > > > > of code > > > >=20 > > > > you can see an example of it in action at the end of the file where= i > > > > need to tweak epatch (and no, doing `LC_COLLATE=3DC set -- ....` do= es > > > > not work). > > >=20 > > > Why the ugly hackery instead of proper 'local' scope? > >=20 > > there's no way to undo the local thus it affects the rest of the func.= =20 > > this makes sure the change is actually localized to where it is needed. >=20 > By use of global variables and a bunch of additional code and evals. the implementation details of estack_* doesn't matter > Is: >=20 > local _epatch_foo=3D${foo} > local foo > ... > foo=3D${_epatch_foo} >=20 > really that hurtful? except you aren't handling edge cases (like set vs unset), and i've replica= ted=20 this pattern before (in fact, you've filed bugs where the set/unset case wa= sn't=20 handled). API 101: implement it once correctly to simplify everyone else. > Also, do you really want the collation to be changed only in this one > place? This looks weird to me. yes, i only want to force it here, because it's the only place where collat= ion=20 matters in the func currently. > Much like fixing tiny bug and trying to > avoid checking whether anything else is affected. yeah, because forcing specific behavior for an entire function is always th= e=20 correct answer. it's like telling people to export LC_ALL=3DC in make.conf= so=20 they never hit locale related problems. feel free to read the whole func yourself if you think there are other plac= es=20 where this matters. =2Dmike --nextPart1426666.nVKE5CkuUR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJRqvReAAoJEEFjO5/oN/WB+n4P/iJ/X067398wj2bDNavqmDmR QWAtKFn5+X5IzqQKM98gS3ERHGWGVdJwXbbYlzxg7tbY632Rk/xofzFxPJfavUqq /tbh0M6jaYIsFFMCRAUn4vb4a4lSMY7Urq5OwI31QaVNBz6ndStFVNJp4ANziyjj XLnpW8JkXZGDhqF3VKDCpDKM9m+f3z4BHR1OYQ8fVmZkCVvXDrbYj2M/1fSbsaVS iCYAudTL3YnTAKv8fpJ+Lba3xMHC9GjNdLLnlcj6Sj1VLV6oxMPxkKxHhGgyP3rb wZVC6QX/5AUTqhCv9I7x1U+scyP+bu15R89XR3djDgeQqgUopGF33EffjHySgQK7 R87pkh0vWaFulZDANeZ/tpcDmlBmU3HAVhiYkK6lncVxzS7vguDIKivJaxytQ2Ro UhNuawL0qQgTp3MLkADjl8LwROFftarxoz/9lDTS+LLvsUnDkICYkp4ZQYfYtiTv 8W9/WXo6czc5kGVITE090ROT/+LR6XrCzjHkGqb9Quw99BdTuKgO00BSm/7Jz310 nYh5gOyxhTm3LV3IX9KtfMyZBr1t2d/KmNf1RSBGXEyWoZqjJcF4TleKiSteaaRi 22lPHl1HlFg2GHqcfNKCMOiWIRNm/vVjJ2iYk9tMWhO5TL8jfVdCvwAkNQQKAjMf I2pTAughItz5wEa7NdyY =T9Se -----END PGP SIGNATURE----- --nextPart1426666.nVKE5CkuUR--