[Rd] [Fwd: opened symbols in libR.so available.]

2009-11-28 Thread Guillaume Yziquel

Hi.

I've patched Dirk Eddelbuettel's Debian package of R, namely r-base, in
order to make hidden symbols of the library libR.so available is now
available:

http://yziquel.homelinux.org/debian/pool/main/r/r-base/

For instance, the mkPROMISE symbol is available:


yziq...@seldon:/usr/lib/R/lib$ nm -D libR.so | grep mkPROMISE
0011f6f0 T Rf_mkPROMISE
yziq...@seldon:/usr/lib/R/lib$ 


Instructions for my personal repository are available here:

http://yziquel.homelinux.org/topos/debian-repository.html

I hope this will be useful to people who wish to develop
things, test things, reverse-engineer things from the libR.so library.

I've been told that there's an interesting scheme, used by r-base-ra, to 
make packages coexist with R. As of now, it simply replaces the Debian 
version number, currently -1, with the Debian version number -1hackable.


All the best,

--
 Guillaume Yziquel
http://yziquel.homelinux.org/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Sending signals to current R process from R running under MS Windows (c.f. Esc)

2009-11-28 Thread Graham Williams
I am using RGtk2 for a simple GUI (rattle).

I start rattle from the RGui and I remain able to interact with the
RGui while rattle runs.

Under MS/Windows, when rattle has initiated some other underlying R
command the rattle GUI remains responsive (unlike under GNU/Linux
where it is not responsive until the underlying command completes).

I can interrupt the running command with a press of the Esc key in the RGui.

I want to have a button on the rattle GUI to run an R command to have
the same behavior as pressing the Esc key in the RGui. I currently
have a button in rattle as an example that will run another R command
whilst the original R command is still running.

Looking at the C source code for the RGui it looks like it is sending
a SIGBREAK signal to the R process.

Is this possible to do, somehow, from R?

Thanks,
Graham

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Sending signals to current R process from R running under MS Windows (c.f. Esc)

2009-11-28 Thread Henrik Bengtsson
Hi,

here is some discussion/information in the same vein:

(1) R-help thread '[R] The R "fork"', March 18, 2006:

  https://stat.ethz.ch/pipermail/r-help/2006-March/101913.html

(2) R-devel thread '[Rd] New simpleExit() condition (Was: Re: Can
example() code stop the example without generating an error?)', March
14-16, 2006:

  https://stat.ethz.ch/pipermail/r-devel/2006-March/036861.html

(3) Regarding sending SIGINT on Windows, I posted the following
question (without replies): 'Fix Unix' thread 'Sending/generating
SIGINT to process', Oct 1, 2007:

 
http://fixunix.com/microsoft-windows/30232-sending-generating-sigint-process.html

/Henrik

On Sat, Nov 28, 2009 at 10:54 AM, Graham Williams
 wrote:
> I am using RGtk2 for a simple GUI (rattle).
>
> I start rattle from the RGui and I remain able to interact with the
> RGui while rattle runs.
>
> Under MS/Windows, when rattle has initiated some other underlying R
> command the rattle GUI remains responsive (unlike under GNU/Linux
> where it is not responsive until the underlying command completes).
>
> I can interrupt the running command with a press of the Esc key in the RGui.
>
> I want to have a button on the rattle GUI to run an R command to have
> the same behavior as pressing the Esc key in the RGui. I currently
> have a button in rattle as an example that will run another R command
> whilst the original R command is still running.
>
> Looking at the C source code for the RGui it looks like it is sending
> a SIGBREAK signal to the R process.
>
> Is this possible to do, somehow, from R?
>
> Thanks,
> Graham
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] "bug report" field in DESCRIPTION file?

2009-11-28 Thread Duncan Murdoch

On 26/11/2009 12:38 PM, Barry Rowlingson wrote:

On Thu, Nov 26, 2009 at 1:39 PM, Duncan Murdoch  wrote:


This sounds like a good idea, though I would add a "package" parameter to
the bug.report() function, rather than creating a new function.


I'm sure when I did help.search("bug") and help.search("report") this
morning I didn't see this function! Otherwise I would have suggested
that. bug.report(package="bazbrain"). Oh dear, no maintainer.


Does the logic below sound right for bug.report() with the package
specified?

If there's a BugReports field, bug.report() calls browseURL() on that page.

If not, it does more or less what it does now, but
- it defaults "address" to the package maintainer. - it adds a line in the
intro to the message pointing to the URL field if there was one.


 Martin Maechler's reservation about not being able to fill in the R
details for bug reports on trackers isn't too much of a problem, since
the bug tracker form could have fields for R version, session info
etc, or at least a big warning saying "Please include the following
info" (inside a  tag).

 So how about if bug.report(package="foo") has a BugReports: field,
you print out 'The following information may be useful to your bug
report' and dump the relevant things ready for cut n paste into a bug
tracker, then browseURL().


I've just committed this to R-devel.  Thanks for the suggestion, and 
thanks in advance for any improvements.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Display list redraw incomplete

2009-11-28 Thread Benilton Carvalho
Hi,

I'm observing the following warning with R-2.10.0 on a machine I have remote 
access to. Like what happened to Roger ( 
http://www.mail-archive.com/r-devel@r-project.org/msg08669.html ), two extra 
instances of X11 are open after dev.off(). Although I'm reporting this on 
R-2.10.0, it's reproducible on R-devel r50541. Any thoughts about this?

Thanks a lot for any info,

b

> plot(1)
> dev.off()
X11 
  4 
Warning message:
In dev.off() : Display list redraw incomplete
> sessionInfo()
R version 2.10.0 (2009-10-26) 
x86_64-unknown-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.iso885915   LC_NUMERIC=C  
 [3] LC_TIME=en_US.iso885915LC_COLLATE=en_US.iso885915
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.iso885915   
 [7] LC_PAPER=en_US.iso885915   LC_NAME=C 
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C   

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base 
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] PROTECT and OCaml GC.

2009-11-28 Thread Guillaume Yziquel

Hello.

In the writing of my OCaml-R binding, I'm sort of confused when it comes 
to the use of the PROTECT and UNPROTECT macros.


Basically, I have C stub functions that are in charge of calling R for 
everything. Here's a simple example:



CAMLprim value r_findvar (value symbol) {
  /* The findVar function is defined in envir.c. It looks up a symbol
 in an environment. */
  CAMLparam1(symbol);
  CAMLreturn(Val_sexp(findVar(Sexp_val(symbol), R_GlobalEnv)));
}


This simply makes a call to findVar and returns the value to Objective 
Caml. It seems to me that I should be writing:



CAMLprim value r_findvar (value symbol) {
  /* The findVar function is defined in envir.c. It looks up a symbol
 in an environment. */
  CAMLparam1(symbol);
  SEXP e;
  PROTECT(e = findVar(Sexp_val(symbol), R_GlobalEnv));
  CAMLreturn(Val_sexp(e));
}


However, as OCaml has its own GC, I'm wondering where to put UNPROTECT. 
Many codes I see on the net UNPROTECT the value just after it has been 
protected. The rationale, it seems, is that the value is at risk only a 
short timeframe after it has been created.


This seems rather curious to me, and I'm wondering if I should not 
rather UNPROTECT the value at the moment OCaml's GC says the value is 
not needed anymore.


Please tell me which option I should go forward with.

(I'll assume for now that OCaml is monothreaded. I do not believe that R 
itself is thread-safe, so I'll first handle this monothreaded case.)


All the best,

--
 Guillaume Yziquel
http://yziquel.homelinux.org/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] PROTECT and OCaml GC.

2009-11-28 Thread Whit Armstrong
I've had success w/ using a reference counting paradigm in which the outside
memory manager calls UNPROTECT_PTR(R_object_); in its destructor.

So, in my case (using c++ ) if objects are allocated on the heap, which
allocate R objects as their backend storage, I don't have to worry about out
of order UNPROTECT calls b/c UNPROTECT_PTR will just put the objects that
c++ destroys on the gc list.

If you are using c as the glue for all your ocaml bindings, they you may
want to have a look at this:
http://github.com/armstrtw/rabstraction

Or the in progress re-write here: http://github.com/armstrtw/RObjects

-Whit


On Sat, Nov 28, 2009 at 6:50 PM, Guillaume Yziquel <
guillaume.yziq...@citycable.ch> wrote:

> Hello.
>
> In the writing of my OCaml-R binding, I'm sort of confused when it comes to
> the use of the PROTECT and UNPROTECT macros.
>
> Basically, I have C stub functions that are in charge of calling R for
> everything. Here's a simple example:
>
>  CAMLprim value r_findvar (value symbol) {
>>  /* The findVar function is defined in envir.c. It looks up a symbol
>> in an environment. */
>>  CAMLparam1(symbol);
>>  CAMLreturn(Val_sexp(findVar(Sexp_val(symbol), R_GlobalEnv)));
>> }
>>
>
> This simply makes a call to findVar and returns the value to Objective
> Caml. It seems to me that I should be writing:
>
>  CAMLprim value r_findvar (value symbol) {
>>  /* The findVar function is defined in envir.c. It looks up a symbol
>> in an environment. */
>>  CAMLparam1(symbol);
>>  SEXP e;
>>  PROTECT(e = findVar(Sexp_val(symbol), R_GlobalEnv));
>>  CAMLreturn(Val_sexp(e));
>> }
>>
>
> However, as OCaml has its own GC, I'm wondering where to put UNPROTECT.
> Many codes I see on the net UNPROTECT the value just after it has been
> protected. The rationale, it seems, is that the value is at risk only a
> short timeframe after it has been created.
>
> This seems rather curious to me, and I'm wondering if I should not rather
> UNPROTECT the value at the moment OCaml's GC says the value is not needed
> anymore.
>
> Please tell me which option I should go forward with.
>
> (I'll assume for now that OCaml is monothreaded. I do not believe that R
> itself is thread-safe, so I'll first handle this monothreaded case.)
>
> All the best,
>
> --
> Guillaume Yziquel
> http://yziquel.homelinux.org/
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] PROTECT and OCaml GC.

2009-11-28 Thread Guillaume Yziquel

Whit Armstrong a écrit :

I've had success w/ using a reference counting paradigm in which the outside
memory manager calls UNPROTECT_PTR(R_object_); in its destructor.

So, in my case (using c++ ) if objects are allocated on the heap, which
allocate R objects as their backend storage, I don't have to worry about out
of order UNPROTECT calls b/c UNPROTECT_PTR will just put the objects that
c++ destroys on the gc list.

If you are using c as the glue for all your ocaml bindings, they you may
want to have a look at this:
http://github.com/armstrtw/rabstraction

Or the in progress re-write here: http://github.com/armstrtw/RObjects

-Whit


Thanks a lot for these pointers.

UNPROTECT_PTR seems quite interesting. As I understand it, it avoids 
caring about protecting and unprotecting in the order the stacks would 
expect. This is quite interesting, since I'd like to keep OCaml's GC to 
do housekeeping, and not rely on referencing counting.


I'm using C as the glue, but I want it to be as thin as possible. I will 
probably not do reference counting in C, for instance. Nevertheless, 
there's obviously good ideas in rabstraction/RObjects that I'll adapt.


Thanks a lot.

--
 Guillaume Yziquel
http://yziquel.homelinux.org/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel