diff options
Diffstat (limited to 'v2/src/content/pastebins')
-rw-r--r-- | v2/src/content/pastebins/raku-tuple-type-annotation.md | 37 | ||||
-rw-r--r-- | v2/src/content/pastebins/sicp-exercise-3-19.md | 10 |
2 files changed, 42 insertions, 5 deletions
diff --git a/v2/src/content/pastebins/raku-tuple-type-annotation.md b/v2/src/content/pastebins/raku-tuple-type-annotation.md new file mode 100644 index 0000000..3d5ff34 --- /dev/null +++ b/v2/src/content/pastebins/raku-tuple-type-annotation.md @@ -0,0 +1,37 @@ +--- + +title: Raku tuple type annotation + +date: 2019-12-29 + +layout: post + +lang: en + +ref: raku-tuple-type-annotation + +--- + +```perl +# Single Str return value: this works +sub f1(Str $in --> Str) { + $in; +} + +# Tuple of Str as return value: this works +sub f2(Str $in) { + ($in, $in); +} + +# Tuple of Str as return value with type annotation: this doesn't works +sub f2(Str $in --> (Str, Str)) { + ($in, $in); +} +``` + +Error log is: + +```perl +===SORRY!=== Error while compiling /path/to/my/file +Malformed return value +``` diff --git a/v2/src/content/pastebins/sicp-exercise-3-19.md b/v2/src/content/pastebins/sicp-exercise-3-19.md index fd2c52b..8834889 100644 --- a/v2/src/content/pastebins/sicp-exercise-3-19.md +++ b/v2/src/content/pastebins/sicp-exercise-3-19.md @@ -1,14 +1,14 @@ --- -TITLE='SICP exercise 3.19' +title: SICP exercise 3.19 -DATE='2021-09-02' +date: 2021-09-02 -LAYOUT='post' +layout: post -LANGUAGE='en' +lang: en -REF='sicp-exercise-3-19' +id: sicp-exercise-3-19 --- |