Re: there's no undef!

2003-08-18 Thread Leopold Toetsch
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

Re: there's no undef!

2003-08-17 Thread Sean O'Rourke
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,

Re: there's no undef!

2003-08-17 Thread Michal Wallace
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

Re: there's no undef!

2003-08-17 Thread Benjamin Goldberg
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? > >

Re: there's no undef!

2003-08-17 Thread Michal Wallace
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

Re: there's no undef!

2003-08-17 Thread Benjamin Goldberg
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

Re: there's no undef!

2003-08-16 Thread Michal Wallace
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:

Re: there's no undef!

2003-08-16 Thread Leopold Toetsch
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.

Re: there's no undef!

2003-08-16 Thread Leopold Toetsch
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

there's no undef!

2003-08-16 Thread Michal Wallace
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/ ---