Feature Request: Implicit first parameter inside scope expression.

Robert Fraser fraserofthenight at gmail.com
Sat Nov 3 17:38:50 PDT 2007


downs Wrote:

> First, a definition.
> 	A CallableThing shall be either a function, functor, method, delegate,
> function pointer or anything else that supports the foo(parameters) syntax.
> 
> Requested feature:
> 	When inside an index or scope expression, and a CallableThing is called
> with an invalid number or type of parameters, before failing, try to
> call the Thing in question with the object the index or scope belongs to
> as the first parameter.
> 
> What this allows (example):
> 	string foo="I can see you";
> 	string bar=foo[find("can")+3..find("you")]; // " see "
> 
> What this breaks:
> 	Nothing, as it is only triggered in situations which would be an error
> under the current rules.
> 
> What do you think?
>  --downs

Eh, too specific, unexpected and Perl-y for my tastes. Great for hacking out small programs, but in a larger system, this unexpected rule could cause problems for code auditing, etc.



More information about the Digitalmars-d mailing list