JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Languages on JVM » JRuby  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:基本命名規則 [Re:cpi]
T55555

Java, Ruby, Haskell

版主

發文: 1026
積分: 24
於 2006-03-15 01:57 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
BTW ....

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class A
  p self == A
  x = self
  y = A
  
  def self.m1; p "class method #1"; end
  def A.m2;    p "class method #2"; end
  def x.m3;    p "class method #3"; end
  def y.m4;    p "class method #4"; end
end
 
A.m1
A.m2
A.m3
A.m4
 
p A.public_methods.select {|m| m =~ /^m/}.sort


output:
1
2
3
4
5
6
true
"class method #1"
"class method #2"
"class method #3"
"class method #4"
["m1", "m2", "m3", "m4", "method", "method_defined?", "methods", "module_eval"]


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
2421 基本命名規則 cpi 1682 2006-03-15 01:02
2033 Re:基本命名規則 T55555 512 2006-03-15 01:57
» JWorld@TW »  Languages on JVM » JRuby

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8