6
AUG
2009

Syntactic Beauty

Do you want to know something that I really like about REBOL? No? Well, too bad, because I'm telling you anyway. What I really like is the syntax of REBOL, or rather its lack of syntax.

Let's say you want to create an associative array in PHP, for example. It might look something like this:

$fruit_colors = array("banana" => "yellow",
                      "apple" => "green");

To print the color of a banana, you would then do something like this:

echo $fruit_colors["banana"];

Obviously, there's a whole lot of syntax going on there. If you have a swedish keyboard layout, like I do, you would have pressed a modifier key, like shift or alt, seven times while typing the last line alone, which strains your fingers. What if we were to do the same thing in REBOL?

fruit-colors: [
    banana yellow
    apple green
]
 
print fruit-colors/banana

It's so clean and beautiful that it makes me want to cry tears of joy. Well, not really. But almost.


 
Name:





CAPTCHA Image
Reload Image
(Surround code with --code-- and --/code--)


Comments are subject to review and will not be shown until they have been approved, for the purpose of keeping spammers and morons away.


 

About This Site

Hello, my name is Martin Johannesson and this is my home on the web. I live in Stockholm, Sweden, where I work as a software engineer at a software company.

Ever since I was a kid and discovered the art of programming on my C64, I've been tinkering with my own little software projects and experiments. This site is one such experiment.
more...

Recent Entries RSS Feed

Tags

Amiga blog C game GLGX GLSL iPad iPhone Java jQuery OpenAL OpenGL Programming REBOL Shaders Vertex Shader web

Blog Archive

2010: 01 02 03 04 05 06 07 08 09 10 11 12
2009: 01 02 03 04 05 06 07 08 09 10 11 12

Random Images Load new images

loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading

People I Know