From guillaume.yziquel at citycable.ch  Tue Dec  1 11:48:54 2009
From: guillaume.yziquel at citycable.ch (Guillaume Yziquel)
Date: Tue, 01 Dec 2009 11:48:54 +0100
Subject: [Rd] PROTECT and OCaml GC.
In-Reply-To: <4B14E2FA.8000302@citycable.ch>
References: <4B11B75C.9070806@citycable.ch>
	<8ec76080911281625q5d5b8824hefb14af9b23d29f0@mail.gmail.com>
	<4B11C55E.2060909@citycable.ch>
	<F11B6C18-26EC-41F8-9EEB-A614D16945AC@r-project.org>
	<4B12C417.1050308@citycable.ch>
	<65D411CD-34C3-4B89-8FF0-98C9BD7613FB@r-project.org>
	<4B13FC0F.40604@citycable.ch>
	<F60B92C3-5989-404C-8FEB-1B6002824449@r-project.org>
	<4B140B7A.2080102@citycable.ch>
	<0A1D8E9D-0BD6-40F7-B98C-59075CE04E49@r-project.org>
	<4B143401.4050607@citycable.ch>
	<7971A8AF-189B-4955-9E62-4E118E594792@r-project.org>
	<4B14E2FA.8000302@citycable.ch>
Message-ID: <4B14F496.5000001@citycable.ch>

Guillaume Yziquel a ?crit :
> 
> One last thing, concerning the use of promises. If I do install, 
> findVar, without forcing the resulting promise, and then construct the 
> call, I get a failure:
> 
>> # R.eval_langsxp (R.langsxp_of_list [(R.symbol "str"); (R.symbol 
>> "lm")] 2);;
>> Erreur dans function (object, ...)  :   function g?n?rique incorrecte 
>> dans 'UseMethod'
>> Exception: Failure "OCaml-R error in r_eval_sxp C stub.".
> 
> If I force the promises:
> 
>> # R.eval_langsxp (R.langsxp_of_list [(R.force (R.symbol "str")); 
>> (R.force (R.symbol "lm"))] 2);;
>> function (formula, data, subset, weights, na.action, method = "qr", 
>>     model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, 
>>     contrasts = NULL, offset, ...)  - : R.sexp = <abstr>
> 
> It works.
> 
> So you may say that "I'm not constructing it right", I still believe 
> that describing precisely what kind of arguments is accepted by eval 
> would a good thing.

It seems that Matjaz Kukar had the same kind of issue that I have with 
usemethod:

	http://tolstoy.newcastle.edu.au/R/devel/04/10/0902.html

I just remark two things from the resulting thread:

-1- He asks where to find a more precise documentation of the R API, 
which is also something I'd be looking for,

-2- He has been suggested to use findVar1, which doesn't seem to be part 
of the API.

Will be looking into findVar1, findFun, findVar, though I do not 
understand why this fails in my case. Please feel free to enlighten me.

All the best,

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



[Rd] PROTECT and OCaml GC.
Guillaume Yziquel