Just for kicks I modified A sub named ∃ but added magic so "\x{2203}" =~ /\p{IdContinue}/ would be true and my hoped for character would be recognized as an identifier. I didn't work but it was kind of interesting to both write a source filter this way and to modify perl's idea of what constituted a unicode character class. I thought I'd share.

BEGIN { # Install a function which inserts the two codepoints # 2203;THERE EXISTS;Sm;0;ON;;;;;Y;;;;; # 2204;THERE DOES NOT EXIST;Sm;0;ON;2203 0338;;;;Y;;;;; unshift @INC, sub { my ( $self, $module ) = @_; return unless $module eq 'unicore/lib/gc_sc/IdContin.pl'; # Open the file wherever it exists. my $file; for my $dir (@INC) { my $tst = "$dir/$module"; next unless -f $tst; $file = $tst; } # Slurp the entire file. open my $fh, '<', $file or die "Can't open $file: $!"; my @contents = readline $fh; close $fh; # Find out where the hex region starts. my $start_ix; for ( 0 .. $#contents ) { next unless $contents[$_] =~ /^[\dA-F]+(?:\s+[\dA-F]+\s*)? +$/; $start_ix = $_; last; } # Find out where to insert my 2203/2005 codes. for ( $start_ix .. $#contents ) { my @chars = map hex("0x$_"), $contents[$_] =~ /(\S+)/g or last; my $char = $chars[-1]; next if $char <= 0x2203; # Insert my two codes. splice @contents, $_, 0, "2203\t2204\n"; last; } # Return the modified file. return ( sub { if (@contents) { $_ = shift @contents; return 1; } else { return 0; } } ); }; }
use utf8; use strict; use warnings; use Test::More tests => 2; my @numbers = 1 .. 10; # This works (but not normally) BEGIN { like( "\x{2203}", qr/\p{IdContinue}/, "\N{THERE EXISTS} is an +identifier" ) } # This doesn't.
sub ∃ (&\@) { my $predicate = shift @_; $predicate->() and return 1 for @_; 0 }

ok( ∃ { /\d/ } @numbers, '∃' );

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊


In reply to Mutable unicode character tables by diotalevi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.