From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Partial implementation of "nameref", sort of.
Date: Tue, 27 Jan 2015 08:24:35 -0800 [thread overview]
Message-ID: <150127082435.ZM1243@torch.brasslantern.com> (raw)
In-Reply-To: <16472.1422309949@thecus.kiddle.eu>
On Jan 26, 11:05pm, Oliver Kiddle wrote:
}
} This is storing the string reference to the name, right? That is also
} what the somewhat more complete implementation from back in 15058 did
Indeed, I'd forgotten all about that.
I saw the shortcut that seemed to be possible by simply setting aspar
in paramsubst() and decided to see what I could do with it.
} At the time, my understanding of the consensus was that an
} implementation needed to instead use a pointer as the internal
} representation of the reference
There's now a tmpdata pointer in the Param struct which may not have been
present in 2001. Perhaps it could be leveraged for this.
} (along with either reference counting or garbage collection).
Yeah, that's the tricky bit -- finding the namerefs in the event the
pointed-to variable is unset or goes out of scope. There'd have to be
an intermediate struct that points in both directions, or something.
} It's a more useful feature in Ksh which has lexically scoped local
} variables. Ksh special cases nameref ref=$1 to take the referenced
} parameter from the parent scope which seems quite ugly to me. I'd prefer
} something more explicit like Tcl's uplevel command.
Agreed.
next prev parent reply other threads:[~2015-01-27 16:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 0:20 Bart Schaefer
2015-01-26 22:05 ` Oliver Kiddle
2015-01-27 16:24 ` Bart Schaefer [this message]
2015-01-27 17:13 ` probably nothing 'segmentation fault' Ray Andrews
2015-01-27 17:52 ` Peter Stephenson
2015-01-27 18:13 ` Ray Andrews
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=150127082435.ZM1243@torch.brasslantern.com \
--to=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).