Displaying 20 results from an estimated 200 matches similar to: "forcing evaluation of a char string argument"
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all,
Assume that I have an S4 class "MyClass" with a slot "myname", which
is initialized to: myname="" in method("initialize"):
myclass <- new("MyClass", myname="")
Assume that class "MyClass" has a method "mymethod":
"mymethod.MyClass" <-
function(object, myname=character(0), ...) {
2012 Aug 03
1
Interaction between callNextMethod() and selectMethod()
Hi,
Strange things happen. Here is a simple example:
> setClass("A", contains="integer")
> setMethod("as.matrix", "A", function(x, ...) t(callNextMethod()))
Creating a generic function for ?as.matrix? from package ?base? in
the global environment
[1] "as.matrix"
> a <- new("A", 1:3)
> as.matrix(a)
2002 Nov 05
1
function showMethods and inheritance
Hi,
The following question might come from my (deep) misunderstanding
of the concepts in the package 'methods'.
I have a class 'A', and a class 'B' inheriting 'A' (so defined
with 'setClass' and the parameter 'contains="A"'. The class
A has a method 'mymethod'. A call to 'showMethods("mymethod")'
return the
2017 Sep 22
2
S4 method implementation for S3 class
Hi all,
I'm trying to implement the matrix multiplication operator, which is
S4 generic, for an old-style S3 class. The following works as
expected:
x <- 1:10
class(x) <- "myClass"
setOldClass("myClass")
setGeneric("myMethod", function(x, y) standardGeneric("myMethod"))
setMethod("myMethod", c("myClass", "myClass"),
2016 Nov 24
3
llvm optimizer turning musttail into tail
I've got some calls like:
musttail call void bitcast (i32 (i32, i8*, %Type*)* @MyMethod to void
(i32, i8*)*)(i32 %0, i8* %1)
ret void
Into something like:
%8 = tail call i32 @MyMethod(i32 %0, i8* %1, %Type* null)
ret void
I realize I'm losing a parameter there, but this is an interface jump
trick I use and relies on the end code being a 'jmp' (x86). I realize i
can probably
2007 Mar 16
1
sort_link_helper and cross-controller partials
Hello Rubyists,
I ran into a problem with sorting a table (rendered in a partial) using
the sort_link_helper methods after I have submitted data and re-rendered
the table through an AJAX request.
The setup is a follows:
The table is a shared partial of Controller1 and Controller2 accessible
via "shared/table". The AJAX''ed sorting using the sort helper works all
fine on
2006 Aug 10
1
Passing parameters defined in a function or something
Hi,
I have method I want to call ... it can receive * number of parameters.
I also have 3 parms that I want to pass often, so I have defined them in
a separate function:
def my_params
{ :parm1 => 1, :parm2 => 2, :parm3 => 3 }
end
And I want to call my method like this:
mymethod :parm4 => 4, my_params
Now - this doesn''t work - as my_params is a hash of params, which
2016 Nov 27
3
llvm optimizer turning musttail into tail
r287955 seems like it might be related.
-- Sean Silva
On Sat, Nov 26, 2016 at 4:06 PM, Sean Silva <chisophugis at gmail.com> wrote:
> This sounds buggy to me. What pass is doing this?
>
> -- Sean Silva
>
> On Thu, Nov 24, 2016 at 5:39 AM, Carlo Kok via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> I've got some calls like:
>>
2005 Dec 29
2
Access rails logger from plain class
How can I "get" the rails logger from a plain class, that is a class
that does not inherit from a rails class?
I have tried using RAILS_DEFAULT_LOGGER (see below) but it''s nil
class MyClass
logger = RAILS_DEFAULT_LOGGER
def myMethod
logger.debug("stuff...")
end
end
--
Posted via http://www.ruby-forum.com/.
2009 Sep 07
1
some (minor) Rd issue: line breaking in \S4method within \usage{}
Hi,
this is perhaps not so much an issue, but as you are currently
working on the Rd parser anyway...
When you want to document specific S4 methods for an S4 generic
by \S4method{} within a \usage{} environment, and the second
(signature_list) argument is "long", be it because you use multiple
dispatch, be it because you use long class-names, (or both), one
would probably like to be
2011 Apr 05
1
super basic questions about S4 classes
Apologies for asking something that is probably super obvious, i just started
with S4 classes and i guess i am not finding documentation that layout the
grammar rules and give enough examples. Some questions i am having are these
1. I understand that main method of writing a member function is to write a
generic function and setMethod for this particular object. This, however,
presumes that there
2011 Jun 01
1
Overloading S4 methods
Dear all,
I am experiencing some problems with S4 method overloading. I have
defined a generic for graphics:plot, using
setGeneric("plot", useAsDefault = plot)
and with
importFrom('graphics', 'plot') and
exportMethods('plot') in the NAMESPACE file of pkg A.
I then proceed to define a method for signature c('myS4class',
'missing'). This works
2004 Dec 18
2
Active ftp connection
Hello dear friends...
I have a trouble. My FTP server must have an active ftp connection.
It means what in ipfw rules I must allow outgoing connections(like ipfw add
allow tcp from me to any keep-state).
But I don't want use this rule. I want to restrict my outgoing connections. Is
FreeBSD have a feature for this situation?
P.S.
Only for test we developed little root-kit, which can use
2017 Sep 22
0
S4 method implementation for S3 class
The %*% function is a primitive. As it says in the documentation under
?Methods_Details
Methods may be defined for most primitives, and corresponding
metadata objects will be created to store them. Calls to the
primitive still go directly to the C code, which will sometimes
check for applicable methods. The definition of ?sometimes? is
that methods must have been detected
2007 Dec 20
3
What is $super
Greetings,
I had a question about the $super argument that I wasn''t
able to find in documentation, searching etc. What exactly is the
$super argument. Is it a reference to the super class''s prototype
function? Or is it an instantiated object of the super class that is
passed to the subclass''s method?
I am completely confuzzled on this one, my typical
2004 Mar 30
12
Big question: Move to SWIG?
A few days ago, someone asked me why I am using wxpp instead of SWIG.
The question prompted me to revisit and re-evaluate SWIG, and I now
believe it would be best to convert wxRuby to SWIG.
SWIG has greatly improved its C++ support since the last time I looked
at it, and I think its Ruby support has improved quite a bit as well.
Also, now that I have written wxpp, I understand the nature of
2009 Nov 23
1
OOP with Encapsulated Class Definitions
Hi all,
I'm seeking feedback (good, bad or indifferent) in regards to
developing (further) a new class system for R, that uses encapsulated
class definitions (i.e. the method definitions are literally inside
the body of the class definition).
A working (however very rough and poorly tested) system is available
in my R package "oosp" with documentation in the vignette
2003 May 19
3
how to run R as a daemon
Hi all,
Using R a as a real-time application called by Php for a website, I
would like to run one R process only, which would manage user
connections. For the time each user who asks for an analysis causes a
new R process to start, which is not suitable in prevision of many
users. R needs about 30 seconds to run the script which makes the
analysis. The problem is that this waiting time is n
2006 Jul 26
1
Calling another method in the same controller
Hi, probably this is realy simple, but for some reason i don''t see it.
probably i still don''t think object orriented :)
lets say i have a piece of code which generates an array based on a few
inputs.
within a controller i want to use this code to generate three arrays,
all based on different input variables how do i do that?
can i call another method within a method? if so,
2007 Mar 15
3
Inherited S4 methods
Dear all,
Recently, there was a question to use the same method for more than one
class:
https://stat.ethz.ch/pipermail/r-devel/2007-March/044809.html
I have a variation of this question:
Is it possible to use the same function name, e.g. "myfunction" in both,
an S4
baseClass and derivedClass. The method "myfunction" in derivedCalss should
extend the functionality defined