Am 16.02.2015 00:05 schrieb "Rowan Collins" <rowan.coll...@gmail.com>:
>
> A quick thought - if you want to stick with the "magic static call"
pattern, you can implement this much more simply by doing something similar
to Laravel's "facades" [1]:
>...
> This basically implements in userspace what you propose to add to the
language, with the only caveat being that you must separate the concerns of
adding extra functionality, and wrapping it in a static facade, into two
separate classes.

That was one of my intermediate steps before reaching the current approach,
but it irked me that when switching code from MyRedis static/singleton
usage to real instance usage I suddenly have to write a different class. In
my scheme, where I can use red_global::get() I can as well use $redis = new
red_global(); $redis->get(); without thinking about how that companion
class was named.

Sure, no big issue. But a small one... By itself, surely not enough reason
for a language change :)
It's all a question of how many other small such uses there would be.

best regards
  Patrick

Reply via email to