[rkward-devel] new JS functions

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Oct 18 15:43:49 UTC 2011


Hi,

On Tuesday 18 October 2011, meik michalke wrote:
> i just added two new JS functions to trunk:
> 
>  - shortName()
>    JS equivalent to rk.get.short.name(), i.e. turn
>    my.data.frame[["var1"]] and my.list[["var1"]][["var2"]]
>    into var1 and var2

what use case do you have in mind for short names inside JS?

>  - getValueShort()
>    a getValue() alternative for varslots, to get an array of
>    short names directly

Well, again, I'm not sure about _short_ names. But a function to make it 
easier to deal with lists of objects would certainly be useful, indeed. 
Perhaps even as compressed as

function getObjectList(id) {
	return ('rk.list (' + getValue(id).split ("\n").join (", ") + ')');
}

> i put them to rkward/scriptbackends/common.js -- is that a good place?

Yes. However, some of the stuff in common.js is not really common (to the R 
code generating JS, and the JS used inside the GUI logic). I'll have to sort 
that out one day.

> i
> could probably come up with some more functions to ease the JS coding part
> for rather common stuff.

Ok, go ahead, but please be somewhat conservative. Once plugins start using 
these functions, they'll be more or less set in stone, so we should be careful 
not to add stuff that are not really needed.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20111018/e98bae6b/attachment.sig>


More information about the Rkward-devel mailing list