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
Unexpected error...
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
  2 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
 
Cory Spencer  
View profile  
 More options Dec 12 2003, 4:49 pm
Newsgroups: perl.perl6.internals
From: cspen...@sprocket.org (Cory Spencer)
Date: Fri, 12 Dec 2003 14:00:52 -0700 (MST)
Local: Fri, Dec 12 2003 4:00 pm
Subject: Unexpected error...

Can anyone tell me why the following code:

  .sub _main
        .local PerlUndef val

        val = new PerlUndef
        _foo("bar", val)

        end
  .end

  .sub _foo
        .param string v1
        .param pmc v2

        .pcc_begin_return
        .return 1
        .pcc_end_return
  .end

Would produce the following output:

  cog:~/parrot test.imc
  wrong param count
          in file '(unknown file)' near line -1

It seems to be related to passing the PerlUndef as the seoncd
parameter...


 
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.
Melvin Smith  
View profile  
 More options Dec 12 2003, 5:48 pm
Newsgroups: perl.perl6.internals
From: mrjoltc...@mindspring.com (Melvin Smith)
Date: Fri, 12 Dec 2003 16:57:58 -0500
Local: Fri, Dec 12 2003 4:57 pm
Subject: Re: Unexpected error...
At 02:00 PM 12/12/2003 -0700, Cory Spencer wrote:

When using prototyped subs and mixing native types with PMC types as
arguments, IMCC will get confused. Its because it isn't correctly checking
the prototypes. The other problem is that when you use the shorthand
version of sub calling (_foo(a,b)), IMCC assumes prototyped.

It stems mainly from 2a below.

I recommend: (1) Using non_prototyped subs and explicit .pcc_call directives,
rather than the shorthand version for now.

Until I get some fixes committed you have a couple of other options:

(2) Don't mix PMCs and native types in argument lists if you use prototyped
subs
(2a) If you use PMCs, then IMCC won't coerce a constant argument into a
PMC yet. _foo("bar", val) will pass "bar" as a plain string type, even if
the prototype
expects a PMC. This is a bug.

I expect to have a large revision soon that will address lots of issues in
IMCC, but
it will most likely be in a new branch (imcc2) so as not to cause complete
chaos with
the "semi-stable" version. Then I will try to backpatch some of those fixes
into the
current IMCC.

-Melvin


 
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 »