Hi all Shouldn''t it be possible to access definitions from a super class in a subclass? Eg.: class foo { define bar (bla) { ... } class oof inherits foo { bar { "rab": bla => "something", } } spews out an error: "Could not find definition bar at... -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
On Feb 23, 2007, at 10:59 AM, Juri Rischel Jensen wrote:> Hi all > > Shouldn''t it be possible to access definitions from a super class in > a subclass? Eg.: > > class foo { > define bar (bla) { > ... > } > > class oof inherits foo { > bar { "rab": > bla => "something", > } > } > > spews out an error: "Could not find definition bar at...You''re creating a definition within the foo namespace here, so you''ll have to specify foo::bar { ... }, not just ''bar''. There were some bugs in this in 0.20.x and 0.22.0, but it should work fine in 0.22.1. -- What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? --Larry Wall in <1992Aug26.184221.29627@netlabs.com> --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Feb 23, 2007, at 15:57, Luke Kanies wrote:> On Feb 23, 2007, at 10:59 AM, Juri Rischel Jensen wrote: > >> Hi all >> >> Shouldn''t it be possible to access definitions from a super class in >> a subclass? Eg.: >> >> class foo { >> define bar (bla) { >> ... >> } >> >> class oof inherits foo { >> bar { "rab": >> bla => "something", >> } >> } >> >> spews out an error: "Could not find definition bar at... > > You''re creating a definition within the foo namespace here, so you''ll > have to specify foo::bar { ... }, not just ''bar''. There were some > bugs in this in 0.20.x and 0.22.0, but it should work fine in 0.22.1.Is it still necessary when I inherit foo in oof..? I''ll try it ASAP... -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
On Feb 23, 2007, at 4:08 PM, Juri Rischel Jensen wrote:>> You''re creating a definition within the foo namespace here, so you''ll >> have to specify foo::bar { ... }, not just ''bar''. There were some >> bugs in this in 0.20.x and 0.22.0, but it should work fine in 0.22.1. > > Is it still necessary when I inherit foo in oof..?Hmm. I hadn''t thought about that. Yeah, it''s necessary, but it seems like inheritance should add the base class''s namespace to the current class''s class search path (opened as bug #517). It might also be a good idea to do the same thing when doing an include, but probably not, at this point. -- ''Tis better to be silent and be thought a fool, than to speak and remove all doubt. --Abraham Lincoln --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 2/23/07, Luke Kanies <luke@madstop.com> wrote:> On Feb 23, 2007, at 4:08 PM, Juri Rischel Jensen wrote: > > >> You''re creating a definition within the foo namespace here, so you''ll > >> have to specify foo::bar { ... }, not just ''bar''. There were some > >> bugs in this in 0.20.x and 0.22.0, but it should work fine in 0.22.1. > > > > Is it still necessary when I inherit foo in oof..? > > Hmm. I hadn''t thought about that. Yeah, it''s necessary, but it > seems like inheritance should add the base class''s namespace to the > current class''s class search path (opened as bug #517). It might > also be a good idea to do the same thing when doing an include, but > probably not, at this point.It would be nice to get this working at some point. I just got done fighting with this same issue since I think when I inherit from a class I expect to have access to everything in that class. The foo::bar is definitely an acceptable workaround for now. -Jeremy
On Feb 24, 2007, at 7:57 PM, Jeremy Hunt wrote:> > It would be nice to get this working at some point. I just got done > fighting with this same issue since I think when I inherit from a > class I expect to have access to everything in that class. The > foo::bar is definitely an acceptable workaround for now.Yeah, it''ll be working at some point, although I don''t really know when. -- The great thing about television is that if something important happens anywhere in the world, day or night, you can always change the channel. -- From "Taxi" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com