[#30722] JSON ライブラリの取り込み — "NARUSE, Yui" <naruse@...>

naruseです。

20 messages 2007/04/21

[ruby-dev:30713] sampleのTRUEとFALSEをtrueとfalseに

From: Kazuhiro NISHIYAMA <zn@...>
Date: 2007-04-16 11:11:11 UTC
List: ruby-dev #30713
西山和広です。

http://jp.rubyist.net/magazine/?0013-CodeReview#l12
のときにsample以下に残っていると思っていたのをるびま本で
また読んだら思い出したので、パッチを書いてみました。
branches/ruby_1_8用です。


-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)

Attachments (1)

sample.diff (1.94 KB, text/x-diff)
Index: sample/dualstack-httpd.rb
===================================================================
--- sample/dualstack-httpd.rb	(revision 12182)
+++ sample/dualstack-httpd.rb	(working copy)
@@ -26,7 +26,7 @@
     ls = mysock	# copy to dynamic variable
     t = Thread.current
     STDERR.print "socket #{myname} listener started, pid #{$$} thread #{t}\n"
-    while TRUE
+    while true
       as = ls.accept
       Thread.start do
 	STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n"
Index: sample/from.rb
===================================================================
--- sample/from.rb	(revision 12182)
+++ sample/from.rb	(working copy)
@@ -26,7 +26,7 @@
 end
 
 if ARGV[0] == '-w'
-  wait = TRUE
+  wait = true
   ARGV.shift
 end
 
Index: sample/regx.rb
===================================================================
--- sample/regx.rb	(revision 12182)
+++ sample/regx.rb	(working copy)
@@ -3,7 +3,7 @@
 #st = "<<"
 #en = ">>"
 
-while TRUE
+while true
   print "str> "
   STDOUT.flush
   input = gets
Index: sample/cbreak.rb
===================================================================
--- sample/cbreak.rb	(revision 12182)
+++ sample/cbreak.rb	(working copy)
@@ -6,11 +6,11 @@
 TIOCSETP = 0x80067409
 
 def cbreak ()
-  set_cbreak(TRUE)
+  set_cbreak(true)
 end
 
 def cooked ()
-  set_cbreak(FALSE)
+  set_cbreak(false)
 end
 
 def set_cbreak (on)
Index: sample/eval.rb
===================================================================
--- sample/eval.rb	(revision 12182)
+++ sample/eval.rb	(working copy)
@@ -1,6 +1,6 @@
 line = ''
 indent = 0
-$stdout.sync = TRUE
+$stdout.sync = true
 print "ruby> "
 loop do
   l = gets
Index: sample/philos.rb
===================================================================
--- sample/philos.rb	(revision 12182)
+++ sample/philos.rb	(working copy)
@@ -25,7 +25,7 @@
 end
 
 def philosopher(n)
-  while TRUE
+  while true
     think n
     $forks[n].lock
     if not $forks[(n+1)%N].try_lock

In This Thread

Prev Next