in reply to
Re^3: Autoboxing ... "Yes We Can" ( or how I learned to love TIMTOWTDI )
in thread Autoboxing ... "Yes We Can" ( or how I learned to love TIMTOWTDI ;)
(Slightly delayed response...)
I think your critic doesn't apply to mutators, where the first arg IS special.
I hadn't really thought of it this way, since $x->y(...)
is proposed to be used in so many other ways (e.g. @array->grep(/blah/)
). This almost makes me want to propose an $x op= ...
syntax to make the intent explicit, but that way lies pain and bike-shedding.
Additionally in cases where dereferencing is needed,
As long as this doesn't violate the basic Perl principle that operators determine operand type, it's fine -- I have no problem with auto-deref.
Could you plz elaborate, I don't know Common Lisp, (only eLISPš)?
As a fellow Elisp user and Emacs lover...
In Common Lisp, a function call always looks like (NAME ARG...). So x = y is (setq x y) (or (set (quote x) y). When they added "OO", they kept that syntax, so $x->f(...) became (f $x ...). But they did better: if the meaning of "f" depended upon more than its first argument (like addition, or exponentiation, or some comparisons), then it still used (f ...) syntax, but let the programmer specify rules to decide what to do based on any subset of the parameters.
Of course, this being Lisp, it became something hairy, but see "CLOS" for the details.