Thanks to Leo and Will for clarifications, and to Leo for the r10150
bugfix. That has enabled me to implement lexical handling for Amber.
With Parrot doing most of the heavy lifting, it wasn't too hard. Now I
just have to write the tests and documentation :-)

Leo wrote:
> BTW I had to change (r10148) 2 amber PMCs to comply to c89.

Thanks. I'm not a C expert, that's for sure.

Leo's Perl/Python example is now working in Amber, and looks like this:


   print_line(do_add3(20))
   print_line(do_add3(21))

   f := mk_add3(39)
   print_line(f.call)
   f := mk_add3(40)
   print_line(f.call)

   private

      f

      do_add3(arg)
         local
            add3 := (agent outer arg do result := arg + 3 end)
         do
            result := add3.call
         end

      mk_add3(arg)
         do
            result := (agent outer arg do result := arg + 3 end)
         end

   end




Regards,
Roger Browne

Reply via email to