[BioRuby] test and bioruby shell questions

Davide Rambaldi davide.rambaldi at ifom-ieo-campus.it
Mon Sep 1 12:18:03 UTC 2008


On Aug 30, 2008, at 2:16 PM, Toshiaki Katayama wrote:

> bioruby> rm :a
>
> Actually, the rm command temporally assign 'nil' to the variable
> because BioRuby shell will avoid to dump variables having 'nil' as  
> its value.
> (This means, the memory will not be returned to the OS until next GC.)
>
> This implementation looks somewhat ugly, so if you have a better  
> idea, please let me know.



Dear Toshiaki,

I have implemented another method (rm2) that extend your rm command  
using a case statement and the === (case equality)

I practice, if he found a String or a Symbol I just call rm(name),  
while if he find an Array, he iterate into the Array to call rm(e) on  
each element:

def rm2(name)
   # check class
   case name
     when String, Symbol : rm(name)
     when Array : name.each do |e| rm(e) end
   end
end

I allow to use this kind of commands: rm2(list=ls())   <-- R console  
style! :P

Put the list of current objects into an Array named list, then remove  
all!
  Obviously is inspired from the R console :P (that have the same  
command)

I have putted him directly into the bin/bioruby.rb file to test and  
seems to work... tell me if is useful! and don't esitate to add him  
to the current code if you think is a good idea.

cheers and best regards!


Davide Rambaldi,
Bioinformatics PhD student.
-----------------------------------------------------
Bioinformatic Group IFOM-IEO Campus
Via Adamello 16, Milano
I-20139 Italy

[t] +39 02574303 066
[e] davide.rambaldi at ifom-ieo-campus.it
[i] http://ciccarelli.group.ifom-ieo-campus.it/fcwiki/DavideRambaldi  
(homepage)
[i] http://www.semm.it             (PhD school)
[i] http://www.btbs.unimib.it/     (Master)

-----------------------------------------------------







More information about the BioRuby mailing list