At 11:01 AM -0600 7/30/02, Jonathan Sillito wrote:
>Thanks for the correction. May I ask about the find_lex op? In my
>implementation it looks back through the stack of pads for the given
>lexical:
One thing we need to add is a constant type to initialize pads. It's
perfectly acceptable, and in
At 10:16 AM -0600 7/30/02, Jonathan Sillito wrote:
>Hey, thanks for reading this over. It is not a typo, but it may be
>incorrect. My code does overwrite previous lexicals in enclosing scopes
>(i.e. lexicals in pads lower on the stack), but maybe I have the
>semantics of the store_lex op wrong?
Y
Thanks for the correction. May I ask about the find_lex op? In my
implementation it looks back through the stack of pads for the given
lexical:
new P0, .PerlInt
new P1, .PerlInt
set P0, 10
open_lex
store_lex P0, "a"
# nested lexical scope
open_lex
find_lex P1, "a"
print P
See my 2 comments:
> new P0, .PerlInt
> new P1, .PerlInt
> new P2, .PerlInt
> new P3, .PerlInt
> set P0, 10
> set P1, 11
> set P2, 12
>
> # outer most lexical scope
> open_lex
New pad
> store_lex P0, "a"
> find_lex P3, "a"
> print P3 # prints 10
> print "\n"
>
># nest
On Mon, 2002-07-29 at 17:12, Simon Glover wrote:
> I think you forgot to attach the patch...
oops, now the files are attached ...
- patch: lex.patch
- test file: lexicals.t
- example file: lexicals.pasm
On Tue, 2002-07-30 at 02:14, Stephen Rawls wrote:
> --- Jonathan Sillito
> > close_l
--- Jonathan Sillito
> close_lex # end of nested lexical scope
>
> find_lex P3, "a"
> print P3 # prints 12
> print "\n"
> end
>
That's a typo, right? It should print the first value
of "a" (10). Just making sure I'm not crazy ...
Stephen Rawls
_
I think you forgot to attach the patch...
Simon
# New Ticket Created by Jonathan Sillito
# Please include the string: [perl #15800]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt2/Ticket/Display.html?id=15800 >
The attached patch implements a set of lexical ops. Lexical pads are
implemented as