On Dec-02, Melvin Smith wrote:
> 
> 1) Currently typenames are not checked except with 'new <classname>'

I would vote for no aliases at all. I propagated the existing uses of
".local object" in the Perl6 compiler and introduced several more
uses, but that was only because I wasn't sure at the time whether it
was intended to (now or in the future) have slightly different
semantics. It wasn't, I'm pretty sure. So I'll switch Perl to using
'pmc' if you make the change.

> 2) In the absence of some sort of return instruction, subs 
> currently just
>     run off the end of their code and continue merrily. This 
>     feature really
>     isn't useful as far as I can see because it is not supported to 
>     assume
>     any ordering between compilation unit, which a sub _is_.
> 
>     It is easier to just assume a sub returns by the active 
>     convention.
> 
>     I'd like to just be able to write void subs as:
> 
>     .sub _foo
>        print "hello\n"
>     .end

Do you really want to generate the extra unused code at the end of all
the subroutines? I don't think you want to autodetect whether the code
is guaranteed to return.

How about adding a return value specification if you want this
generated automatically:

  .sub _gorble () returns (int r)
    r = 5
  .end

  .sub _foo () returns void
    print "hello\n"
  .end

(This assumes you're creating implicit locals for return values as
well as parameters, as you described in #3.)

> 3) Strict prototyping mode shortcut (backwards compatible of 
> course):
>     As usual, shortcuts are for hand-hackers, but its easier to 
>     debug either way.
> 
>    .sub _baz (pmc p, int i)
>       ...
>    .end
> 
>    Same as:
> 
>    .sub _baz protoyped
>       .param pmc p
>       .param int i
>       ...
>    .end

Sounds good to me; debugging the Perl6 sub calling stuff would have
been easier if I didn't have to read so much code to figure out what
was going on.

Reply via email to