A little of coordination for Rosettacode

Adam D. Ruppe destructionator at gmail.com
Sun Jun 16 16:48:28 PDT 2013


On Sunday, 16 June 2013 at 23:06:40 UTC, bearophile wrote:
> Normal Rosettacode entries are under 40-100 lines. Many entries 
> are about 10-20 lines long.

I think that biases it toward giant standard libraries. I've 
joked before that we could just say:

import rosettacode;
mixin Distributed!();

and win the code golf every time! :P

But this asks for something pretty generic and the Go version for 
instance uses a rpc package that looks pretty similar to what I 
did here. The only reason their thing is short is because it is 
in the stdlib. (I betcha Go's stdlib implementation is longer 
than 500 lines too!)

> What do you suggest to do?

We could break the file into two parts, and link to one. Just as 
I feared though, the structs don't work because mixing in their 
name doesn't get the right import either. This is one 
disappointing limitation of string mixins that I've hit before 
too, when doing default arguments in web.d. It works for basic 
types but not for enums because while I can get the string 
representation, I can't get the actual type anymore.

It would be great if we could describe a very specific type in a 
string mixin that the compiler knows, even if the imports aren't 
necessarily there.


If I remove the struct example, it works with separate modules, 
so let's try that for now until I can think of a solution to the 
general problem here.

code:
http://arsdnet.net/dcode/rpc-example.d

library:
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/rpc.d


More information about the Digitalmars-d-learn mailing list