def sayGoodnight(name)
#result = "Goodnight #{name}"
result = "Goodnight, " + name
return result
end
puts (sayGoodnight ("john-bo"))
Goodnight, john-bo
執行成功
puts sayGoodnight ("john-bo")
Goodnight, john-bo
warning: don't put space before argument parentheses
puts sayGoodnight "john-bo"
Goodnight, john-bo
warning: parenthesize argument(s) for future version
不是說在Ruby中可以不用()的嗎?
爲什麽還會有warning的提示呢
雖然都可以執行成功,但是就是覺得不爽!
第一次修改:
puts sayGoodnight("john-bo")
執行成功,沒有warning出現
原因:
在方法名和()中不能有space
BTW:
不會英文就是有这個壞處,連waring提示都不懂
分享到:
相关推荐
Ruby,一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言,在20世纪90年代由日本人松本行弘(まつもとゆきひろ/Yukihiro Matsumoto)开发,遵守GPL协议和Ruby License。...该版本为ruby-1.8.7-p302
ruby-1.9.2-p290.tar.gz,ruby,redmin,安装,
ruby-debug-ide-0.3.1.gem
ruby-irb-1.8.7.352-13.el6.x86_64.rpm ruby-irb-1.8.7.352-13.el6.x86_64.rpm
mingw32-ruby-1.9.1-wxruby-2.0.1-setup.exe
ruby-debug-base19-0.11.26.gem
ruby-1.9.3-p547.tar.gz
ruby-1.8.7-p358-doc-chm.7z 3.65 MB 1,399 Other Other ruby-1.8.7-p358-i386-mingw32.7z 5.12 MB 1,503 i386 Other rubyinstaller-1.8.7-p358.exe 11.69 MB 13,534 i386 .exe (Windows executable)
Ruby1.8.6 One-Click Installer
ruby186-25 for windows
博客“ruby+selenium-webdriver测试--第一个例子源代码”
ruby-1.9.2-preview1-x64-mswin64_80
ruby-enterprise-1.8.6-20090201.tar for linux
官网原版安装包,官网的下载真的很慢...
ruby-doc-bundle.chm ruby-doc-bundle.chm
ruby-1.8.7-p72-i386-mswin32.zip
ruby-getting-started, 在Heroku上,使用 ruby 入门 ruby-getting-started一个易于部署的Rails 应用程序,可以轻松部署到 Heroku 。这个应用程序支持在Heroku上开始使用 ruby 文章- check查看。在本地运行确保已经...
0积分下载,不允许系统调分-20211115 ruby官方安装包
ruby-debug-ide-0.4.16.gem
ruby-libs-1.8.7.352-13.el6.x86_64.rpm ruby-libs-1.8.7.352-13.el6.x86_64.rpm