From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27491 invoked by alias); 30 Jan 2015 09:00:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34433 Received: (qmail 21081 invoked from network); 30 Jan 2015 08:59:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f126d000001e9a-b3-54cb47760823 Date: Fri, 30 Jan 2015 08:59:49 +0000 From: Peter Stephenson To: zsh workers Subject: Re: Anyone want to help make zsh/db/gdbm work? Message-id: <20150130085949.4d44007d@pwslap01u.europe.root.pri> In-reply-to: <150129140625.ZM14730@torch.brasslantern.com> References: <150122211942.ZM28918@torch.brasslantern.com> <20150129204658.4a800bcb@ntlworld.com> <150129140625.ZM14730@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCLMWRmVeSWpSXmKPExsVy+t/xq7pl7qdDDO5N1LU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGc/XhxXs46yYuHMeawPjQvYuRk4OCQETiUNrN7BB2GISF+6t B7K5OIQEljJK9C/bwQrhLGGSeL74KpSzjVFi27oLzCAtLAKqEi9nzQNrZxMwlJi6aTYjiC0C FG/+/o+li5GDQ1jAXGLOWT+QMK+AvcSO9a1g5ZwCVhLXjq1mBbGFBG4ySmzaqQZi8wvoS1z9 +4kJ4iJ7iZlXzjBC9ApK/Jh8jwXEZhbQkti8rYkVwpaX2LzmLTPEHHWJG3d3s09gFJqFpGUW kpZZSFoWMDKvYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJ2S87GBcfszrEKMDBqMTDO3PT yRAh1sSy4srcQ4wSHMxKIryq1qdDhHhTEiurUovy44tKc1KLDzEycXBKNTBGP4l7vfDzGYbn ktva3pvfKi74MqXm5Bw3wRvO03XVPu/y8bt0UaDeZ7qv/5ncdOWlhjLas7YkMc8NPbCusSrj 5gmts/MOLXetvNjzMu9Xzs4Zzz2fTCt7EFgc33FmP7uSlo+P0Lpj7j+29z5jcbthuuRWruq+ pvNh+Z8NJ0juPSB9Wej+1xcflViKMxINtZiLihMBIqYSkjcCAAA= On Thu, 29 Jan 2015 14:06:25 -0800 Bart Schaefer wrote: > ztie() still calls createspecialhash() which only succeeds if the > parameter is not set. So to make a ztie parameter local, one has > to do this: > > (){ > local foo > unset foo > ztie -d db/gdbm -f gdbmdb foo > # $foo is now a local ztie > } > > Still, this makes wrong the part of the doc I wrote about it always > creating a global parameter. > > Should we document the need to both declare and unset the parameter, > or should we add an implicit unset to ztie() ? It should probably unset the variable; any other attempt to reuse a variable declared local (e.g. by declaring it local as a scalar and assigning it as an array) will silently do that, so I don't see why this should be different. Arguably that should be down in createparam(), which isn't told the full story of the parameter you want to create; stuff like whether it's being declared local or not, or whether you need to change the type, is handled up above, creating what's currently a fairly monstrous interface with createparam() acting as a backend to a lot of half-baked logic. pws