zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Anyone want to help make zsh/db/gdbm work?
Date: Fri, 30 Jan 2015 08:59:49 +0000	[thread overview]
Message-ID: <20150130085949.4d44007d@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <150129140625.ZM14730@torch.brasslantern.com>

On Thu, 29 Jan 2015 14:06:25 -0800
Bart Schaefer <schaefer@brasslantern.com> 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


  reply	other threads:[~2015-01-30  9:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  5:19 Bart Schaefer
2015-01-23  5:37 ` ZyX
2015-01-23  5:59   ` Bart Schaefer
2015-01-23 15:49     ` ZyX
2015-01-23 19:47       ` Peter Stephenson
2015-01-23 20:00         ` ZyX
2015-01-23 20:16           ` Aaron Schrab
2015-01-23 20:33         ` Mikael Magnusson
2015-01-26 12:11 ` Peter Stephenson
2015-01-29 20:46   ` Peter Stephenson
2015-01-29 22:06     ` Bart Schaefer
2015-01-30  8:59       ` Peter Stephenson [this message]
2015-01-30 19:56         ` Peter Stephenson
2015-01-30 20:03           ` Bart Schaefer
2015-02-02  9:46             ` Peter Stephenson
2015-02-03 10:22               ` Peter Stephenson
2015-01-31  3:21         ` Bart Schaefer
2015-01-31  3:37           ` Bart Schaefer
2015-02-01 19:57             ` Bart Schaefer
2015-02-01 21:49             ` Bart Schaefer
2015-02-02  5:18 ` ZyX
2015-02-02 17:33   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150130085949.4d44007d@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).