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

Q: pdd03 details

0 views
Skip to first unread message

Leopold Toetsch

unread,
Jan 20, 2006, 1:56:55 PM1/20/06
to Perl 6 Internals, Chip Salzenberg
I'm currently rewriting the guts of argument passing which causes a few
tests to fail.

1) Is the :opt_flag optional?

.param string description :optional
# .param int has_desc :opt_flag # <- is this always needed

(this is from Test/More.pir)

2) Param count mismatches

lua/t/function.t:

local function g(a, b, ...)
# .param pmc var_a ; .param pmc var_b ; .param pmc argv :slurpy
...
g(3)

With param count checks turned on this would clearly fail. But what
without these checks? Are these checks mandatory, as pdd03 implies, or
do we keep a less strict mode, which would pass NULLs and create the
slurpy argv for this case?

Thanks for clarification,
leo

Chip Salzenberg

unread,
Jan 20, 2006, 2:42:15 PM1/20/06
to Leopold Toetsch, Perl 6 Internals
On Fri, Jan 20, 2006 at 07:56:55PM +0100, Leopold Toetsch wrote:
> I'm currently rewriting the guts of argument passing which causes a few
> tests to fail.
>
> 1) Is the :opt_flag optional?
> .param string description :optional
> # .param int has_desc :opt_flag # <- is this always needed

Yes, :opt_flag is optional, no, it is not always needed. (I get to be
unambiguous, disagreeable, and helpful at the same time. :-))

> 2) Param count mismatches
>
> lua/t/function.t:
>
> local function g(a, b, ...)
> # .param pmc var_a ; .param pmc var_b ; .param pmc argv :slurpy
> ...
> g(3)
>
> With param count checks turned on this would clearly fail. But what

> without these checks? Are these checks mandatory, as pdd03 implies ...

Checks are mandatory in supported Parrot. (Unsupported hacks, e.g.
for debugging, can do anything, up to and including spawning nethack.)
If the callee wanted to be flexible he would have to use :optional, and
I can imagine that e.g. Perl 5 translations would always have to use it.

> Thanks for clarification,

Glad to help
--
Chip Salzenberg <ch...@pobox.com>

Nicholas Clark

unread,
Jan 20, 2006, 2:57:11 PM1/20/06
to Perl 6 Internals
On Fri, Jan 20, 2006 at 11:42:15AM -0800, Chip Salzenberg wrote:

> Checks are mandatory in supported Parrot. (Unsupported hacks, e.g.
> for debugging, can do anything, up to and including spawning nethack.)

That will need a configure.pl check though, because Perl 5 isn't yet probing
for the path of rogue-like games yet.

(For context on the joke Chip is alluding to see
http://www.nntp.perl.org/group/perl.perl5.porters/92477 )

Nicholas Clark

0 new messages