-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This issue was originally filed by jesse.r...@gmail.com
I can comment for days about the weakness of language extension features most programming languages have which increases coding while reducing readability. Here goes.
Please add custom library operator functions. Examples will make my point. See if you can read the code easily and how it better self documents/mirrors the logic without classes or Lambdas. Compare it to just using dirty functions.
// defined at top level in library
operator between(num low, num high);
operator in(List values);
//Sample usage
if ( customer.age between(18,65) ) {
print("Contact this customer about an insurance policy.");
}
if ( customer.status in(2,3,5) ) {
print("Customer is a VIP, treat him good.");
}
var state = "NJ";
if ( state in(states) ) {
//state is a valid US state in states list.
}