From 6da0f9389c878259d636f565339841598d319c88 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Tue, 18 Jan 2022 14:16:39 +0100 Subject: Fix hugo blocks --- ...erl6-introduction-to-application-programming.md | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'content/posts/2018/2018-03-20-perl6-introduction-to-application-programming.md') diff --git a/content/posts/2018/2018-03-20-perl6-introduction-to-application-programming.md b/content/posts/2018/2018-03-20-perl6-introduction-to-application-programming.md index 30912c9..21c4298 100644 --- a/content/posts/2018/2018-03-20-perl6-introduction-to-application-programming.md +++ b/content/posts/2018/2018-03-20-perl6-introduction-to-application-programming.md @@ -43,10 +43,10 @@ So we'll start by installing this module through `zef`. $ zef install App::Assixt ``` -{< admonition title="note" >} +{{< admonition title="note" >}} You may need to rehash your `$PATH` as well, which can be done using `hash -r` on `bash`, or `rehash` for `zsh`. For other shells, consult your manual. -{< / admonition >} +{{< / admonition >}} Next up, we can use `assixt` to create the new skeleton of our application, with the `new` subcommand. This will ask for some user input, which will be @@ -168,7 +168,7 @@ subtest "Illegal rolls", { } ``` -{< admonition title="note" >} +{{< admonition title="note" >}} Perl 6 allows mathematical characters to make your code more concise, as with the ≤ in the above block. If you use http://www.vim.org/[vim], you can make use of the https://github.com/vim-perl/vim-perl6[vim-perl6] plugin, which has an @@ -181,7 +181,7 @@ If that's not an option, you can use a https://en.wikipedia.org/wiki/Compose_key[compose key]. If that is not viable either, you can also stick to using the ascii-based ops. Perl 6 supports both of them. -{< / admonition >} +{{< / admonition >}} This will run 53 tests, split up in two [https://docs.perl6.org/language/testing#Grouping_tests](subtests). Subtests are @@ -216,12 +216,12 @@ You might notice the tests are currently failing, which is correct. The `Local::App::Dicer` module doesn't exist yet to test against. We'll be working on that next. -{< admonition title="note" >} +{{< admonition title="note" >}} For those interested, the command run by `assixt test` is `prove -e "perl6 -Ilib" t`. This will include the `lib` directory into the `PERL6PATH` to be able to access the libraries we'll be making. The `t` argument specifies the directory containing the tests. -{< / admonition >} +{{< / admonition >}} ## Creating the library @@ -262,11 +262,11 @@ exactly that. Let's start with the signature, which tells the compiler the name of the subroutine, which arguments it accepts, their types and what type the subroutine will return. -{< admonition title="tip" >} +{{< admonition title="tip" >}} Perl 6 is gradually typed, so all type information is optional. The subroutine arguments are optional too, but you will rarely want a subroutine that doesn't have an argument list. -{< / admonition >} +{{< / admonition >}} ```raku sub roll($sides) is export @@ -407,11 +407,11 @@ sub MAIN(Int:D $dice, Int:D $sides where { $dice > 0 && $sides > 0 }) } ``` -{< admonition title="note" >} +{{< admonition title="note" >}} Just like the `≤` character, Perl 6 allows to use the proper multiplication character `×` (this is not the letter `x`!). You can use the more widely known `*` for multiplication as well. -{< / admonition >} +{{< / admonition >}} If you run the program with the arguments `2` and `20` now, you'll get a random number between 2 and 40, just like we expect: @@ -767,8 +767,8 @@ $ zef install . This will resolve the dependencies of the local module, and then install it. You should now be able to run `dicer` from anywhere. -{< admonition title="warning" >} +{{< admonition title="warning" >}} With most shells, you have to "rehash" your `$PATH` as well. On `bash`, this is done with `hash -r`, on `zsh` it's `rehash`. If you're using any other shell, please consult the manual. -{< / admonition >} +{{< / admonition >}} -- cgit v1.1