From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8337 invoked by alias); 23 Feb 2012 18:29:10 -0000 Received: (qmail 8326 invoked by uid 22791); 23 Feb 2012 18:29:09 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Feb 2012 18:28:55 +0000 From: "dsmith at redhat dot com" To: systemtap@sourceware.org Subject: [Bug tapsets/13721] local variable name collision Date: Thu, 23 Feb 2012 18:29:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: tapsets X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dsmith at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00180.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13721 --- Comment #5 from David Smith 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.