p5h / p5summit-2019

Perl 5 Summit
0 stars 0 forks source link

Remove experimental from more stuff. make it native. #2

Open toddr opened 4 years ago

toddr commented 4 years ago

signatures, etc.

tonycoz commented 4 years ago

I've been asked about signatures. Currently they're blocked on https://rt.perl.org/Ticket/Display.html?id=132444 but while I think that's useful, I don't think it should block signatures leaving experimental.

leonerd commented 4 years ago

"We might add more to this feature" shouldn't itself be held as a reason that an existing and otherwise-useful feature should be kept experimental. Experimental should only signify "what already exists might be changed" - e.g. in the case of signatures, the ordering between those vs. attributes got swapped around. I think signatures as they stand are stable now.

iabyn commented 4 years ago

Signatures are shortly to experience a major overhaul, including no longer populating @_. Since that's a change to existing behaviour, they will remain experimental

leonerd commented 4 years ago

@iabyn - at risk of being offtopic for this particular issue - where will that be discussed? I'd be interested in at least an option to preserve @_ in some specific cases, because I like to pass that down to inner functions when making wrappers. That's a use-case I'd like to preserve.

iabyn commented 4 years ago

I will be releasing my proposals on p5p in a week or two for discussion. For your particular use-case, you would be able to use a thing I've christened a "query parameter" (which starts with a '?') - it queries the state of argument processing without actually consuming any args. For example: ($self, ?@args, $x, $y) behaves like { my $self = shift; my @args = @_; my $x = shift; my $y = shift} . All will be explained soon.

Leont commented 4 years ago

Personally I wouldn't consider any signature implementation that dies instead of croaks production ready, as much as I want the feature to be out there in production.

arc commented 4 years ago

@Leont signatures have reported errors at the calling site (not the callee site) since 5.22. I agree that undoing that would be a retrograde step.