Login

    Register

This is to notify all, that we will be decommissioning http://riaforge.org/ ("Site") soon. This decision has been taken due to business reasons. If you are interested in reviewing or downloading any project or files available at Site, please do so, by April 16, 2019, 12 noon PST , as per license terms associated therewith. Past that, you will not be able to access the projects or files.Should you have any concerns/suggestions/query, feel free to Contact Us.
Managed Hosting

PROJECT CATEGORIES

 

Pattern
Project Home Wiki Known Issues Screenshots Contact Project

Author: RocketBoots (All RIAForge projects by this author)
Last Updated: April 23, 2015 12:57 AM
Version: 0.1
Views: 12,389
Downloads: 216
License: LGPL (GNU Lesser General Public License)

Description:

Pattern is a CFC that supports pattern-based assignment, assertions and flow control, for instance:

...p.match(''{a = c, b = d}'', {a = 1, b = 2}, variables);

will assign the value 1 to c, and 2 to d;

...p.match(''{type = 'member',
......firstname = firstName,
......surname = surname}'',
......people[i],
......variables);

will assign people[i].firstname to firstName and people[i].surname to surname, but only if people[i].type = 'member' - otherwise it will throw a NO_MATCH error. There's much more (check out the project wiki), and it's implemented with efficiency in mind.

It's like extending regular expression sub-expression matching to things other than strings. You could describe it as the love-child of cfset, cfif and cfswitch with super powers. It will change the way you write CFML.

The idea is not new - I first encountered it in the Erlang and more recently Elixir programming languages, but it has been implemented in many other languages, usually of the functional or declarative kind.

When I'm using languages other than Erlang I find that this is the feature I miss the most, which is why I created this library. It was developed on Railo 4 but should work with any of the closure-supporting CFML engines with minor tweaks. There is an extensive MX-Unit test case included if you want to migrate to another engine - I'll gratefully accept any contributions provided.

See the wiki for a tutorial. The tutorial is included in the download in .html and .md formats.

Last Update:

Release 0.1

Requirements:

Railo 4

Issue Tracker:

There are no issues for this project.

To enter issues for this (or any other) project, you must be logged in.


This is to notify all, that we will be decommissioning http://riaforge.org/ ("Site") soon. This decision has been taken due to business reasons. If you are interested in reviewing or downloading any project or files available at Site, please do so, by April 16, 2019, 12 noon PST , as per license terms associated therewith. Past that, you will not be able to access the projects or files.Should you have any concerns/suggestions/query, feel free to Contact Us.