One document about Go

Jacob Carlborg doob at me.com
Wed Jun 2 02:36:05 PDT 2010


On 2010-06-01 22:27, Adam Ruppe wrote:
> On 6/1/10, bearophile<bearophileHUGS at lycos.com>  wrote:
>> It looks also like the Ruby blocks. But D seems designed to work with a
>> simpler back-end in mind, unable to "digest" delegates.
>
> But, D can do the given example, only with parens and an semi thrown
> in. The back end can obviously handle delegates.

Yes of course, that's the thing, you have to have the parenthesis and 
semicolons. If you don't, you can have a nicer syntax and you can create 
functions that looks like built in language constructs:

loop (int i) {
	println(i)
}

Or:

[1, 5, 3, 5].each (int i) {
	println(i)
}

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list