Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Q: pdd03 details

已查看 0 次
跳至第一个未读帖子

Leopold Toetsch

未读,
2006年1月20日 13:56:552006/1/20
收件人 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

未读,
2006年1月20日 14:42:152006/1/20
收件人 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

未读,
2006年1月20日 14:57:112006/1/20
收件人 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 个新帖子