Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.069.551 Times

Unicode::Overload 0.01

  Date Added: April 09, 2010  |  Visits: 1.027

Unicode::Overload

Report Broken Link
Printer Friendly Version


Product Homepage
Download (91 downloads)



Unicode::Overload is a Perl source filter to implement Unicode operations. SYNOPSIS use charnames :full; use Unicode::Overload ( "N{UNION}" => infix => sub { my %a = map{$_=>1}@{$_[0]}; my %b = map{$_=>1}@{$_[1]}; return keys(%a,$b); }, "N{SUPERSCRIPT TWO}" => postfix => sub { $_[0] ** 2 }, "N{NOT SIGN}" => prefix => sub { !$_[0] }, [ "N{LEFT FLOOR}", "N{RIGHT FLOOR}" ] => outfix => sub { POSIX::floor($_[0]) }, ); @union = (@a N{UNION @b); # Parentheses REQUIRED die "Pythagoras was WRONG!" # Same here unless sqrt((3)N{SUPERSCRIPT TWO} + (4)N{SUPERSCRIPT TWO}) == 5; $b = N{NOT SIGN}($b); # Required here too die "Fell through floor" # Balanced characters form their own parentheses unless N{LEFT FLOOR}-3.2N{RIGHT FLOOR} == 4; Allows you to declare your own Unicode operators and have them behave as prefix (like sigma or integral), postfix (like superscripted 2), infix (like union), or outfix (like the floor operator, with the L-like and J-like brackets). To keep this document friendly to people without UTF-8 terminals, the N{} syntax for Unicode characters will be used throughout, but please note that the N{} characters can be replaced with the actual UTF-8 characters anywhere. Also, please note that since Perl 5 doesnt support the notion of arbitrary operators, this module cheats and uses source filters to do its job. As such, all "operators" must have their arguments enclosed in parentheses. This limitation will be lifted when a better way to do this is found. Also, note that since these arent "real" operators there is no way (at the moment) to specify precedence. All Unicode "operators" have the precedence (such as it is) of function calls, as they all get transformed into function calls inline before interpreting. In addition, due to a weird unicode-related bug, only one character per operator is currently permitted. Despite behaving correctly elsewhere, substr() thinks that one character equals one byte inside Unicode::Overload . Anyway, this module defines four basic types of operators. Prefix and infix should be familiar to most users of perl, as prefix operators are basically function calls without the parens. Infix operators are of course the familiar + etcetera. The best analogy for postfix operators is probably the algebraic notation for squares. $a**2 is perls notation, ($a)N{SUPERSCRIPT TWO} is the Unicode::Overload equivalent, looking much closer to a mathematical expression, with the 2 in its proper position. Outfix is the last operator, and a little odd. Outfix can best be thought of as user-definable brackets. One of the more common uses for this notation again comes from mathematics in the guise of the floor operator. Looking like brackets with the top bar missing, they return effectively POSIX::floor() of their contents. Since outfix operators define their own brackets, extra parentheses are not needed on this type of operator. A quick summary follows: prefix Operator goes directly before the parentheses containing its operands. Whitespace is allowed between the operator and opening parenthesis. This acts like a function call. Sample: N{NOT SIGN}($b) postfix Operator goes directly after the parentheses containing its operands. Whitespace is allowed between the closing parenthesis and operator. This doesnt have a good Perl equivalent, but there are many equivalents in algebra, probably the most common being: Sample: ($a+$b)N{SUPERSCRIPT TWO} infix Operator goes somewhere inside the parentheses. Whitespace is allowed between either parenthesis and the operator. Sample: ($a N{ELEMENT OF} @list) outfix Operators surround their arguments and are translated into parentheses. As such, whitespace is allowed anywhere inside the operator pairs. There is no requirement that the operators be visually symmetrical, although it helps. Sampe: $c=N{LEFT FLOOR}$a_+$bN{RIGHT FLOOR} The requirements for parentheses will be removed as soon as I can figure out how to make these operators behave closer to perl builtins. Nesting is perfectly legal, but multiple infix operators cant coexists within one set of parentheses..

Requirements: No special requirements
Platforms: Linux
Keyword: Floor Left Floor Libraries Operator Operators Parentheses Perl Right Source Filter Superscript Superscript Two Two Unicodeoverload
Users rating: 0/10

License: Freeware Size: 5.12 KB
USER REVIEWS
More Reviews or Write Review


UNICODE::OVERLOAD RELATED
Libraries  -  Filter::decrypt 1.33
Filter::decrypt Perl module contains a template for a decrypt source filter. SYNOPSIS use Filter::decrypt ; This is a sample decrypting source filter. Although this is a fully functional source filter and it does implement a very simple...
40.96 KB  
Libraries  -  perlfilter 5.8.8
perlfilter package contains Perl source filters. This article is about a little-known feature of Perl called source filters. Source filters alter the program text of a module before Perl sees it, much as a C preprocessor alters the source text...
12.2 MB  
Libraries  -  HTTPD::Log::Filter 1.08
HTTPD::Log::Filter is a Perl module to filter entries out of an httpd log. SYNOPSIS my $hlf = HTTPD::Log::Filter->new( exclusions_file => $exclusions_file, agent_re => .*Mozilla.*, format => ELF, ); while( ) { my $ret =...
10.24 KB  
Libraries  -  Template::Alloy::Operator 1.006
Template::Alloy::Operator is a Perl module that provides the regexes necessary for Template::Alloy::Parse to parse operators and place them in their appropriate precedence. It also provides the play_operator method which is used by...
143.36 KB  
Libraries  -  XML::Filter::Mode 0.02
XML::Filter::Mode Perl module can filter out all chunks not in the current mode. SYNOPSIS use XML::Filter::Mode; use strict; my $filter = XML::Filter::Mode->new( Modes => "a,b,c" ); my $filter = XML::Filter::Mode->new( Modes => [qw( a b c...
4.1 KB  
Libraries  -  List::Compare 0.33
List::Compare is a Perl module to compare elements of two or more lists. SYNOPSIS The bare essentials: @Llist = qw(abel abel baker camera delta edward fargo golfer); @Rlist = qw(baker camera delta delta edward fargo golfer hilton); $lc =...
184.32 KB  
Casino Games  -  Duomatic 1
Duomatic is 14 in 1 multigame Game list: black horse dracula draw poker calligula casino chukcha man crazy hounter fruct twist monkey boy piratos super fairy land 5 super garage tarakanos whisky Some games not available in "play for fun" version...
32.02 MB  
Programming  -  Mac TeX Toolbox 201
The Mac TeX Toolbox provides an umbrella for TeX related development for Mac OS X: discussions, pointers to libraries and other support for open source TeX development on Mac OS X.
1.51 MB  
Form Processors  -  Pass Textbox (in frames) 1.1
This script copies the text in a box in the left frame into a box in the right frame when a button is clicked. This is a clever way to pass values in frames.
10 KB  
Programming  -  Net::IP::CMatch 0.02
Net::IP::CMatch is based upon, and does the same thing as Net::IP::Match. The unconditionally exported subroutine 'match_ip' determines if the ip to match ( first argument ) matches any of the subsequent ip arguments. Match arguments may be...
30.72 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB