Deluge Script wishlist...

Deluge Script wishlist...

Just throwing it out there ;)

1. += operator. Pleeeeease no more var = var + "test";
2. Ternary Operator for if/else. Man I wish I could just go myVar = myVar == "test" ? "it is test" : "it's not test" instead of having to write out a huge if/else block of ugly brackets. 
3. square bracket notation for referring to record fields and map views. 

This would make it terribly hard for Zoho to debug which might break the whole goal of saving new users from themselves. But here's why it would be extremely useful and would really help to lower deluge script bloat. 

fields = {"first_name","last_name","dob"};
for each f in fields
{
      hide input[f]; //this is just an example.. 
}

3. formRecord.toMap(). I dream about this option every time I use Zoho Creator. Converting a record into a map would make deluge script so much more powerful and DRY because you can now dynamically reference field values. You can build configuration/admin pages that don't require the user to touch deluge script to change the behavior of their app. 

validation example. 

bool validation.contact(contactForm c)
{
      fields = validations[name == 'contactForm'];
      no_go = {"", null, "false", false};
      cMap = c.toMap();
      for each f in fields
      {
              if(no_go.contains(f.get(f)))
            {
                  return false;
            }     
      }
      return true;
}

4. Type prototype methods for chaining! 

So functions are great and all but it would be great to be able to create chained methods just like your built in toList, toString methods that way people could write their own helper methods. 

Example. 

string String.myMethod()
{
     return this.doSomething().doSomethingElse();
}

then it's just "testing".myMethod().toXML(); or something like that. 

BTW I just want to say that I think Deluge Script is FANTASTIC. If you are creative enough you can do just about any sort of business logic in Deluge Script. To parse it, run it for bugs, etc must be a super huge head ache! Anyways, just wanted to show some gratitude for what we already get to use. Thanks again! 

-Stephen, @srhyne