Module submission: REV

Module submission: REV

am 03.07.2006 18:32:42 von robby.walker

Hi,

I've written a mini programming language called REV for data
validation. REV stands for Really Easy Validation - and is a language
similar to Perl that can be compiled to Perl, PHP, and JavaScript.
(with more languages on the way) The idea is to write validation code
only once and then compile it to JavaScript and to your server side
language. The language itself is pretty powerful. For example:

error("Please specify a username") if empty ;
error("Please specify a valid email address") unless @ ;

These are the most basic types of statements - they check a given form
field (variables in <>) for a specific condition - if it is empty or if
it is an email (the @ operator). Lots of other data type checks are
available. You can also create temporary variables and use constructs
like loops. Consider a form that uses JavaScript to allow you to add
many email addresses to a mailing list. (i.e. you can click on 'Add
Another Address' and you get another text box) Then, assuming your
JavaScript keeps updating a form field called 'maxIndex' you can use
the following code for validation:

error("Please specify at least one email address"0 unless >
0;
for i ( 1.. ) {
error("Please specify a valid email address in box #" _ i) unless @

}

The compiler is written in Perl and I would like to register the
namespace REV for this module - but of couse I understand the
difficulties involved with top level namespaces. Does anyone object to
this namespace? Or suggest a different one? I'd also like to register
Template::Plugin::REV for generation of JavaScript validation functions
using Text::Template.

For more information you also might visit
rev-validation.sourceforge.net - the current source code is there as
well.

Thanks,
Robby

Re: Module submission: REV

am 03.07.2006 18:36:47 von robby.walker

> error("Please specify at least one email address"0 unless >
> 0;
> for i ( 1.. ) {
> error("Please specify a valid email address in box #" _ i) unless @
>
> }

Please forgive my typo here - the first line should read

error("Please specify at least one email address") unless >
0;

Thanks again,
Robby

Re: Module submission: REV

am 03.07.2006 18:53:22 von Sherm Pendley

"Robby Walker" writes:

> The compiler is written in Perl and I would like to register the
> namespace REV for this module - but of couse I understand the
> difficulties involved with top level namespaces. Does anyone object to
> this namespace? Or suggest a different one?

How about Compiler::REV?

> I'd also like to register
> Template::Plugin::REV for generation of JavaScript validation functions
> using Text::Template.

That sounds about right to me.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

Re: Module submission: REV

am 03.07.2006 20:00:37 von robby.walker

Sherm Pendley wrote:
> "Robby Walker" writes:
>
> > The compiler is written in Perl and I would like to register the
> > namespace REV for this module - but of couse I understand the
> > difficulties involved with top level namespaces. Does anyone object to
> > this namespace? Or suggest a different one?
>
> How about Compiler::REV?

I like Compiler::REV - although there don't appear to be other
Compiler::* modules. So that would be a new root level suggestion too!
In fact, the only things I've seen have been the PHP and JavaScript
root level namespaces - hence my original choice. Thoughts?

Thanks!

- Robby

Re: Module submission: REV

am 04.07.2006 00:32:05 von unknown

Robby Walker wrote:
> Sherm Pendley wrote:
>
>>"Robby Walker" writes:
>>
>>
>>>The compiler is written in Perl and I would like to register the
>>>namespace REV for this module - but of couse I understand the
>>>difficulties involved with top level namespaces. Does anyone object to
>>>this namespace? Or suggest a different one?
>>
>>How about Compiler::REV?
>
>
> I like Compiler::REV - although there don't appear to be other
> Compiler::* modules. So that would be a new root level suggestion too!
> In fact, the only things I've seen have been the PHP and JavaScript
> root level namespaces - hence my original choice. Thoughts?
>
> Thanks!
>
> - Robby
>

What about the Language:: namespace? It appears to contain Basic and
Haskell, as well as less-serious entries such as Brainf**k and Ook.

I have never tried to establish a top-level namespace. Once upon a time
you had to jump through hoops to get any kind of namespace registered,
but it seems to be easier now.

Tom Wyant