Ruby Magic

  • Impressum
  • Administration
  • Kontaktformular
  • Jabber
  • Tagcloud
  • Twitter
  • Soup
  • Github

roothausen

Ruby Magic

01:28

Friday, May 9. 2008

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")

Diese zwei Zeilen Rubycode geben einfach 5 mal "fooBar" aus.

Posted by admin in computer | Comments (4) | Trackbacks (0)
Defined tags for this entry: programming, ruby, software, stuff
Related entries by tags:
  • The VP8 Video Codec
  • My Bachelor Thesis: Scale the realtime web
  • Distributed contact management using HTTP
  • Gesichtserkennung/Eigenfaces
  • Scala - A Scalable Language
< Javascript VI | Kommentarfunktion ist repariert >

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

*#!/usr/bin/perl
print "fooBar\n"x5;

finde ich irgendwie besser ;-)

BTW: Deine Kommentarfunktion geht nicht mehr als Gast. Liegt wohl am Antispam/Math Plugin.

#1 matthias on 2008-05-09 14:37 (Reply)

*Oder eben in ruby:


!/usr/bin/ruby

print "fooBar\n" * 5

#2 Uwe Hermann (Homepage) on 2008-05-11 02:56 (Reply)

*Im allgemeinen ging es mir mit dem Post nicht darum zu zeigen wie man am einfachsten 5 mal die selbe Zeile ausgibt, sondern ich wollte nen einfaches Beispiel fuer Closures in Ruby zeigen.

Zudem waere 5.times{ puts "fooBar" } um einiges besser lesbar. ;-)

#3 pfleidi (Homepage) on 2008-05-11 16:54 (Reply)

*Ich finde weder das eine noch das andere schön. Ist zwar wirklich praktisch, aber sauber ist das nicht.

#4 alk (Homepage) on 2008-05-13 02:32 (Reply)

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Markdown format allowed
 
 

JavaScript String .fromCharCode

Calendar

« February '12 »
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        

Quicksearch

Kategorien

  • XML computer
  • XML misc
  • XML web
  • XML zeitgeist


All categories

Archiv

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • Recent...
  • Older...

Feeds

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments

Links

Retinacast
Shackspace
Yaxim
Radio Tux
Kais Blog
Blumen Pfleiderer
Alk
paxos
filzo
Marc Seeger
polzifer
Moritz Haarmann

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 scala screenshot sdk security server shortys software stuff tail -f /var/log/life test tool tv unix video web webdesign webwide windows xml zeitgeist

Lizenz

Creative Commons License - Some Rights Reserved