From c@@rdi@g@bor @ending from gm@il@com  Tue Oct 16 01:23:59 2018
From: c@@rdi@g@bor @ending from gm@il@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Tue, 16 Oct 2018 00:23:59 +0100
Subject: [Rd] 
 sys.call() inside replacement functions incorrectly returns *tmp*
In-Reply-To: <CAB8pepxoVFZvBnuBFyfyOwTNWTyA_pQOjr4za-zeWmeFTiaBqw@mail.gmail.com>
References: <CAB8pepwA52R9ZKOe7_83BMWzwsQcZ8eKG+wg3ihBL5+Qs5YPOQ@mail.gmail.com>
 <F139A45B-0BDF-41FC-A809-9A00AC2E79A0@dans.knaw.nl>
 <CAB8pepxoVFZvBnuBFyfyOwTNWTyA_pQOjr4za-zeWmeFTiaBqw@mail.gmail.com>
Message-ID: <CABtg=KnzOigd7yQi7NijqoTmyu9n-ZiqOt+vR0QHyrsbLQWKZg@mail.gmail.com>

Seems like there are at least two packages for multiple assignment,
maybe one of them solves your needs, zeallot and dub.

https://r-pkg.org/search.html?q=multiple+assignment

Gabor
On Tue, Oct 16, 2018 at 12:03 AM Abs Spurdle <spurdle.a at gmail.com> wrote:
>
> Kia Ora
>
> > Although I'm not sure what problem it would solve...
>
> Given that you asked, I was interested in writing a multiple assignment
> function as a replacement function, so something like:
> massign (x, y, z) = construct.some list ()
>
> Obviously, that's not possible.
>
> Probably the best example I can think of is converting cartesian
> coordinates to polar coordinates.
> Then we might have something like (note, untested, written in my email):
> cart2polar = function (x, y)
>     list (theta=atan (y / x), r=sqrt (x * x + y * y) )
>
> massign (r, theta) = cart2polar (x, y)
>
> Now, I'm considering a multiple assignment operator, so something like:
> c (theta, r) $<-$ cart2polar (x, y)
>
> And while we're on the topic, I'm also considering an attribute operator
> (to access object attributes), something like:
> myobject%$%myattribute
>
> This would be similar to . in C++/Java or @ in S4.
> And seems like something obvious that's missing from R.
>
> Implementing an attribute read this way is easy, however, implementing an
> attribute assignment this way (without language level support) is difficult.
>
>
> kind regards
> Abs
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] sys.call() inside replacement functions incorrectly returns *tmp*
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=