Jos Backus wrote:

> Consider
> 
> def foo
>   a = "a"
>   b = 1
>   p Kernel.local_variables
> end
> 
> Why doesn't this print anything? I would expect it to print
> 
>     ["a", "b"]
> 
> but instead it prints nothing.
> 

Which version of ruby and which platform?
It works for me:
------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>irb -v
irb 0.9(02/07/03)

C:\>irb
irb(main):001:0> def foo; a = "a"; b = 1; p Kernel.local_variables; end
=> nil
irb(main):002:0> foo
["a", "b"]
=> nil
irb(main):003:0> exit

C:\>ruby -v
ruby 1.8.2 (2004-06-29) [i386-mswin32]

C:\>