The D Scripting Language

retard re at tard.com.invalid
Sat Nov 13 00:24:13 PST 2010


Fri, 12 Nov 2010 23:01:24 +0600, Alexander Malakhov wrote:

> Gary Whatmore <no at spam.sp> писал(а) в своём письме Thu, 11 Nov 2010
> 20:07:35 +0600:
> 
>> Alexander Malakhov Wrote:
>>> ...
>>> Maybe it would be better to just make rdmd to surround source code
>>> with:
>>>
>>> //----- rdmd generated text BEGIN
>>> public import std.stdio, ...
>>>
>>> void main( string[] args ){
>>> //----- rdmd generated text END
>>>
>>> 	// programmer's code
>>> }
>>>
>>> in cases when rdmd detects there is no main()
>>
>> No, it could do that in all cases. D supports nested declarations. This
>> is how the other languages do this. It would improve the score a lot.
>> Did TDPL talk script programming? We can still change this radically
>> without breaking D2 - thank god the specification is informal and
>> incomplete.
> 
> Then you have 2 issues:
> 
> void main(string[] args){
> 
> 	import std.stdio; // 1. will not compile void main(string[] args){
> 		writeln("hello");
> 	}
> 
> 	main(args); // 2. this should be appended, hence anyway rdmd 
should
> analyze
> 		    //    if there is main()
> }

I don't have any opinion of this, but the 1) point make me ask, why 
imports can't be used inside methods just like in Scala. There's no 
technical reason other than "this adds bugs!" - at least no scientific 
research can prove this since Scala hasn't been in wide use that long.



More information about the Digitalmars-d mailing list