[RkWard-devel] Code generated for "multi action" plugins

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Jan 5 14:07:55 UTC 2007


On Friday 05 January 2007 01:03, SJR wrote:
> I wonder how many people ever will reuse the code. However, it's nice to
> have this option. And if mentioned here and there users will make use of it
> I guess. Most users see in RKWard a GUI to R anyway and not the
> sophisticated IDE. Therefore most will prefer to click here and there to
> get a result. At least this is my perception.

My perception is that at this moment, most of our current user base uses 
RKWard mostly as an IDE. I believe the proportions will start to shift, 
however, with the addition of more plugins. But of course the ultimate 
objective is to produce a program that suits both types of users.

> I'm not totally sure but think the second approach is the winner for me.
> Maybe some trying and examples will help me to get totally convinced.  ;)

Ok. So we both lean to the same direction here, and unless someone voices 
objections, I'll start modifying the existing plugins to use this approach 
(and to use rk.header () and rk.results). I intend to start working on this 
on Sunday afternoon. Maybe, around that time, you could give me a note, which 
plugins you are currently actively working on, so I can omit those until you 
have done your changes, and we don't interfere with each other too badly.

Examples:
I have taken the descriptive statistics plugin, and converted it accordingly. 
This one has a lot of "optional actions", so it is rather different, now. The 
changes done are visible, here: 
http://rkward.svn.sourceforge.net/viewvc/rkward/trunk/rkward/rkward/plugins/descriptive/descriptive_statistics.php?r1=1058&r2=1064

This may look a bit scary in the diff, but the real meat is this:

rk.temp.options <- list (dofoobar=<? getRK_val ("foobar"); ?>
[...]
if (rk.temp.options$dofoobar) rk.temp.results$foobar <- foobar (x)

is changed into:

# no need to define a list of options in R
[...]
<? if (getRK_val ("foobar")) { ?>
rk.temp.results$foobar <- foobar (x)
<? } ?>

So what really happens, is that the if clause is moved into PHP.

> Policies and conventions are really important but don't forget to state
> them somewhere.

Good point. I've added a large note at the top of the TODO file. Before the 
next release, I will rework the documentation accordingly, adjusting the 
examples, and adding a section on policies and conventions.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070105/467698e5/attachment.sig>


More information about the Rkward-devel mailing list