Skip to content

Instantly share code, notes, and snippets.

@scmorrison
Last active August 20, 2017 16:42
Show Gist options
  • Save scmorrison/d7506b69e5778381c8374163435ae651 to your computer and use it in GitHub Desktop.
Save scmorrison/d7506b69e5778381c8374163435ae651 to your computer and use it in GitHub Desktop.
Perl 6 - Template::Mustache.render dies with hyper
#!/usr/bin/env perl6
use v6;
#use v6.d.PREVIEW;
use Template::Mustache;
my $html = q:to/EOF/;
<html>
{{> head }}
<body>
<div>
{{ render_me }}
</div>
</body>
</html>
EOF
my %partials = head => q:to/EOF/;
<head>
<title>{{ title }}</title>
</head>
EOF
my @pages;
# working: [1..1000].map
# working: for [1..1000]
my @pages = [1..1000].hyper.map: {
my $render = Template::Mustache.render: $html, %( render_me => "render-{$_}", title => "title-{$_}" ), from => [%partials];
say $render;
$render;
};
# variation
#[1..1000].hyper.map: {
# my $render = Template::Mustache.render: $html, %( render_me => "render-{$_}", title => "title-{$_}" ), from => [%partials];
# push @pages, $render;
# say $render;
#};
say @pages.elems;
# rakudo p6v status
# 2017.07-58-gd4d77b66c v6.c failure
# 2017.07-58-gd4d77b66c v6.d.PREVIEW failure
# 2017.07 v6.c failure
# 2017.07 v6.d.PREVIEW failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment