From: "John Lam (CLR)" Date: 2007-04-17T09:30:18+09:00 Subject: load behavior --_000_372109E149E8084D8E6C7D9CFD82E06320D5A5587ENAEXMSGC115re_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Consider this code: load('1.rb', true) puts C # error expected puts D # expecting this to be an error as well 1.rb: C =3D "foo" require '2.rb" 2.rb: D =3D "bar" Is this a bug (we're using 1.8.5)? From the docs: "If the optional wrap parameter is true, then the loaded scr= ipt will be executed under an anonymous module, protecting the calling prog= ram's global namespace." Secondary question, should require '2.rb' respect the true flag from the or= iginal load()? Thanks, -John --_000_372109E149E8084D8E6C7D9CFD82E06320D5A5587ENAEXMSGC115re_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Consider this code:

 

load(‘1.rb’, true)

puts C   # error expected

puts D  # expecting this to be an error as well

 

1.rb:

 

C =3D “foo”

require ‘2.rb”

 

2.rb:

 

D =3D “bar”

 

Is this a bug (we’re using 1.8.5)?

 

From the docs: “If the optional wrap parameter i= s true, then the loaded script will be executed under an anonymous module, protecting the calling program’s global namespace.”<= /p>

 

Secondary question, should require ‘2.rb’ respect the true flag from the original load()?

 

Thanks,

-John

 

--_000_372109E149E8084D8E6C7D9CFD82E06320D5A5587ENAEXMSGC115re_--