apl: page to list common APL symbols and meanings
[sheet.git] / apl.plp
diff --git a/apl.plp b/apl.plp
new file mode 100644 (file)
index 0000000..0e4ddcf
--- /dev/null
+++ b/apl.plp
@@ -0,0 +1,70 @@
+<(common.inc.plp)><:
+
+Html({
+       title => 'APL',
+       version => 'v1.0',
+       description => [
+       ],
+       keywords => [qw'
+       '],
+       stylesheet => [qw'light circus dark red'],
+       data => [qw'apl.inc.pl'],
+});
+
+use Shiar_Sheet::FormatChar;
+my $glyphs = Shiar_Sheet::FormatChar->new;
+
+my @ops = do 'apl.inc.pl';
+@ops > 1 or die "cannot open operator include: $@\n";
+
+:>
+<h1>APL Symbols</h1>
+
+<div class="section">
+<table class="mapped">
+<thead><tr>
+       <td rowspan=2>op
+       <td colspan=2>input
+       <td colspan=2>meaning
+<tr>
+       <td><a href="/digraphs" title="digraph">di</a><td>html
+       <td>monadic
+       <td>dyadic
+</thead>
+
+
+<:
+for my $op (@ops) {
+       my ($chr, $monad, $dyad) = @{$op};
+       my $codepoint = ord $chr;
+       my $ascii = $codepoint <= 127;
+       my $info = $glyphs->glyph_info($codepoint);
+       my ($class, $name, $mnem, $html, $string) = @{$info};
+       printf '<tr><th title="%2$s">%s'."\n", $chr, EscapeHTML($name || '?'), $class;
+       printf '<td class="%s">%s', @{$_} for (
+               [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
+                       EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
+               [defined $html ? 'l4' : $ascii ? 'l5' : 'l1', $html // "#$codepoint"],
+       );
+       printf(
+               defined $_ ? '<td title="%2$s">%s' : '<td class="Xi">',
+               map { EscapeHTML($_) } split /\n/, $_, 2
+       ) for $monad, $dyad;
+}
+
+:></table>
+</div>
+
+<hr>
+
+<div class="legend">
+       <table class="glyphs"><tr>
+       <td class="X l5">unicode 1.1
+       <td class="X l4">20th century
+       <td class="X l3">in 6.0 (2010)
+       <td class="X l2">recent assignments
+       <td class="X l1">proposed
+       <td class="ex">irregular
+       </table>
+</div>
+