Displaying 2 results from an estimated 2 matches for "populate_list".
2004 Feb 28
1
when .Call can safely modify its arguments
...s arguments. However I wonder if
there are exceptions to this rule, i.e. when .Call can safely modify the
arguments. For example when a function creates a list that is then
populated by a call to a C function:
getData <- function() {
data <- list(a=double(2), b=character(3))
# now populate_list modifies data
.Call("populate_list", data)
data
}
What can go wrong in this example?
And while we are here I wonder what happens to 'data' when getData()
returns it. Is it copied or some more efficient mechanism is used?
Thanks,
Vadim
[[alternative HTML versio...
2008 Feb 22
12
DRY - in controller or model????
Hello.
I''m trying to make clean efficient code and would like to find out if
there is a "BEST" way to write code. I want this to run quickly and
efficiently for my app.
I''ve got a form that needs a select list created for new and edit
functions. Same list.
Do I do this in the controller and reference @list in the forms?
def new
@list = %w { apple orange banana }