Comment

Comment by chrismorgan

> In a radical variant of this, Perl’s sub doesn’t have a syntax for arguments declaration at all

Actually, Perl has had signatures <https://perldoc.perl.org/perlsub#Signatures> as an experimental feature (requiring `use feature 'signatures'`) since 5.20.0 (May 2014), and they’re considered stable (requiring `use v5.36` or later) since 5.36.0 (May 2022):

  use v5.36;

  sub test($x, $y) {
    print "x=$x y=$y\n"
  }

  test(1, 2)
  # prints x=1, y=2
parent chrismorgan 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton