Thread Subroutine optionales Argument (Any) (8 answers)
Opened by Kuerbis at 2015-06-27 10:59

Kuerbis
 2015-06-27 10:59
#181435 #181435
User since
2011-03-20
936 Artikel
BenutzerIn
[default_avatar]
Hallo,

bleibt das so, dass eine Subroutine (Any) zurückgibt, wenn ein optionales Argument leer bleibt?

Code (perl): (dl )
1
2
3
4
5
6
7
8
#!/usr/bin/env perl6

sub with-optional( $arg? ) {
    $arg;
}

with-optional( '(Any)' ).say;
with-optional().say;


Ausgabe:
Code: (dl )
1
2
(Any)
(Any)

View full thread Subroutine optionales Argument (Any)