On Mon, Jun 06, 2022 at 11:04:59PM +0200, Ovid wrote: > sub _internal_func ( $class, undef ) { ... } > > But that turns out to be a syntax error, even though it's a common idiom: Signatures already support an unnamed optional placeholder: sub _internal_func ( $class, $= ) { ... } although the syntax is a bit jarring. As an aside, one of my proposals is for 'default defaults' i.e. where the default value for an optional arg is omitted and a sensible default is substituted instead (e.g. when expecting an array ref arg, the default value might be []). So, $foo? is a shortcut for $foo = undef \@a? is a shortcut for \@a = [] etc. Under that scheme, $? would become an alternative for $= -- I before E. Except when it isn't.Thread Previous | Thread Next