From: "dsmith at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/13721] local variable name collision
Date: Thu, 23 Feb 2012 18:29:00 -0000 [thread overview]
Message-ID: <bug-13721-6586-TX2GZWFa3n@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-13721-6586@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13721
--- Comment #5 from David Smith <dsmith at redhat dot com> 2012-02-23 18:28:03 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > I'd probably prefer adding the "local" keyword as opposed to reducing the scope
> > of what "global" means. The latter seems more surprising.
>
> It seems to me that any tapset that relied on a global from the user script
> would be prone to bugs. i.e. if the user forgot to define the global, then the
> tapset would implicitly use a local instead, with quite different behavior. So
> my intention is that restricting global in this way, that user globals are only
> available to the user's script, actually has a DWIM flavor -- it's unlikely
> that a tapset should ever mean to reference a user's global. But if the
> consensus is that this is too weird or surprising, so be it.
>
> A "local" keyword will do the trick, but I imagine it will make authoring more
> tedious. We end up more verbose, and any time the "local" is forgotten, that
> becomes a latent bug in the tapset waiting for a name clash.
Hmm, I see your point about forgetting a local and being right back where we
are now.
(One advantage to 'local' that I just thought of is that a user could use it in
his own script where reducing the scope of what "global" means doesn't help a
user in his own script.)
But, on balance perhaps reducing "global"s scope make more sense.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
next prev parent reply other threads:[~2012-02-23 18:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 21:03 [Bug tapsets/13721] New: " dsmith at redhat dot com
2012-02-21 22:31 ` [Bug tapsets/13721] " jistone at redhat dot com
2012-02-21 22:37 ` jistone at redhat dot com
2012-02-23 15:46 ` dsmith at redhat dot com
2012-02-23 17:18 ` jistone at redhat dot com
2012-02-23 18:29 ` dsmith at redhat dot com [this message]
2012-02-29 3:02 ` jistone at redhat dot com
2015-11-11 9:44 ` mcermak at redhat dot com
2015-11-11 12:16 ` mcermak at redhat dot com
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=bug-13721-6586-TX2GZWFa3n@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=systemtap@sourceware.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).