develooper Front page | perl.tcltk | Postings from July 2018

[rt.cpan.org #125472] error with coderefs passes as scalar args

Thread Previous
From:
SJ Luo via RT
Date:
July 3, 2018 04:10
Subject:
[rt.cpan.org #125472] error with coderefs passes as scalar args
Message ID:
rt-4.0.18-20311-1530493829-284.125472-7-0@rt.cpan.org
<URL: https://rt.cpan.org/Ticket/Display.html?id=125472 >

Hi,

I am trying to understand the content of the code disposal patches. So far I cannot fully make it out but I think it would be more efficient than the previous one. There are something I'd like to discuss:

1) The new version put document of originally internal function create_tcl_sub() as a new API. IMHO programmers should always use the form "$interp->call(...,WRITABLE=>$sub)" if they want code disposal to be handled automatically; otherwise, they could just apply original API CreateCommnd() - DeleteCommand() pair to handle code creation and disposal manually. Providing another create_tcl_sub() - _code_dispose() pair looks duplicating and confusing. Besides, user may find it difficult to provide DESCRNAME arg value.

2) The newest POD in github HEAD mentioned

    $interp->call('fileevent','sock9827430','writable');

won't dispose the sub created from

    $interp->call('fileevent','sock9827430', 'writable'=>sub{...});

is it still true? Or only 'set' command behaves in this way?

3) The POD mentioned two functions _code_destroy() and destroy_ref() which cannot be found in Tcl.pm. I guess you mean _code_dispose() and delete_ref(). IMO we just need to have delete_ref() in POD. Disclosing both of them might be confusing too.

Thanks,
SJ

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About