diff options
author | EuAndreh <eu@euandre.org> | 2023-04-04 08:33:41 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-04 08:43:15 -0300 |
commit | 08588f9907299b1a927e281d5c65b46b7cefa427 (patch) | |
tree | 860f8550c2efee35df9bfa1ef56e338f8331c2d1 /v2/src/content/pastebins | |
parent | dynamic.mk: Use serve(1) as is (diff) | |
download | euandre.org-08588f9907299b1a927e281d5c65b46b7cefa427.tar.gz euandre.org-08588f9907299b1a927e281d5c65b46b7cefa427.tar.xz |
Revamp v2/
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 --- |