Benjamin Goldberg <[EMAIL PROTECTED]> wrote:
> Maybe. But, what happens with:
>x = 1
>y = lambda: x
>del x
>z = y()
> Does/should this also throw a NameError?
Yep. It throws a NameError. So deleting from the lex pad is ok.
leo
Benjamin Goldberg <[EMAIL PROTECTED]> writes:
> There's no way, in this program, for $x to be out of scope while $y is
> in scope.
But we're in Perl6(66)-land, where "delete caller.MY{'$x'}" and
"delete %OUTER::x" (sp?) can wreak havoc on your pad from all
sorts of strange places. It ain't moral,
On Mon, 18 Aug 2003, Benjamin Goldberg wrote:
> > Hmm. Do you mean
> >
> > if for stmt in block:
> > if stmt.type == undef:
> > flag_as_going_to_delet(stmt.varname)
> >
> > So I can create a new pad when it's assigned?
>
> Right. You'd create a new pad just before the "for", and
Michal Wallace wrote:
>
> On Sun, 17 Aug 2003, Benjamin Goldberg wrote:
>
> > Michal Wallace wrote:
> >
> > > Uh-oh. I just went to implement "del x"
> > > and there's no op to remove a variable
> > > from a lexical pad! :)
> >
> > Why would you want to remove a variable from a lexical pad?
> >
On Sun, 17 Aug 2003, Benjamin Goldberg wrote:
> Michal Wallace wrote:
>
> > Uh-oh. I just went to implement "del x"
> > and there's no op to remove a variable
> > from a lexical pad! :)
>
> Why would you want to remove a variable from a lexical pad?
>
> Surely the "right thing to do" would be to
Michal Wallace wrote:
>
> Uh-oh. I just went to implement "del x"
> and there's no op to remove a variable
> from a lexical pad! :)
Why would you want to remove a variable from a lexical pad?
Surely the "right thing to do" would be to create a new pad (scope),
then add your 'x' variable which
On Sat, 16 Aug 2003, Leopold Toetsch wrote:
> I have put in scratchpad_delete
>
> peek_pad P0
> delete P0["foo"]
>
> deletes names only.
Thanks! works great!
Sincerely,
Michal J Wallace
Sabren Enterprises, Inc.
-
contact: [EMAIL PROTECTED]
hosting:
Leopold Toetsch wrote:
Michal Wallace <[EMAIL PROTECTED]> wrote:
Uh-oh. I just went to implement "del x"
and there's no op to remove a variable
This needs delete_keyed() in scratchpad.pmc to be implemented.
I have put in scratchpad_delete
peek_pad P0
delete P0["foo"]
deletes names only.
Michal Wallace <[EMAIL PROTECTED]> wrote:
> Uh-oh. I just went to implement "del x"
> and there's no op to remove a variable
> from a lexical pad! :)
new_pad P0
...
delete P0["foo"]
This needs delete_keyed() in scratchpad.pmc to be implemented.
> Sincerely,
>
> Michal J Wallace
leo
Uh-oh. I just went to implement "del x"
and there's no op to remove a variable
from a lexical pad! :)
Sincerely,
Michal J Wallace
Sabren Enterprises, Inc.
-
contact: [EMAIL PROTECTED]
hosting: http://www.cornerhost.com/
my site: http://www.withoutane.com/
---
10 matches
Mail list logo