Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: pdd21 relative vs absolute

0 views
Skip to first unread message

Leopold Toetsch

unread,
Jan 25, 2006, 10:01:41 AM1/25/06
to Perl 6 Internals
A bunch of namespace opcodes and methods could work absolute or
relative. E.g.

$P0 = get_namespace ["Foo"; "Bar"]

Where should the lookup start?

Is this to be considered absolute (from namespace root), absolute from
the current HLL setting, or relative from the current namespace?

Thanks,
leo

Joshua Isom

unread,
Jan 25, 2006, 12:30:47 PM1/25/06
to Leopold Toetsch, Perl 6 Internals
Having it be absolute makes more sense to me, but there likely will be
people who want relative. Maybe something like:

$P0 = get_namespace[;"Foo";"Bar"]

Where the empty part mean "current namespace here." Of course, then
it'd be really confusing because it's the opposite of pathnames on
unix. Although if [;"Foo";"Bar"] is absolute, it makes sense as well
because the default namespace is "unnamed" and it'd be more convenient
than writing ["";"Foo";"Bar].

Matt Diephouse

unread,
Jan 25, 2006, 1:42:51 PM1/25/06
to Leopold Toetsch, Perl 6 Internals
Leopold Toetsch <l...@toetsch.at> wrote:
> A bunch of namespace opcodes and methods could work absolute or
> relative. E.g.
>
> $P0 = get_namespace ["Foo"; "Bar"]
>
> Where should the lookup start?

Absolute. If people want relative lookups, I'd consider adding another opcode:

$P1 = get_namespace # this exists - get the current namespace
$P2 = get_namespace $P1, ["Foo"; "Bar"] # this doesn't - lookup
Foo::Bar in $P1 (the current namespace)

--
matt diephouse
http://matt.diephouse.com

0 new messages