Ich muss sagen, dass mir Ruby als Programmiersprache immer mehr gefaellt. Irgendwie hat das ganze eine Leichtigkeit, die man in anderen Sprachen vermisst.
#!/usr/bin/ruby
block = lambda {|x,y| x.times {puts y}}
block.call(5,"fooBar")
block = lambda {|x,y| x.times {puts y}}
block.call(5,"fooBar")
Diese zwei Zeilen Rubycode geben einfach 5 mal "fooBar" aus.
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
print "fooBar\n"x5;
finde ich irgendwie besser
BTW: Deine Kommentarfunktion geht nicht mehr als Gast. Liegt wohl am Antispam/Math Plugin.
#!/usr/bin/ruby
print "fooBar\n" * 5
Zudem waere 5.times{ puts "fooBar" } um einiges besser lesbar.
Flattr
Spenden für roothausen:
Calendar
| « | September '10 | » | ||||
| Mo | Tu | We | Th | Fr | Sa | Su |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
Quicksearch
Kategorien
Links
Tags
android bad world blog blogging browser changes code comic computer contentmanagement encryption feedreader firefox free fun google gui hardware howto html im jabber java life lighttpd linux linux&unix markup media misc mobile murphy networking newsbeuter opensource picture politics presentation privacy programming regular expression rss ruby s9y screenshot sdk security server shortys software stuff tail -f /var/log/life test tool tv unix video web webdesign webwide windows xml zeitgeist
del.icio.us
- LoL Shield
- Pragmatic CSS3 -webit-transform matrix3d Tutorial
- Courses - Google Code University - Google Code
- Scheme and Functional Programming Workshop 2006 - Report
- visionmedia's masteringnode at master - GitHub
- The Structure and Interpretation of Computer Programs | Berkeley Video Course
- .: Sammy :: Quirkey.com :: Code :: :: Quirkey NYC, LLC :: Aaron Quint :: Web Developer :: Brooklyn, NY :.
- etckeeper
- substack's dnode at master - GitHub
- robrighter's node-boilerplate at master - GitHub
- LLVM Tutorial: Table of Contents
- Let's Build a Compiler
- Writing a compiler in Ruby bottom up - step 1/??
- The Complete Work of Charles Darwin Online
- Greg's Cable Map

