Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Namespace'd subs in IMCC?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joseph Ryan  
View profile  
 More options Sep 6 2003, 10:00 pm
Newsgroups: perl.perl6.internals
From: ryan....@osu.edu (Joseph Ryan)
Date: Sat, 06 Sep 2003 21:57:29 -0400
Local: Sat, Sep 6 2003 9:57 pm
Subject: Namespace'd subs in IMCC?
 From what I understand from the IMCC documentation, the ".namespace"
macro prepends the namespace name plus "::" to all names within it.
I figured that this would be handy in distinguishing which class a
method belongs to without causing name clashes.  For instance:

    .namespace foo
        .sub bar
            end
        .end
    .endnamespace foo

would create a method bar in the class foo, for a full name of
"foo::bar".

However, this doesn't seem to work.  Is this a bug, or should I be
doing something else for this type of problem?

Thanks,

- Joe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Sep 7 2003, 6:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Sun, 7 Sep 2003 11:10:51 +0200
Local: Sun, Sep 7 2003 5:10 am
Subject: Re: Namespace'd subs in IMCC?

Joseph Ryan <ryan....@osu.edu> wrote:
>  From what I understand from the IMCC documentation, the ".namespace"
> macro prepends the namespace name plus "::" to all names within it.

It's for variables only, currently.

> I figured that this would be handy in distinguishing which class a
> method belongs to without causing name clashes.  For instance:
>     .namespace foo
>         .sub bar
> would create a method bar in the class foo, for a full name of
> "foo::bar".

I'm not outerly sure, if imcc should even have such a functionality. Or
at least, if there is one, it should be configurable. The name mangling
is HLL dependent and there may be no general scheme to do it right for
all kind of symbols.

> However, this doesn't seem to work.  Is this a bug, or should I be
> doing something else for this type of problem?

It's not layed out what it should really do. I'm towards removing this
directive and let the HLL compiler deal with it.

Proposals welcome.

> - Joe

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joseph Ryan  
View profile  
 More options Sep 7 2003, 2:48 pm
Newsgroups: perl.perl6.internals
From: ryan....@osu.edu (Joseph Ryan)
Date: Sun, 07 Sep 2003 14:11:14 -0400
Local: Sun, Sep 7 2003 2:11 pm
Subject: Re: Namespace'd subs in IMCC?

Well, in that case, would it be possible to allow ":" as a valid
character for use in symbol names?

-Joe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brent Dax  
View profile  
 More options Sep 7 2003, 4:00 pm
Newsgroups: perl.perl6.internals
From: br...@brentdax.com (Brent Dax)
Date: Sun, 7 Sep 2003 12:58:02 -0700
Local: Sun, Sep 7 2003 3:58 pm
Subject: RE: Namespace'd subs in IMCC?
Leopold Toetsch:
# I'm not outerly sure, if imcc should even have such a functionality.
Or
# at least, if there is one, it should be configurable. The name
mangling
# is HLL dependent and there may be no general scheme to do it right for
# all kind of symbols.

Then allow a few more symbols in identifiers, and turn namespace into a
prefixing thing that applies to all identifiers:

        .namespace Foo::
                .sub bar                #really Foo::bar
                        ...
                .end
                .namespace Bar::        #really Foo::Bar::
                        .sub baz        #really Foo::Bar::baz
                                ...
                        .end
                .endnamespace
        .endnamespace

        # C#, perhaps?
        .namespace Quux.
                .sub fnord              #really Quux.fnord
                        ...
                .end
        .endnamespace

--Brent Dax <br...@brentdax.com>
Perl and Parrot hacker

"Yeah, and my underwear is flame-retardant--that doesn't mean I'm gonna
set myself on fire to prove it."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Sep 8 2003, 5:49 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 8 Sep 2003 11:15:10 +0200
Local: Mon, Sep 8 2003 5:15 am
Subject: Re: Namespace'd subs in IMCC?

Joseph Ryan <ryan....@osu.edu> wrote:
> Leopold Toetsch wrote:
>>It's not layed out what it should really do. I'm towards removing this
>>directive and let the HLL compiler deal with it.
> Well, in that case, would it be possible to allow ":" as a valid
> character for use in symbol names?

Yep. And probably some other chars used by HLL to mangle names. This
should probably configurable somehow.

> -Joe

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Sep 8 2003, 5:49 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 8 Sep 2003 11:27:42 +0200
Local: Mon, Sep 8 2003 5:27 am
Subject: Re: Namespace'd subs in IMCC?

Brent Dax <br...@brentdax.com> wrote:
> Leopold Toetsch:
> # I'm not outerly sure, if imcc should even have such a functionality.
> Or
> # at least, if there is one, it should be configurable. The name
> mangling
> # is HLL dependent and there may be no general scheme to do it right for
> # all kind of symbols.
> Then allow a few more symbols in identifiers, and turn namespace into a
> prefixing thing that applies to all identifiers:
>    .namespace Foo::
>            .sub bar                #really Foo::bar

What about lexical names? Scopes? I think all IDs that should be
mangled would need some kind of hint, that they are really subject of
mangling.

 .namespace 1 "Foo::"
 .namespace 2 "_Foo::"
 .mangle sub 1
 .mangle global 2
    .sub bar  # Foo::bar
    .global a    # _Foo::a
    # how to generate @Foo::a and $Foo::a?

If the HLL is integrated we could use callbacks to deal with that mess.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »