zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Crash when exporting scalar without value and getsparam fails
Date: Sat, 10 Jan 2015 21:28:54 +0100	[thread overview]
Message-ID: <CAHYJk3TZaDV55P1ah60SVabHqJ4nEoVrS3bNuJ3HQ2D4xacTeA@mail.gmail.com> (raw)
In-Reply-To: <150110120412.ZM21448@torch.brasslantern.com>

On Sat, Jan 10, 2015 at 9:04 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Jan 10,  8:10pm, Mikael Magnusson wrote:
> }
> } % unset IFS
> } % export IFS
> } % IFS=5
> } % unset IFS
> } % printenv|grep IFS # this would be empty for a normal parameter
> } IFS=5
>
> OK, so the remaining issue is that the PM_EXPORT flag is not cleared
> when a special parameter is unset.
>
> I think this is within the definition of how a special paramter behaves;
> i.e., it retains all its attributes even when unset.  In this case we
> have an attribute that's not normally "part of the specialness" of the
> parameter, which is also being preserved.  The same thing happens with
> other flags on other specials, e.g.:
>
> torch% print $SECONDS
> 762
> torch% typeset -E SECONDS
> torch% print $SECONDS
> 7.801753190e+02
> torch% unset SECONDS
> torch% print $SECONDS
>
> torch% SECONDS=763
> torch% print $SECONDS
> 7.671235090e+02
>
>
> So should e.g. stdunsetfn() and tiedarrunsetfn() clear the PM_EXPORTED
> flag as well as assert the PM_UNSET flag?  Or is that going to cause a
> problem elsewhere because there is a special parameter that has the
> feature of always being exported?  I can't think of any, but maybe we
> shouldn't rule it out ... in which case this gets really hairy, as we
> will have to know, for every special, what flags should or should not
> be retained across unset.

Ah, these are good points. I don't have any especially strong feelings
about making IFS stop being exported after unset, I was just reporting
what I observed in case it indicated some further wonkiness.

-- 
Mikael Magnusson


  reply	other threads:[~2015-01-10 20:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 13:26 Mikael Magnusson
2015-01-10  6:52 ` Bart Schaefer
2015-01-10  7:56   ` Mikael Magnusson
2015-01-10  8:09     ` Mikael Magnusson
2015-01-10 17:25       ` Bart Schaefer
2015-01-10 18:28         ` Bart Schaefer
2015-01-10 19:10           ` Mikael Magnusson
2015-01-10 20:04             ` Bart Schaefer
2015-01-10 20:28               ` Mikael Magnusson [this message]
2015-01-10 16:57     ` Bart Schaefer
2015-01-10 17:12       ` Mikael Magnusson

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=CAHYJk3TZaDV55P1ah60SVabHqJ4nEoVrS3bNuJ3HQ2D4xacTeA@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.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).