Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Sort::Maker 0.06

    Download button

    No screenshots available
    Downloads: 298  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Uri Guttman | More programs
    Perl Artistic License / FREE
    August 25th, 2007, 13:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Sort::Maker description

    Sort::Maker is a simple way to make efficient sort subs.

    Sort::Maker is a simple way to make efficient sort subs.

    SYNOPSIS

    use Sort::Maker ;

    my $sorter = make_sorter( ... ) ;

    This module has two main goals: to make it easy to create correct sort functions, and to make it simple to select the optimum sorting algorithm for the number of items to be sorted. Sort::Maker generates complete sort subroutines in one of four styles, plain, orcish manouver, Schwartzian Transform and the Guttman-Rosler Transform. You can also get the source for a sort sub you create via the sorter_source call.

    make_sorter

    The sub make_sorter is exported by Sort::Maker. It makes a sort sub and returns a reference to it. You describe how you want it to sort its input by passing general options and key descriptions to make_sorter.

    Arguments to make_sorter

    There are two types of arguments, boolean and value. Boolean arguments can be set just with the option name and can optionally be followed by '1'. You can easily set multiple boolean general arguments with qw(). Value arguments must have a following value. Arguments can appear in any order but the key descriptions (see below) must appear in their sort order. The code examples below show various ways to set the various arguments.

    Arguments fall into four categories: selecting the style of the sort, key descriptions, setting defaults for key description attributes, and setting general flags and values. The following sections will describe the categories and their associated arguments.

    Sort Style

    The style of the sort to be made is selected by setting one of the following Boolean arguments. Only one may be set otherwise an error is reported (see below for error handling). Also see below for detailed descriptions of the supported sort styles.

    plain
    orcish
    ST
    GRT

    # Make a plain sorter
    my $plain_sorter = make_sorter( qw( plain ) ... ) ;

    # Make an orcish manouevre sorter
    my $orcish_sorter = make_sorter( orcish => 1 ... ) ;

    # Make a Schwartzian Transform sorter
    my $st_sorter = make_sorter( 'ST', 1, ... ) ;

    # Make a GRT sort
    my $GRT = make_sorter( 'GRT', ... ) ;

    Key Attribute Defaults

    The following arguments set defaults for the all of the keys' attributes. These default values can be overridden in any individual key. Only one of the attributes in each of the groups below can be set as defaults or for any given key. If more than one attribute in each group is set, then make_sorter will return an error. The attribute that is the default for each group is marked. See below for details on key attributes.

    ascending (default)
    descending

    case (default)
    no_case

    signed
    unsigned
    signed_float (default)
    unsigned_float

    fixed
    varying

    General Options

    These arguments set general options that apply to how the generated sorter interacts with the outside world.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    sort subs | sort maker | Perl module | sort | subs | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM